mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 09:46:02 +02:00
Turn on new content assist by default.
This commit is contained in:
parent
17481123ab
commit
a09f08ae6f
4 changed files with 16 additions and 11 deletions
|
@ -43,7 +43,8 @@ public class CodeAssistPreferencePage extends AbstractPreferencePage {
|
||||||
ArrayList overlayKeys = new ArrayList();
|
ArrayList overlayKeys = new ArrayList();
|
||||||
|
|
||||||
// temporary
|
// temporary
|
||||||
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, ContentAssistPreference.USE_DOM));
|
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, ContentAssistPreference.DONT_USE_DOM));
|
||||||
|
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, ContentAssistPreference.TIME_DOM));
|
||||||
|
|
||||||
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.INT, ContentAssistPreference.AUTOACTIVATION_DELAY));
|
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.INT, ContentAssistPreference.AUTOACTIVATION_DELAY));
|
||||||
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, ContentAssistPreference.AUTOINSERT));
|
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, ContentAssistPreference.AUTOINSERT));
|
||||||
|
@ -78,7 +79,8 @@ public class CodeAssistPreferencePage extends AbstractPreferencePage {
|
||||||
contentAssistComposite.setLayout(layout);
|
contentAssistComposite.setLayout(layout);
|
||||||
|
|
||||||
// temporary use DOM
|
// temporary use DOM
|
||||||
addCheckBox(contentAssistComposite, "Use DOM (Work in progress)", ContentAssistPreference.USE_DOM, 0);
|
addCheckBox(contentAssistComposite, "Use Old Content Assist (Work in progress)", ContentAssistPreference.DONT_USE_DOM, 0);
|
||||||
|
addCheckBox(contentAssistComposite, "Print Completion Times (Work in progress)", ContentAssistPreference.TIME_DOM, 0);
|
||||||
|
|
||||||
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
|
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
|
||||||
// The following three radio buttons are grouped together
|
// The following three radio buttons are grouped together
|
||||||
|
|
|
@ -199,9 +199,9 @@ public class CSourceViewerConfiguration extends TextSourceViewerConfiguration {
|
||||||
ContentAssistant assistant = new ContentAssistant();
|
ContentAssistant assistant = new ContentAssistant();
|
||||||
|
|
||||||
IContentAssistProcessor processor
|
IContentAssistProcessor processor
|
||||||
= getPreferenceStore().getBoolean(ContentAssistPreference.USE_DOM)
|
= getPreferenceStore().getBoolean(ContentAssistPreference.DONT_USE_DOM)
|
||||||
? (IContentAssistProcessor)new CCompletionProcessor2(getEditor())
|
? (IContentAssistProcessor)new CCompletionProcessor(getEditor())
|
||||||
: (IContentAssistProcessor)new CCompletionProcessor(getEditor());
|
: (IContentAssistProcessor)new CCompletionProcessor2(getEditor());
|
||||||
assistant.setContentAssistProcessor(processor, IDocument.DEFAULT_CONTENT_TYPE);
|
assistant.setContentAssistProcessor(processor, IDocument.DEFAULT_CONTENT_TYPE);
|
||||||
|
|
||||||
//Will this work as a replacement for the configuration lines below?
|
//Will this work as a replacement for the configuration lines below?
|
||||||
|
|
|
@ -81,10 +81,12 @@ public class CCompletionProcessor2 implements IContentAssistProcessor {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (CUIPlugin.getDefault().getPreferenceStore().getBoolean(ContentAssistPreference.TIME_DOM)) {
|
||||||
long propTime = System.currentTimeMillis();
|
long propTime = System.currentTimeMillis();
|
||||||
System.out.println("Completion Parse: " + (stopTime - startTime) + " + Proposals: " //$NON-NLS-1$ //$NON-NLS-2$
|
System.out.println("Completion Parse: " + (stopTime - startTime) + " + Proposals: " //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
+ (propTime - stopTime));
|
+ (propTime - stopTime));
|
||||||
System.out.flush();
|
System.out.flush();
|
||||||
|
}
|
||||||
|
|
||||||
if (!proposals.isEmpty()) {
|
if (!proposals.isEmpty()) {
|
||||||
errorMessage = null;
|
errorMessage = null;
|
||||||
|
|
|
@ -23,7 +23,8 @@ import org.eclipse.jface.util.PropertyChangeEvent;
|
||||||
public class ContentAssistPreference {
|
public class ContentAssistPreference {
|
||||||
|
|
||||||
// Temporary to use DOM for assist
|
// Temporary to use DOM for assist
|
||||||
public final static String USE_DOM = "content_assist_use_dom"; //$NON-NLS-1$
|
public final static String DONT_USE_DOM = "content_assist_dont_use_dom"; //$NON-NLS-1$
|
||||||
|
public final static String TIME_DOM = "content_assist_time_dom"; //$NON-NLS-1$
|
||||||
|
|
||||||
/** Preference key for content assist auto activation */
|
/** Preference key for content assist auto activation */
|
||||||
//public final static String AUTOACTIVATION= "content_assist_autoactivation";
|
//public final static String AUTOACTIVATION= "content_assist_autoactivation";
|
||||||
|
|
Loading…
Add table
Reference in a new issue