-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Understanding setup {}
The principal way of enabling a language server with lspconfig is the setup {}
call. The main keys users will typically pass into setup
are settings
on_init
, and on_attach
.
The settings
table is sent to the language server via a workspace/didChangeConfiguration
notification from the client. lspconfig
sends this notification for you automatically during initialization of the language server using the cached settings
table you pass to setup{}
.
In most cases, the default settings are correct. If you would like to override the settings you can see available options in CONFIG.md, these are auto-generated from the package.json
used by the vscode plugin leveraging the language server, if available. For pyright as an example, the pyright.disableLanguageServices
option listed in the drop down settings menu in CONFIG.md can be sent as follows:
require('lspconfig').pyright.setup {
settings = {
pyright = {
disableLanguageServices = true,
},
},
}