We're working on a web editor that allows people to write Jsonnet and compile them in the browser. The Monaco Editor (also used by VSCode) makes use of Web workers so even though the compiler is slow, it's not a big deal for us.
1. In case the compilation fails, we parse the result and highlight the errors in the editor.
2. We use JSON Schema in order to validate the output JSON and we're planning to provide better IDE support such as hover and autocomplete actions in the future.
We got 1 working in our POC and make the JSON Schema work with the output of the Jsonnet files but we need to find a way to parse the Jsonnet files in JS work with the AST for the following features:
1. In case JSON Schema fails to validate the file, we have the JSONPath for the errors and we want to highlight the errors in the source Jsonnet file. If we can create the AST from the Jsonnet file, we can try to find the location for the JSONPath using our best effort. It may not work if the file is created dynamically but it should work if the fields are hardcoded. In our case, it covers most of the cases. If it can't we can just walk the AST and stop when we can't identify the children nodes.
2. We also need to find a way to generate JSONPath from the cursor location of the source Jsonnet file for hover and autocomplete support. Again, it may not be possible in all the cases but hardcoded keys would be enough for our case.