-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose access to JSON worker #727
Comments
I think you need to open an issue in the Microsoft/monaco-json repository instead. |
@rcjsuen that repo doesn't accept issues; it says to file them here. |
@TedDriggs Oh, you are right! Don't I feel stupid. Sorry... (><) |
@TedDriggs Please describe what you are trying to achieve. There's To get access to the diagnostic messages, use You can try this on the Monaco playground:
Check the dev tools console for the output. |
@aeschli I'm trying that, but it's always a character behind, and I'm not sure how to mitigate that without adding a timeout and hoping for the best. That's made more complicated because I don't have a good way of checking if the markers are in sync with the model value. If I could get a |
Oh, I see. Can you describe what you need the markers for? |
It's easiest to explain with a picture: The error that you currently see is a semantic error I've implemented on my own worker thread. I'd like to show schema and syntax errors alongside my semantic errors. Since the other non-Monaco form fields can also have errors, I'm keeping the source-of-truth diagnostics list in the redux store. (As an aside, I'm planning to figure out the character ranges for those and add my own model markers, but I've run into microsoft/node-jsonc-parser#7 which has stymied that ambition for now.) |
Any progress with this? Going through the same goal of trying to validate JSON via the worker vs getModelMarkers. |
This provided a workaround #30 (comment) |
monaco.languages.typescript
has methods for getting the JS and TS workers, but there is no analogous method for JSON. This seems to imply that getting access to the diagnostic messages requires mining the decorator information or running a second language server.The text was updated successfully, but these errors were encountered: