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