neoclide / coc-json

Json language extension for coc.nvim
234 stars 21 forks source link

tsconfig.json [json 521] [e] Comments are not permitted in JSON. #11

Closed utrumo closed 5 years ago

utrumo commented 5 years ago

I suggest adding the ability to configure exceptions in the rules for some files.

chemzqm commented 5 years ago

Send your feature request to json language service.

forest0 commented 5 years ago

Actually, vscode-json-languageservice support this extension.

But you need to add "allowComments": true to the schema file.

@dementor5

alextes commented 5 years ago

@forest0 can you describe what you mean by 'the schema file'?

chemzqm commented 5 years ago

You can configure your vim to make that file with jsonc filetype to allow comment.

alextes commented 5 years ago

@chemzqm yea that's what I ended up doing instead, thanks for pointing it out 🙏 .

For others reading along I installed 'neoclide/jsonc.vim' and pointed out to vim that tsconfig.json is really a jsonc file.

" tsconfig.json is actually jsonc, help TypeScript set the correct filetype
autocmd BufRead,BufNewFile tsconfig.json set filetype=jsonc