30
30
public class CLanguageServerRegistry {
31
31
private static final String EXTENSION_ID = LspPlugin .PLUGIN_ID + ".serverProvider" ; //$NON-NLS-1$
32
32
private static final String SERVER_ELEMENT = "server" ; //$NON-NLS-1$
33
- private static final String ELEMENT_CONTENT_TESTER = "contentTester " ; //$NON-NLS-1$
33
+ private static final String ELEMENT_EDITOR_TEST = "editorTest " ; //$NON-NLS-1$
34
34
private static final String CLASS = "class" ; //$NON-NLS-1$
35
35
private static final String ENABLED_WHEN_ATTRIBUTE = "enabledWhen" ; //$NON-NLS-1$
36
36
private final IExtensionPoint cExtensionPoint ;
@@ -40,7 +40,7 @@ public CLanguageServerRegistry() {
40
40
}
41
41
42
42
public ICEditorTest createCEditorTest () throws InvalidRegistryObjectException {
43
- ICEditorTest propertyTester = (ICEditorTest ) getInstanceFromExtension (ELEMENT_CONTENT_TESTER , ICEditorTest .class );
43
+ ICEditorTest propertyTester = (ICEditorTest ) getInstanceFromExtension (ELEMENT_EDITOR_TEST , ICEditorTest .class );
44
44
if (propertyTester == null ) {
45
45
LspPlugin .logWarning ("No C/C++ editor input tester defined" );
46
46
return new DefaultCEditorTest ();
@@ -55,10 +55,10 @@ public ICLanguageServerCommandProvider createCLanguageServerCommandProvider() {
55
55
if (provider == null ) {
56
56
LspPlugin .logWarning ("No C/C++ language server defined" );
57
57
}
58
-
58
+
59
59
return provider ;
60
60
}
61
-
61
+
62
62
public EnableExpression getEnablementExpression () {
63
63
EnableExpression enableExpression = null ;
64
64
for (IConfigurationElement configurationElement : cExtensionPoint .getConfigurationElements ()) {
@@ -70,7 +70,8 @@ public EnableExpression getEnablementExpression() {
70
70
IConfigurationElement [] enabledWhenChildren = enabledWhen .getChildren ();
71
71
if (enabledWhenChildren .length == 1 ) {
72
72
try {
73
- enableExpression = new EnableExpression (this ::getEvaluationContext , ExpressionConverter .getDefault ().perform (enabledWhenChildren [0 ]));
73
+ enableExpression = new EnableExpression (this ::getEvaluationContext ,
74
+ ExpressionConverter .getDefault ().perform (enabledWhenChildren [0 ]));
74
75
} catch (CoreException e ) {
75
76
LspPlugin .logWarning (e .getMessage (), e );
76
77
}
@@ -81,7 +82,7 @@ public EnableExpression getEnablementExpression() {
81
82
}
82
83
return enableExpression ;
83
84
}
84
-
85
+
85
86
private IEvaluationContext getEvaluationContext () {
86
87
return Optional .ofNullable (PlatformUI .getWorkbench ().getService (IHandlerService .class )).map (IHandlerService ::getCurrentState ).orElse (null );
87
88
}
0 commit comments