File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
src/VisualStudio/Core/Def/EditorConfigSettings Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ public void Dispose()
6363 }
6464
6565 public int CreateEditorInstance ( uint grfCreateDoc ,
66- string pszMkDocument ,
66+ string filePath ,
6767 string pszPhysicalView ,
6868 IVsHierarchy pvHier ,
6969 uint itemid ,
@@ -88,6 +88,12 @@ public int CreateEditorInstance(uint grfCreateDoc,
8888 return VSConstants . VS_E_UNSUPPORTEDFORMAT ;
8989 }
9090
91+ if ( ! _workspace . CurrentSolution . Projects . Any ( p => p . AnalyzerConfigDocuments . Any ( editorconfig => StringComparer . OrdinalIgnoreCase . Equals ( editorconfig . FilePath , filePath ) ) ) )
92+ {
93+ // If the user is simply opening an editorconfig file that does not apply to the current solution we just want to show the text view
94+ return VSConstants . VS_E_UNSUPPORTEDFORMAT ;
95+ }
96+
9197 // Validate inputs
9298 if ( ( grfCreateDoc & ( VSConstants . CEF_OPENFILE | VSConstants . CEF_SILENT ) ) == 0 )
9399 {
@@ -138,7 +144,7 @@ public int CreateEditorInstance(uint grfCreateDoc,
138144 _settingsDataProviderFactory ,
139145 _controlProvider ,
140146 _tableMangerProvider ,
141- pszMkDocument ,
147+ filePath ,
142148 textBuffer ,
143149 _workspace ) ;
144150 ppunkDocView = Marshal . GetIUnknownForObject ( newEditor ) ;
You can’t perform that action at this time.
0 commit comments