No support for comments in config file
The used JSON parser doesn't support comments within the configuration JSON file.
Steps to reproduce:
- Take a working example configuration file and use it
- Add a comment with "//" either at the end of a line or at the beginning of a line
Expected:
- The plugin still uses the configuration file
Actual:
- Parsing error, configuration file is not accepted
My use case is that I'd like to add comments what an option actually means. Some of them are very cryptic or at least not intuitive to understand. Being able to use comments within a JSON file should be possible.
This works for me with version 0.9.10. Could you post a configuration that leads to the parsing error and ideally a stack trace of the parsing error?
I have the same problem with comments in configuration. The configuration file I want to use is https://gist.github.com/haschek/2595796/raw/500806cafd239ace8dc94c998a8d4f7270947b12/.jshintrc
It works when I remove all comments from the file.
Stacktrace from Error Log is:
com.eclipsesource.json.ParseException: Expected name at 2:4
at com.eclipsesource.json.JsonParser.error(JsonParser.java:371)
at com.eclipsesource.json.JsonParser.expected(JsonParser.java:364)
at com.eclipsesource.json.JsonParser.readName(JsonParser.java:145)
at com.eclipsesource.json.JsonParser.readObject(JsonParser.java:128)
at com.eclipsesource.json.JsonParser.readValue(JsonParser.java:83)
at com.eclipsesource.json.JsonParser.parse(JsonParser.java:62)
at com.eclipsesource.json.JsonValue.readFrom(JsonValue.java:105)
at com.eclipsesource.json.JsonObject.readFrom(JsonObject.java:133)
at com.eclipsesource.jshint.ui.internal.builder.ConfigLoader.getWorkspaceConfig(ConfigLoader.java:43)
at com.eclipsesource.jshint.ui.internal.builder.ConfigLoader.getConfiguration(ConfigLoader.java:38)
at com.eclipsesource.jshint.ui.internal.builder.JSHintBuilderVisitor.createJSHint(JSHintBuilderVisitor.java:93)
at com.eclipsesource.jshint.ui.internal.builder.JSHintBuilderVisitor.
Similar error. Config:
{
/*
"curly": true,
"eqeqeq": true,
"immed": true,
"freeze": true,
"latedef": true,
"noempty": true,
"nonew": true,
"undef": true,
"unused": true,
//ENVIRONMENT
"globals": {
"Ext":true
},
*/
"browser": true,
"devel": true
}
It turns out I'm using "JSHint Eclipse Integration 0.9.9.20131029-1050", but when I update, "No updates [are] found".
Thanks, I can reproduce it now. The problem exists only with the workbench preferences, not with project-specific settings.