@@ -49,7 +49,7 @@ public IEditorDescriptor[] overrideEditors(IEditorInput editorInput, IContentTyp
49
49
if (isNoCElement (contentType )) {
50
50
return editorDescriptors ;
51
51
}
52
- if (isEnabledFor (editorInput )) {
52
+ if (isEnabledFor (editorInput , contentType )) {
53
53
return editorFilter (LspPlugin .C_EDITOR_ID , editorDescriptors ); // remove CDT C-Editor
54
54
}
55
55
return editorFilter (LspPlugin .LSP_C_EDITOR_ID , editorDescriptors ); // remove LSP based C-Editor
@@ -82,7 +82,7 @@ public IEditorDescriptor overrideDefaultEditor(String fileName, IContentType con
82
82
return editorDescriptor ;
83
83
}
84
84
85
- private boolean isEnabledFor (IEditorInput editorInput ) {
85
+ private boolean isEnabledFor (IEditorInput editorInput , IContentType contentType ) {
86
86
if (cLanguageServerProvider == null )
87
87
return false ;
88
88
IResource resource = editorInput .getAdapter (IResource .class );
@@ -94,7 +94,7 @@ private boolean isEnabledFor(IEditorInput editorInput) {
94
94
return enabled ;
95
95
}
96
96
// When resource == null it's an external file: Check if the file is already opened, if not check the active editor:
97
- return LspUtils .isFileOpenedInLspEditor (editorInput );
97
+ return LspUtils .isFileOpenedInLspEditor (editorInput , contentType );
98
98
}
99
99
100
100
private void deleteCodanMarkers (IResource resource ) {
@@ -141,7 +141,7 @@ private IEditorDescriptor getEditorDescriptor(IEditorInput editorInput, IContent
141
141
if (isNoCElement (contentType ))
142
142
return null ;
143
143
144
- if (isEnabledFor (editorInput )) {
144
+ if (isEnabledFor (editorInput , contentType )) {
145
145
return getEditorDescriptorById (editorInput .getName (), LspPlugin .LSP_C_EDITOR_ID , contentType ); // return LSP based C/C++ Editor
146
146
}
147
147
// TODO: return null; when either https://github.com/eclipse-cdt/cdt/pull/310 or
0 commit comments