nvf icon indicating copy to clipboard operation
nvf copied to clipboard

languages: inherit lspconfig options from language options

Open NotAShelf opened this issue 10 months ago • 2 comments

Converts all language modules to a newer, more robust lsp.options format that allows seamless overrides. This should be considered the first step of the grand language rework, where other options (diagnostics, formatters) will follow.

Adds lib.lspOptions to expose an extensible attribute set to provide the option table for each LSP server template via lspconfig.

Converted languages:

  • [x] Assembly (asm-lsp)
  • [x] Astro
  • [x] Bash
  • [x] Clang
  • [ ] Csharp
  • [ ] CSS
  • [x] Cue
  • [x] Dart
  • [ ] Gleam
  • [ ] Go
  • [ ] Haskell
  • [ ] HCL
  • [ ] Helm
  • [ ] HTML
  • [ ] Java
  • [ ] Julia
  • [ ] Kotlin
  • [ ] Lua
  • [ ] Markdown
  • [ ] Nim
  • [ ] Nix
  • [ ] Nu
  • [ ] OCaml
  • [ ] Odin
  • [ ] PHP
  • [ ] Python
  • [ ] R
  • [ ] Ruby
  • [ ] Rust
  • [ ] Scala
  • [ ] SQL
  • [ ] Svelte
  • [ ] Tailwind
  • [ ] Terraform
  • [ ] TS
  • [ ] Typst
  • [ ] Vala
  • [ ] YAML
  • [ ] Zig

NotAShelf avatar Feb 16 '25 09:02 NotAShelf

:rocket: Live preview deployed from 99f1200c8db9295e556255e49175a6d2a5c02fbd

View it here:

Debug Information

Triggered by: NotAShelf

HEAD at: lsp-configuration-opts

Reruns: 813

github-actions[bot] avatar Feb 16 '25 09:02 github-actions[bot]

  • with nvim-0.11 additions, we should provide default capabilities via vim.lsp.config('*', {capabilities = ...})
  • same thing for on_attach

EDIT: turns out nvim supports on_attach natively

with this I think we can get rid of lspconfig for configuring LSPs, we still keep lspconfig for default server configs, but we don't use their API anymore (oh my god I can already feel the amount of plugins breakages because of this)

horriblename avatar Mar 27 '25 12:03 horriblename

Is there anything i can do to help move this along?

I would love to have this configurability in my config

sjcobb2022 avatar May 08 '25 11:05 sjcobb2022

Is there anything i can do to help move this along?

I would love to have this configurability in my config

I should've closed this PR, as it's superseded by https://github.com/NotAShelf/nvf/pull/801 in its entirety. The new vim.lsp.servers option is already in main branch if you're interested in configuring your own LSPs, but feel free to submit PRs to convert LSPs not covered by #801 if you would like to contribute

NotAShelf avatar May 08 '25 11:05 NotAShelf

✅ Preview has been deleted successfully!

github-actions[bot] avatar May 08 '25 11:05 github-actions[bot]