Hi all, I have been transitioning from CoC and mostly happy with what I have using native lsp and treesitter.
One thing that is currently an issue for me is comments in a tsconfig.json file.
I get errors all over the place Comments are not permitted in JSON
I know comments are not part of the language spec, but hey tell that to Microsoft. Generating a tsconfig.json creates a json file with comments. I know I could just remove the comments, but IIRC CoC had a option to disable them as I didn’t have the errors all over the place. I’m using vscode-json-language-server which is I believe what CoC used, so is there an option I can pass to the setup function?
require "lspconfig".jsonls.setup {
cmd = {"vscode-json-language-server", "--stdio"},
filetypes = {"json", "jsonc"},
init_options = {
provideFormatter = false
},
root_dir = function()
return vim.loop.cwd()
end
}
I also tried renaming the file to .jsonc but I don’t get highlighting in .jsonc files even though I have the jsonc treesitter module installed.
So what are other folk doing?
Is there a way to configure the LS to allow comments?
How do you get highlighting in JSONC?