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(
18
18
languageServer : RoslynLanguageServer
19
19
) {
20
20
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
+ ) {
23
27
return ;
24
28
}
25
29
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import { LanguageServerEvents } from '../languageServerEvents';
12
12
import { ServerState } from '../serverStateChange' ;
13
13
14
14
export interface ProjectContextChangeEvent {
15
+ languageId : string ;
15
16
uri : vscode . Uri ;
16
17
context : VSProjectContext ;
17
18
}
@@ -57,17 +58,18 @@ export class ProjectContextService {
57
58
const uri = textEditor ! . document . uri ;
58
59
59
60
if ( ! this . _languageServer . isRunning ( ) ) {
60
- this . _contextChangeEmitter . fire ( { uri, context : this . _emptyProjectContext } ) ;
61
+ this . _contextChangeEmitter . fire ( { languageId , uri, context : this . _emptyProjectContext } ) ;
61
62
return ;
62
63
}
63
64
64
65
const contextList = await this . getProjectContexts ( uri , this . _source . token ) ;
65
66
if ( ! contextList ) {
67
+ this . _contextChangeEmitter . fire ( { languageId, uri, context : this . _emptyProjectContext } ) ;
66
68
return ;
67
69
}
68
70
69
71
const context = contextList . _vs_projectContexts [ contextList . _vs_defaultIndex ] ;
70
- this . _contextChangeEmitter . fire ( { uri, context } ) ;
72
+ this . _contextChangeEmitter . fire ( { languageId , uri, context } ) ;
71
73
}
72
74
73
75
private async getProjectContexts (
You can’t perform that action at this time.
0 commit comments