Skip to content

Commit fcfe397

Browse files
msivasubramaniaanunknown
and
unknown
authored
Fix client/registerCapability request when workspaces/didChangeWorksp… (#598)
* Fix client/registerCapability request when workspaces/didChangeWorkspaceFolder even if dynamicRegistration set to false * rename hasWsChangeWatchedFileDynamicRegistration Co-authored-by: unknown <[email protected]>
1 parent 47ba49b commit fcfe397

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/yamlServerInit.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export class YAMLServerInit {
4444
}
4545
);
4646
this.connection.onInitialized(() => {
47-
if (this.yamlSettings.hasWorkspaceFolderCapability) {
47+
if (this.yamlSettings.hasWsChangeWatchedFileDynamicRegistration) {
4848
this.connection.workspace.onDidChangeWorkspaceFolders((changedFolders) => {
4949
this.yamlSettings.workspaceFolders = workspaceFoldersChanged(this.yamlSettings.workspaceFolders, changedFolders);
5050
});
@@ -88,6 +88,12 @@ export class YAMLServerInit {
8888
this.yamlSettings.hasConfigurationCapability = !!(
8989
this.yamlSettings.capabilities.workspace && !!this.yamlSettings.capabilities.workspace.configuration
9090
);
91+
92+
this.yamlSettings.hasWsChangeWatchedFileDynamicRegistration = !!(
93+
this.yamlSettings.capabilities.workspace &&
94+
this.yamlSettings.capabilities.workspace.didChangeWatchedFiles &&
95+
this.yamlSettings.capabilities.workspace.didChangeWatchedFiles.dynamicRegistration
96+
);
9197
this.registerHandlers();
9298

9399
return {

src/yamlSettings.ts

+1
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ export class SettingsState {
8484
hasConfigurationCapability = false;
8585
useVSCodeContentRequest = false;
8686
yamlVersion: YamlVersion = '1.2';
87+
hasWsChangeWatchedFileDynamicRegistration = false;
8788
}
8889

8990
export class TextDocumentTestManager extends TextDocuments<TextDocument> {

0 commit comments

Comments
 (0)