aboutsummaryrefslogtreecommitdiff
path: root/vim/.config/nvim/lsp/json.lua
diff options
context:
space:
mode:
authorGrace Yoder <grace_yoder@outlook.com>2026-03-10 17:05:31 +0000
committerGrace Yoder <grace_yoder@outlook.com>2026-03-10 17:05:31 +0000
commitc5f6c7a4c742e0afd87b76786bda5f0e27659ced (patch)
tree72ecb7120c923c315e19eeff403e73af6ba958a7 /vim/.config/nvim/lsp/json.lua
parentdc6f417fa6653330371142dfa18d31cb24d3f334 (diff)
updated lsp stuff
Diffstat (limited to 'vim/.config/nvim/lsp/json.lua')
-rw-r--r--vim/.config/nvim/lsp/json.lua32
1 files changed, 32 insertions, 0 deletions
diff --git a/vim/.config/nvim/lsp/json.lua b/vim/.config/nvim/lsp/json.lua
new file mode 100644
index 0000000..3ef906c
--- /dev/null
+++ b/vim/.config/nvim/lsp/json.lua
@@ -0,0 +1,32 @@
+---@brief
+---
+--- https://github.com/hrsh7th/vscode-langservers-extracted
+---
+--- vscode-json-language-server, a language server for JSON and JSON schema
+---
+--- `vscode-json-language-server` can be installed via `npm`:
+--- ```sh
+--- npm i -g vscode-langservers-extracted
+--- ```
+---
+--- `vscode-json-language-server` only provides completions when snippet support is enabled. If you use Neovim older than v0.10 you need to enable completion, install a snippet plugin and add the following override to your language client capabilities during setup.
+---
+--- ```lua
+--- --Enable (broadcasting) snippet capability for completion
+--- local capabilities = vim.lsp.protocol.make_client_capabilities()
+--- capabilities.textDocument.completion.completionItem.snippetSupport = true
+---
+--- vim.lsp.config('jsonls', {
+--- capabilities = capabilities,
+--- })
+--- ```
+
+---@type vim.lsp.Config
+return {
+ cmd = { 'vscode-json-language-server', '--stdio' },
+ filetypes = { 'json', 'jsonc' },
+ init_options = {
+ provideFormatter = true,
+ },
+ root_markers = { '.git', '.jj' },
+}