Skip to content

Commit

Permalink
Merge pull request #193 from bollwyvl/handle-no-document-symbol
Browse files Browse the repository at this point in the history
Handle less-specified initialization
  • Loading branch information
JPinkney authored Oct 23, 2019
2 parents b51c7d0 + 8fc85c0 commit 9a1c4fe
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,9 +347,18 @@ 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 || [];

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

return {
capabilities: {
Expand Down

0 comments on commit 9a1c4fe

Please sign in to comment.