Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dundalek committed Mar 22, 2024
1 parent 40b9bd8 commit c44049b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ require("lazy-lsp").setup {
excluded_servers = {
"ccls", "zk",
},
prefer_local = true, -- Prefer locally installed servers over nix-shell
-- Alternatively specify preferred servers for a filetype (others will be ignored).
preferred_servers = {
haskell = { "hls" },
rust = { "rust_analyzer" },
markdown = {},
python = { "pyright", "ruff_lsp" },
},
prefer_local = true, -- Prefer locally installed servers over nix-shell
-- Default config passed to all servers to specify on_attach callback and other options.
default_config = {
flags = {
Expand All @@ -99,6 +99,12 @@ require("lazy-lsp").setup {
}
```

## Curated servers

The philosophy of this plugin is to enable all possible plugins by default to get the highest chance of LSP functionality being available, even at a cost of starting multiple servers for a single language. Any misbehaving or unwanted servers can be excluded one by one.

If this is not what you want, you can give a try to the [curated configuration](servers.md#curated-servers) that enables smaller selection of recommended servers.

## How it works

`lazy-lsp` registers all available configurations from lspconfig to start LSP servers by wrapping the commands in a [nix-shell](https://nixos.org/manual/nix/unstable/command-ref/nix-shell.html) environment. The nix-shell prepares the environment by pulling all specified dependencies regardless of what is installed on the host system and avoids packages clashes. The first time a server is run there is a delay until dependencies are downloaded, but on subsequent runs the time to prepare the shell environment is negligeable.
Expand Down

0 comments on commit c44049b

Please sign in to comment.