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

Simple syntax errors not caught by diagnostics #102

Closed
Gama11 opened this issue Mar 2, 2017 · 5 comments
Closed

Simple syntax errors not caught by diagnostics #102

Gama11 opened this issue Mar 2, 2017 · 5 comments

Comments

@Gama11
Copy link
Member

Gama11 commented Mar 2, 2017

Some compiler errors are not pointed out by diagnostics. This can be quite frustrating, because otherwise diagnostics are reliable enough that I've started to assume "the code will compile" when every red line is gone. Getting compiler errors at that point can be confusing. The red squiggles here only appear after running the build task:

This is because the @diagnostics display mode is somewhat error-tolerant (rightly so) and doesn't care about e.g. missing semicolons.

I think we could detect these types of errors fairly easily with hxparer's parse tree, once that is ready.

@nadako
Copy link
Member

nadako commented Mar 2, 2017

Yes, once we have hxparser with diagnostic reporting and incremental parsing, we could update such diagnostics on the fly. No need to run compiler even.

@Gama11
Copy link
Member Author

Gama11 commented Mar 2, 2017

We can't get rid of compiler-provided diagnostics entirely. There's no way we could provide import suggestions in vshaxe for instance, the parse tree doesn't help much for that.

@nadako
Copy link
Member

nadako commented Mar 2, 2017

Well, sure, I mean we would just combine diagnostics from two places: local hxparser and the compiler.

However ideally we would connect to the haxe server and incrementally-update there and get diagnostics for both syntax and typing, but that's a long term goal.

@Gama11
Copy link
Member Author

Gama11 commented Jul 26, 2018

Should be able to solve this with the discussed display/parse API, which tells Haxe to parse (in "strict" / non-display mode) a file and returns the error, if any.

We could then combine that with the other diagnostics (or choose not to show them until parser errors have been resolved, not sure yet).

@Gama11 Gama11 closed this as completed in fe62ec2 Mar 6, 2019
@Gama11
Copy link
Member Author

Gama11 commented Mar 6, 2019

Haxe now reports parser errors in diagnostics mode. While it's not perfect yet and misses a few things, it's already a huge improvement:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants