Open TheWitheredStriker opened 10 months ago
Will look into this, thanks for the report.
Looks like its an issue with parsing CSON grammar. If i convert your example to JSON then it works fine https://www.convertsimple.com/convert-cson-to-json/. Will see how I can fix this, but that is a workaround in the meantime.
It doesn't seem to exclusively be a CSON problem. It occurs with YAML too, like this one.
EDIT: I also tried converting the YAML to JSON and I still get the error.
Looking into it, the error seems to be here:
https://github.com/Nixinova/NovaLightshow/blob/1a0a549c1975f5db81ae54b4bb90584c14a5a5fd/index.mjs#L36
When there is an unexpected scopeName
property the code doesn't work.
For instance your latest example file:
scope: source.forth
It says scope
not scopeName
.
So I'll have to change the code to take that into account.
Hopefully that fixes this
Try it now, hopefully fixed.
I don't get the error anymore, but when trying the Forth grammar, the code is displayed but not highlighted:
Trying the CSON Factor grammar up top also still throws the same error. Sorry!
Hmm that's interesting. Welp, will have to do fix attempt two.
Ah - this is a bug in the CSON parser, https://github.com/fabiospampinato/cson2json/issues/1.
Seems like it can't handle mixed indents:
repository:
escaped_characters:
patterns: true
scope: "source.factor"
scopeName: "source.factor"
Will have to switch CSON parser.
This error keeps happening with most (though not all) of the grammars I'm testing. This includes grammars that don't even have a scope property, like this one.
I'm not sure why this happens, any ideas?