@@ -49,7 +49,7 @@ public IEditorDescriptor[] overrideEditors(IEditorInput editorInput, IContentTyp
4949 if (isNoCElement (contentType )) {
5050 return editorDescriptors ;
5151 }
52- if (isEnabledFor (editorInput )) {
52+ if (isEnabledFor (editorInput , contentType )) {
5353 return editorFilter (LspPlugin .C_EDITOR_ID , editorDescriptors ); // remove CDT C-Editor
5454 }
5555 return editorFilter (LspPlugin .LSP_C_EDITOR_ID , editorDescriptors ); // remove LSP based C-Editor
@@ -82,7 +82,7 @@ public IEditorDescriptor overrideDefaultEditor(String fileName, IContentType con
8282 return editorDescriptor ;
8383 }
8484
85- private boolean isEnabledFor (IEditorInput editorInput ) {
85+ private boolean isEnabledFor (IEditorInput editorInput , IContentType contentType ) {
8686 if (cLanguageServerProvider == null )
8787 return false ;
8888 IResource resource = editorInput .getAdapter (IResource .class );
@@ -94,7 +94,7 @@ private boolean isEnabledFor(IEditorInput editorInput) {
9494 return enabled ;
9595 }
9696 // 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 );
9898 }
9999
100100 private void deleteCodanMarkers (IResource resource ) {
@@ -141,7 +141,7 @@ private IEditorDescriptor getEditorDescriptor(IEditorInput editorInput, IContent
141141 if (isNoCElement (contentType ))
142142 return null ;
143143
144- if (isEnabledFor (editorInput )) {
144+ if (isEnabledFor (editorInput , contentType )) {
145145 return getEditorDescriptorById (editorInput .getName (), LspPlugin .LSP_C_EDITOR_ID , contentType ); // return LSP based C/C++ Editor
146146 }
147147 // TODO: return null; when either https://github.com/eclipse-cdt/cdt/pull/310 or
0 commit comments