Skip to content

JSON Extra

lang.json adds JSON support through jsonls, wired to the SchemaStore.nvim catalog for validation and completion against well-known schemas (package.json, tsconfig.json, and more), with Prettier formatting.

lang.typescript already contributes JSON Treesitter and Prettier formatting; the distinct value here is the JSON language server with SchemaStore, which no other extra provides.

Enable it

-- ~/.config/blak/lua/blak/user.lua
return {
extras = {
enabled = {
"lang.json",
},
},
}

Because this extra adds a plugin (SchemaStore.nvim), run:

:BlakExtras sync

What it adds

SurfaceContribution
Treesitterjson, jsonc
Masonprettier, prettierd
LSPjsonls with SchemaStore schemas
Formattingprettierd (fallback prettier) for json, jsonc
Pluginb0o/SchemaStore.nvim

jsonls installs automatically through Mason (package json-lsp).

How schemas load

SchemaStore.nvim is pulled in lazily from the server’s before_init hook, so the schema catalog only loads when jsonls actually starts. JSON validation is enabled by default.

Install and verify

:BlakExtras sync
:BlakToolsInstall
:BlakTreesitterInstall
:BlakDoctor

Open a package.json and confirm completion and validation against its schema, and check :LspInfo for json-lsp.