aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorYi Ming <ofseed@foxmail.com>2026-03-13 15:25:53 +0800
committerYi Ming <ofseed@foxmail.com>2026-03-13 22:45:20 +0800
commit67bd0e6c9ec8f650524ef14721ace894f2b6f647 (patch)
treed8eb730d8d118d4e8d231a6e7548556374d06ffb /README.md
parentdocs: update configs.md (diff)
downloadnvim-lspconfig-67bd0e6c9ec8f650524ef14721ace894f2b6f647.tar
nvim-lspconfig-67bd0e6c9ec8f650524ef14721ace894f2b6f647.tar.gz
nvim-lspconfig-67bd0e6c9ec8f650524ef14721ace894f2b6f647.tar.bz2
nvim-lspconfig-67bd0e6c9ec8f650524ef14721ace894f2b6f647.tar.lz
nvim-lspconfig-67bd0e6c9ec8f650524ef14721ace894f2b6f647.tar.xz
nvim-lspconfig-67bd0e6c9ec8f650524ef14721ace894f2b6f647.tar.zst
nvim-lspconfig-67bd0e6c9ec8f650524ef14721ace894f2b6f647.zip
feat: auto-generate annotations for LSP settings
Diffstat (limited to 'README.md')
-rw-r--r--README.md30
1 files changed, 30 insertions, 0 deletions
diff --git a/README.md b/README.md
index 38414b51..2eafd05a 100644
--- a/README.md
+++ b/README.md
@@ -170,6 +170,36 @@ Most of the time, the reason for failure is present in the logs.
* `:lsp disable [<config_name>]` (`:LspStop` for Nvim 0.11 or older) Stops the given server. Defaults to stopping all servers active on the current buffer. To force stop use `:LspStop!`
* `:lsp restart [<client_name>]` (`:LspRestart` for Nvim 0.11 or older) Restarts the given client, and attempts to reattach to all previously attached buffers. Defaults to restarting all active servers.
+## LSP Settings Type Annotations
+
+`nvim-lspconfig` generates Lua type definitions for each supported LSP server.
+By manually adding annotations (e.g., `---@type lspconfig.settings.server_name`),
+you enable auto-completion and diagnostics for your server settings.
+
+**Example:**
+
+```lua
+---@type vim.lsp.Config
+local config = {
+ ---@type lspconfig.settings.lua_ls
+ settings = {
+ Lua = {
+ runtime = {
+ version = 'LuaJIT',
+ },
+ workspace = {
+ preloadFileSize = 10000,
+ library = {
+ vim.env.VIMRUNTIME,
+ }
+ },
+ },
+ },
+}
+
+vim.lsp.config('lua_ls', config)
+```
+
## Contributions
If a language server is missing from [configs.md](doc/configs.md), contributing