fix(lsp): enable additional capabilities (#15470)

Declaration, type-definition, and implementation capabilities were
previously disabled if the client received table output from the server
capabilities. The workDoneProgress capability is sent for many servers
for all supported capabilities as part of this table. Default to setting 
capability to table instead of false.
This commit is contained in:
Michael Lingelbach 2021-08-23 16:25:15 -04:00 committed by GitHub
parent a92e83ac14
commit 5d633546bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1003,8 +1003,7 @@ function protocol.resolve_capabilities(server_capabilities)
elseif type(server_capabilities.declarationProvider) == 'boolean' then
general_properties.declaration = server_capabilities.declarationProvider
elseif type(server_capabilities.declarationProvider) == 'table' then
-- TODO: support more detailed declarationProvider options.
general_properties.declaration = false
general_properties.declaration = server_capabilities.declarationProvider
else
error("The server sent invalid declarationProvider")
end
@ -1014,8 +1013,7 @@ function protocol.resolve_capabilities(server_capabilities)
elseif type(server_capabilities.typeDefinitionProvider) == 'boolean' then
general_properties.type_definition = server_capabilities.typeDefinitionProvider
elseif type(server_capabilities.typeDefinitionProvider) == 'table' then
-- TODO: support more detailed typeDefinitionProvider options.
general_properties.type_definition = false
general_properties.type_definition = server_capabilities.typeDefinitionProvider
else
error("The server sent invalid typeDefinitionProvider")
end
@ -1025,8 +1023,7 @@ function protocol.resolve_capabilities(server_capabilities)
elseif type(server_capabilities.implementationProvider) == 'boolean' then
general_properties.implementation = server_capabilities.implementationProvider
elseif type(server_capabilities.implementationProvider) == 'table' then
-- TODO(ashkan) support more detailed implementation options.
general_properties.implementation = false
general_properties.implementation = server_capabilities.implementationProvider
else
error("The server sent invalid implementationProvider")
end