File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -18,8 +18,12 @@ export function registerMiscellaneousFileNotifier(
1818 languageServer : RoslynLanguageServer
1919) {
2020 languageServer . _projectContextService . onActiveFileContextChanged ( ( e ) => {
21- // Only warn for miscellaneous files when the workspace is fully initialized.
22- if ( ! e . context . _vs_is_miscellaneous || languageServer . state !== ServerState . ProjectInitializationComplete ) {
21+ // Only warn for C# miscellaneous files when the workspace is fully initialized.
22+ if (
23+ e . languageId !== 'csharp' ||
24+ ! e . context . _vs_is_miscellaneous ||
25+ languageServer . state !== ServerState . ProjectInitializationComplete
26+ ) {
2327 return ;
2428 }
2529
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import { LanguageServerEvents } from '../languageServerEvents';
1212import { ServerState } from '../serverStateChange' ;
1313
1414export interface ProjectContextChangeEvent {
15+ languageId : string ;
1516 uri : vscode . Uri ;
1617 context : VSProjectContext ;
1718}
@@ -57,17 +58,18 @@ export class ProjectContextService {
5758 const uri = textEditor ! . document . uri ;
5859
5960 if ( ! this . _languageServer . isRunning ( ) ) {
60- this . _contextChangeEmitter . fire ( { uri, context : this . _emptyProjectContext } ) ;
61+ this . _contextChangeEmitter . fire ( { languageId , uri, context : this . _emptyProjectContext } ) ;
6162 return ;
6263 }
6364
6465 const contextList = await this . getProjectContexts ( uri , this . _source . token ) ;
6566 if ( ! contextList ) {
67+ this . _contextChangeEmitter . fire ( { languageId, uri, context : this . _emptyProjectContext } ) ;
6668 return ;
6769 }
6870
6971 const context = contextList . _vs_projectContexts [ contextList . _vs_defaultIndex ] ;
70- this . _contextChangeEmitter . fire ( { uri, context } ) ;
72+ this . _contextChangeEmitter . fire ( { languageId , uri, context } ) ;
7173 }
7274
7375 private async getProjectContexts (
You can’t perform that action at this time.
0 commit comments