mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-06-10 07:00:00 +00:00
Merge branch 'main' into fix/invalid-keys-in-haskell-tools
This commit is contained in:
commit
96097bf3ec
27 changed files with 1142 additions and 483 deletions
|
|
@ -1,28 +1,4 @@
|
|||
# LSP Custom Packages/Command {#sec-languages-custom-lsp-packages}
|
||||
|
||||
One of the strengths of **nvf** is convenient aliases to quickly configure LSP
|
||||
servers through the Nix module system. By default the LSP packages for relevant
|
||||
language modules will be pulled into the closure. If this is not desirable, you
|
||||
may provide **a custom LSP package** (e.g., a Bash script that calls a command)
|
||||
or **a list of strings** to be interpreted as the command to launch the language
|
||||
server. By using a list of strings, you can use this to skip automatic
|
||||
installation of a language server, and instead use the one found in your `$PATH`
|
||||
during runtime, for example:
|
||||
|
||||
```nix
|
||||
vim.languages.java = {
|
||||
lsp = {
|
||||
enable = true;
|
||||
|
||||
# This expects 'jdt-language-server' to be in your PATH or in
|
||||
# 'vim.extraPackages.' There are no additional checks performed to see
|
||||
# if the command provided is valid.
|
||||
package = ["jdt-language-server" "-data" "~/.cache/jdtls/workspace"];
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
## Custom LSP Servers {#ch-custom-lsp-servers}
|
||||
# LSP Customizations {#sec-lsp-customization}
|
||||
|
||||
Neovim 0.11, in an effort to improve the out-of-the-box experience of Neovim,
|
||||
has introduced a new `vim.lsp` API that can be used to register custom LSP
|
||||
|
|
@ -30,18 +6,50 @@ servers with ease. In **nvf**, this translates to the custom `vim.lsp` API that
|
|||
can be used to register servers that are not present in existing language
|
||||
modules.
|
||||
|
||||
The {option}`vim.lsp.servers` submodule can be used to modify existing LSP
|
||||
definitions OR register your own custom LSPs respectively. For example, if you'd
|
||||
like to avoid having NVF pull the LSP packages you may modify the start command
|
||||
to use a string, which will cause the LSP API to discover LSP servers from
|
||||
{env}`PATH`. For example:
|
||||
The {option}`vim.lsp.servers` submodule mirrors the `vim.lsp.config` lua API,
|
||||
and can be used to modify existing LSP definitions OR register your own custom
|
||||
LSPs.
|
||||
|
||||
## Configuring LSP presets {#ch-configuring-lsp-presets}
|
||||
|
||||
LSP presets provided by NVF via `vim.languages.*.lsp` can be further customized
|
||||
with the {option}`vim.lsp.servers` submodule.
|
||||
|
||||
For example, if you'd like to avoid having NVF pull the LSP packages you may
|
||||
modify the start command to use a string, which will cause the LSP API to
|
||||
discover LSP servers from {env}`PATH`.
|
||||
|
||||
An example for **modifying a preset** provided by NVF via `vim.languages.*.lsp`:
|
||||
|
||||
```nix
|
||||
{lib, ...}: {
|
||||
vim.languages.python = {
|
||||
enable = true;
|
||||
lsp = {
|
||||
enable = true;
|
||||
|
||||
# This is already the default value, we're just writing this down for
|
||||
# clarity
|
||||
servers = ["basedpyright"]
|
||||
};
|
||||
};
|
||||
|
||||
vim.lsp.servers = {
|
||||
# Get `basedpyright-langserver` from PATH, e.g., a dev shell.
|
||||
basedpyright.cmd = lib.mkForce ["basedpyright-langserver" "--stdio"];
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
## Adding custom LSP Servers {#ch-custom-lsp}
|
||||
|
||||
{option}`vim.lsp.servers` is also used to add your custom LSP definitions.
|
||||
|
||||
Example:
|
||||
|
||||
```nix
|
||||
{lib, ...}: {
|
||||
vim.lsp.servers = {
|
||||
# Define a custom LSP entry using `vim.lsp.servers`:
|
||||
ty = {
|
||||
cmd = lib.mkDefault [(lib.getExe pkgs.ty) "server"];
|
||||
|
|
@ -55,9 +63,10 @@ to use a string, which will cause the LSP API to discover LSP servers from
|
|||
"pyrightconfig.json"
|
||||
];
|
||||
|
||||
# If your LSP accepts custom settings. See `:help lsp-config` for more details
|
||||
# on available fields. This is a freeform field.
|
||||
settings.ty = { /* ... */ };
|
||||
# If your LSP accepts custom settings. See `:help lsp-config` for more
|
||||
# details on available fields. This is a freeform field.
|
||||
settings.ty = { /* ... */ };
|
||||
};
|
||||
};
|
||||
}
|
||||
```
|
||||
|
|
|
|||
|
|
@ -121,6 +121,10 @@
|
|||
SCSS/SASS. This also changes the default LSP to `some-sass-language-server`
|
||||
for SCSS/SASS.
|
||||
|
||||
- Split React/TSX from `languages.typescript` into `languages.tsx`. This new
|
||||
module provides jsx/tsx support. This is a step of cleaning up the Typescript
|
||||
module for the future.
|
||||
|
||||
[CaueAnjos](https://github.com/caueanjos)
|
||||
|
||||
- Renamed `roslyn_ls` to `roslyn-ls`
|
||||
|
|
@ -301,6 +305,10 @@
|
|||
|
||||
[Snoweuph](https://github.com/snoweuph)
|
||||
|
||||
- Allow the usage of `pks.tree-sitter-grammars` in
|
||||
{option}`vim.treesitter.grammars` and language module tree-sitter package
|
||||
options created via `mkGrammarOption`.
|
||||
|
||||
- Add `emmet-ls` to the supported LSPs for all languages it supports.
|
||||
|
||||
- Added {option}`vim.treesitter.queries` to support adding custom queries.
|
||||
|
|
@ -408,11 +416,15 @@
|
|||
|
||||
- Added `asmfmt` and `nasmfmt` formatters to `languages.asm`.
|
||||
|
||||
- Added `astyle`, `indent` and `clang-format` to `languages.clang` formatters.
|
||||
|
||||
- Added `biome-check` and `biome-organize-imports` formatters to `languages.ts`.
|
||||
|
||||
- Added [`biomejs`](https://biomejs.dev/) as extra diagnostics provider to
|
||||
`languages.ts`.
|
||||
|
||||
- Added `languages.standard-ml`.
|
||||
|
||||
- Added `languages.vue`.
|
||||
|
||||
- Add `languages.fluent` using the official plugin. This only provides
|
||||
|
|
@ -420,6 +432,8 @@
|
|||
|
||||
- Add `languages.gettext`. This only provides highlighting.
|
||||
|
||||
- Add `languages.env`. This provides extra filetype hooks and diagnostics.
|
||||
|
||||
- Add `languages.openscad` using
|
||||
[`openscad-lsp`](https://github.com/Leathong/openscad-LSP). This currently
|
||||
relies on neovim builtin syntax for highlighting, and the lsp for formatting
|
||||
|
|
@ -503,6 +517,12 @@ https://github.com/gorbit99/codewindow.nvim
|
|||
[poseidon-rises](https://github.com/poseidon-rises) in
|
||||
[!1107](https://github.com/NotAShelf/nvf/pull/1107).
|
||||
|
||||
[emo-mruczek](https://emo-mruczek.pet):
|
||||
|
||||
[vhdl-ls]: https://github.com/VHDL-LS/rust_hdl
|
||||
|
||||
- Add VHDL support with [vhdl-ls].
|
||||
|
||||
[itscrystalline](https://github.com/itscrystalline):
|
||||
|
||||
[img-clip.nvim]: https://github.com/hakonharnes/img-clip.nvim
|
||||
|
|
@ -547,4 +567,16 @@ https://github.com/gorbit99/codewindow.nvim
|
|||
- Allow `vim.treesitter.context.setupOpts.max_lines` to also be given as a
|
||||
string in order to allow percentage values like `"20%"`
|
||||
|
||||
[RoastedCheese](https://github.com/roastedcheese):
|
||||
|
||||
- Fix `golangci-lint` to lint at the package level.
|
||||
|
||||
[Poseidon](https://github.com/poseidon-rises)
|
||||
|
||||
[PHPStan]: https://github.com/phpstan/phpstan
|
||||
|
||||
- Add [PHPStan] as a formatter for `vim.languages.php`.
|
||||
- Add `prettier` and `prettierd` as supported formatters to
|
||||
`vim.languages.json`.
|
||||
|
||||
<!-- vim: set textwidth=80: -->
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue