aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2022-04-29 13:14:57 +0200
committerWilliam Boman <william@redwill.se>2022-04-29 13:15:46 +0200
commit48abdc9d32f56e038f4aca478cf6d5a1628b8286 (patch)
tree0fbf2b70c0c0446cf058f8cb9789d4705b2c80c3 /lua
parentfeat: add ensure_installed to setup table (#637) (diff)
downloadmason-48abdc9d32f56e038f4aca478cf6d5a1628b8286.tar
mason-48abdc9d32f56e038f4aca478cf6d5a1628b8286.tar.gz
mason-48abdc9d32f56e038f4aca478cf6d5a1628b8286.tar.bz2
mason-48abdc9d32f56e038f4aca478cf6d5a1628b8286.tar.lz
mason-48abdc9d32f56e038f4aca478cf6d5a1628b8286.tar.xz
mason-48abdc9d32f56e038f4aca478cf6d5a1628b8286.tar.zst
mason-48abdc9d32f56e038f4aca478cf6d5a1628b8286.zip
docs: more deprecations and update some outdated docs
Diffstat (limited to 'lua')
-rw-r--r--lua/nvim-lsp-installer.lua2
-rw-r--r--lua/nvim-lsp-installer/servers/eslint/README.md57
-rw-r--r--lua/nvim-lsp-installer/servers/zeta_note/init.lua1
3 files changed, 6 insertions, 54 deletions
diff --git a/lua/nvim-lsp-installer.lua b/lua/nvim-lsp-installer.lua
index ab566551..f41dbbf7 100644
--- a/lua/nvim-lsp-installer.lua
+++ b/lua/nvim-lsp-installer.lua
@@ -195,7 +195,6 @@ function M.install_by_filetype(filetype)
end
--- Queues a server to be installed. Will also open the status window.
---- Use the .on_server_ready(cb) function to register a handler to be executed when a server is ready to be set up.
---@param server_identifier string @The server to install. This can also include a requested version, for example "rust_analyzer@nightly".
function M.install(server_identifier)
local server_name, version = servers.parse_server_identifier(server_identifier)
@@ -266,6 +265,7 @@ function M.uninstall_all(no_confirm)
status_win().open()
end
+---@deprecated Setup servers directly via lspconfig instead. See https://github.com/williamboman/nvim-lsp-installer/discussions/636
---@param cb fun(server: Server) @Callback to be executed whenever a server is ready to be set up.
function M.on_server_ready(cb)
dispatcher.register_server_ready_callback(cb)
diff --git a/lua/nvim-lsp-installer/servers/eslint/README.md b/lua/nvim-lsp-installer/servers/eslint/README.md
index c3a115de..a8c2a301 100644
--- a/lua/nvim-lsp-installer/servers/eslint/README.md
+++ b/lua/nvim-lsp-installer/servers/eslint/README.md
@@ -1,43 +1,6 @@
# eslint
-## Enabling document formatting
-
-To make the `eslint` server respond to `textDocument/formatting` LSP requests, you need to manually enable this
-setting. This is done when setting up the LSP server, like so:
-
-```lua
-local lsp_installer = require "nvim-lsp-installer"
-
-function common_on_attach(client, bufnr)
- -- add your code here
-end
-
-lsp_installer.on_server_ready(function (server)
- local opts = {
- on_attach = common_on_attach,
- }
-
- if server.name == "eslint" then
- opts.on_attach = function (client, bufnr)
- -- neovim's LSP client does not currently support dynamic capabilities registration, so we need to set
- -- the resolved capabilities of the eslint server ourselves!
- client.resolved_capabilities.document_formatting = true
- common_on_attach(client, bufnr)
- end
- opts.settings = {
- format = { enable = true }, -- this will enable formatting
- }
- end
-
- server:setup(opts)
-end)
-```
-
-This will make `eslint` respond to formatting requests, for example when triggered through:
-
-- `:lua vim.lsp.buf.formatting()`
-- `:lua vim.lsp.buf.formatting_seq_sync()`
-- `:lua vim.lsp.buf.formatting_sync()`
+*NOTE*: You will have to install the [`eslint` package](https://www.npmjs.com/package/eslint) either locally or globally for the server to run successfully.
## Eslint in projects that use pnp
@@ -45,18 +8,8 @@ To allow the `eslint` server to resolve eslint and eslint plugins in a project t
command used to run the server. This is done when setting up the LSP server, like so:
```lua
-lsp_installer.on_server_ready(function (server)
- local opts = {
- on_attach = common_on_attach,
- }
-
- if server.name == "eslint" then
- local eslint_config = require("lspconfig.server_configurations.eslint")
- opts.cmd = { "yarn", "exec", unpack(eslint_config.default_config.cmd) }
- end
-
- server:setup(opts)
-end)
+local eslint_config = require("lspconfig.server_configurations.eslint")
+lspconfig.eslint.setup {
+ opts.cmd = { "yarn", "exec", unpack(eslint_config.default_config.cmd) }
+}
```
-
-*NOTE*: You will have to install the [`eslint` package](https://www.npmjs.com/package/eslint) either locally or globally for the server to run successfully.
diff --git a/lua/nvim-lsp-installer/servers/zeta_note/init.lua b/lua/nvim-lsp-installer/servers/zeta_note/init.lua
index 2658772e..3db58620 100644
--- a/lua/nvim-lsp-installer/servers/zeta_note/init.lua
+++ b/lua/nvim-lsp-installer/servers/zeta_note/init.lua
@@ -28,7 +28,6 @@ return function(name, root_dir)
std.chmod("+x", { "zeta-note" })
end,
default_options = {
- cmd = { "zeta-note" },
cmd_env = {
PATH = process.extend_path { root_dir },
},