Skip to content

Commit dd99170

Browse files
mickaelistriaKeen Yee Liau
authored andcommitted
Issue #909 - Explicit support for workspaceFolders
As per https://microsoft.github.io/language-server-protocol/specification#workspace_workspaceFolders , it's recommended that Language Servers that can work with multi-root workspaces declare support for workspaceFolders. For the angular language server, it's able to work with any file, independently of the workspace root; so it's naturally able to work with multiple roots. Declaring support for workspaceFolders allows clients that use the workspaceFolder heuristic as a way to decide of server instance multiplicity (should it be a single instance or 1 instance per root) to decide of starting only 1 instance of the LS. Without such information from the LS, the client integration has to audit the LS, and force some strategy to decide of the multiplicity, often in an hardcoded way; at the risk of being incorrect in the future if server changes its own strategy. So declaring workspaceFolders allow to automate a better integration in clients. Signed-off-by: Mickael Istria <[email protected]>
1 parent 4ae5146 commit dd99170

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

integration/lsp/smoke_spec.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ describe('Angular Language Service', () => {
108108
'completionProvider':
109109
{'resolveProvider': false, 'triggerCharacters': ['<', '.', '*', '[', '(', '$', '|']},
110110
'definitionProvider': true,
111-
'hoverProvider': true
111+
'hoverProvider': true,
112+
'workspace': {'workspaceFolders': {'supported': true}}
112113
}
113114
}
114115
});
@@ -136,7 +137,8 @@ describe('Angular Language Service', () => {
136137
'completionProvider':
137138
{'resolveProvider': false, 'triggerCharacters': ['<', '.', '*', '[', '(', '$', '|']},
138139
'definitionProvider': true,
139-
'hoverProvider': true
140+
'hoverProvider': true,
141+
'workspace': {'workspaceFolders': {'supported': true}}
140142
}
141143
}
142144
});

server/src/session.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,9 @@ export class Session {
240240
},
241241
definitionProvider: true,
242242
hoverProvider: true,
243+
workspace: {
244+
workspaceFolders: {supported: true},
245+
},
243246
},
244247
};
245248
}

0 commit comments

Comments
 (0)