-
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
Access to Markers? #30
Comments
some ideas how to do it: microsoft/vscode#7232 (comment) |
specifically for typescript, a total hack but if you relate the editor to its model, theres a line in mode.js thats monaco.editor.setModelMarkers(monaco.editor.getModel(e), t._selector, r) and I think r are all the markers for the editor. |
Has anything changed here or is it still not possible to access markers or error messages? |
Please take a look at microsoft/vscode#31045. Does it provide required API? |
Thanks @electroma. It does appear that this would be sufficient. I had to drop Monaco for Ace a while back because of this (and lack of HTML+CSS linting) for my specific project. However, I'll definitely revisit it once this PR is merged, as I do like the editor better in general. |
Thanks for you prompt reply @ptyork! I'm trying to make similar decision now. In my case it's JSON editor with custom validation and autocompletion. Monaco looks very good, but some vscode APIs are not exposed now. |
the good thing about open source software -> I get markers like this var setModelMarkers = monaco.editor.setModelMarkers; |
Thank you for workaround @wysisoft! Sure it's possible to monkey patch monaco, but only in a short term. |
As of now there is no public API to access markers. This PR adds method `editor.getModelMarkers`. Should resolve microsoft/monaco-editor#30.
I'm killing myself trying to figure out how to get access to the info/warning/error markers created by the language linters. Is this possible?
I've found how I can access decorations (IModel.onDidChangeDecorations and a few get... methods in ITextModelWithDecorations). I can filter for decorations that are "IModelDecorationsChangedEventDecorationData.isForValidation), but that doesn't give me access to the marker.
I've found how I can SET markers (monaco.editor.setModelMarkers).
Am I missing something, or are the markers currently not exposed? Is there a preferred method of enumerating errors and warnings?
The text was updated successfully, but these errors were encountered: