cmake4vim icon indicating copy to clipboard operation
cmake4vim copied to clipboard

Ignoring comments in .vimspector.json

Open mark2185 opened this issue 3 years ago • 3 comments

Is your feature request related to a problem? Please describe. vimspector ignores comments in JSON (// comment), but cmake4vim doesn't so it complains about parsing the JSON file when trying to run a target.

Describe the solution you'd like Ignore the content after //, but don't delete it when writing .vimspector.json again.

Describe alternatives you've considered Not writing comments.

mark2185 avatar Oct 03 '22 12:10 mark2185

Unfortunately json standard doesn't support comments.

As per Standard JSON rules, There is no official support for Comments in JSON content.

I read vimspector config to json dictionary and write it also as json, so in case of C style comments it returns error

ilyachur avatar Oct 26 '22 12:10 ilyachur

I know, but vimspector explicitly supports C styled comments

The JSON configuration file allows C-style comments:

// comment to end of line ... /* inline comment ... */

So we do have vimspector support, but we also have a missing feature.

mark2185 avatar Oct 26 '22 12:10 mark2185

Yes I know, honestly I don't know the simple way how to support comments. Looks like for that I need to change the system of reading/writing vimspector config file.

ilyachur avatar Oct 26 '22 13:10 ilyachur