Skip to content

Commit

Permalink
redhat-developer#192: handle less-specified initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
bollwyvl committed Oct 21, 2019
1 parent b51c7d0 commit ea14363
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,9 +347,12 @@ connection.onInitialize((params: InitializeParams): InitializeResult => {
if (params.rootUri) {
workspaceRoot = URI.parse(params.rootUri);
}
workspaceFolders = params.workspaceFolders;
hierarchicalDocumentSymbolSupport = !!capabilities.textDocument.documentSymbol.hierarchicalDocumentSymbolSupport;
clientDynamicRegisterSupport = !!(capabilities.textDocument.rangeFormatting && capabilities.textDocument.rangeFormatting.dynamicRegistration);
workspaceFolders = params.workspaceFolders || [];

const { documentSymbol, rangeFormatting } = capabilities.textDocument || {};

hierarchicalDocumentSymbolSupport = !!(documentSymbol && documentSymbol.hierarchicalDocumentSymbolSupport);
clientDynamicRegisterSupport = !!(rangeFormatting && rangeFormatting.dynamicRegistration);

return {
capabilities: {
Expand Down

0 comments on commit ea14363

Please sign in to comment.