Skip to content
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

how to enable syntax error checking automatically? #1527

Closed
datavisorfrankhe opened this issue Jul 31, 2019 · 4 comments
Closed

how to enable syntax error checking automatically? #1527

datavisorfrankhe opened this issue Jul 31, 2019 · 4 comments

Comments

@datavisorfrankhe
Copy link

Hello,
May I ask if monaco can automatically check the syntax error?
For example, I am using it to provide sql support, and if I typed in

wrong_select * form field

I want the wrong_select to be indicated as wrong. and if I mouse hovering, suggestion for fix will appear.

Can this feature be supported? and I believe it is there already, just can not find it.

Thanks for your help.

@rcjsuen
Copy link
Contributor

rcjsuen commented Jul 31, 2019

@datavisorfrankhe Maybe #1477 will help you.

@datavisorfrankhe
Copy link
Author

datavisorfrankhe commented Aug 1, 2019

I checked 147, and I don't think the syntax error is automatically detected. when calling setModelMarkers, the data passed in contains the error display position and contents.

Does this mean the syntax error can not be detected automatically by Monaco?
@rcjsuen

@rcjsuen
Copy link
Contributor

rcjsuen commented Aug 1, 2019

@datavisorfrankhe Monaco is simply an editor. It is not an AST parser or syntax error checker. If you want to check for errors, you need to:

  1. Listen to changes in the backing model (the textual content of the editor).
  2. Identify relevant errors in the text.
  3. Notify Monaco about such errors so it can render them to the user. How to add simple custom language support? #1477 showed how to do this with hard-coded values but it is possible to do this dynamically.

@datavisorfrankhe
Copy link
Author

datavisorfrankhe commented Aug 1, 2019 via email

@alexdima alexdima closed this as completed Dec 9, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants