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

syntax check #113

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

syntax check #113

wants to merge 3 commits into from

Conversation

bung87
Copy link
Contributor

@bung87 bung87 commented Jan 31, 2022

  • Bump version
  • async server (async server #109)
  • Minor style-fixes
  • add syntax check before compile module

@PMunch
Copy link
Owner

PMunch commented Jan 31, 2022

Why is this done? The compiler should just error out early if there is a syntax error, right?

@bung87
Copy link
Contributor Author

bung87 commented Jan 31, 2022

syntax check use less resource and faster than compile module, and when syntax wrong there's no need compile module, compile module will only issue an error and crash the server. while user typing code it's very easy trigger this.

@PMunch
Copy link
Owner

PMunch commented Jan 31, 2022

But part of LSP is based around getting information about what to type. Take a suggestion for example, you write var x = "Hello world"; echo x. and then hit tab I want my editor to issue a suggestion request, and the request to return things like e.g. len. But with this change the file would fail the syntax check and no information would be returned. This all works currently but would not work with this change..

@bung87
Copy link
Contributor Author

bung87 commented Jan 31, 2022

I rarely use tab , in this case when typing x.l the editor still give suggestion.

@PMunch
Copy link
Owner

PMunch commented Jan 31, 2022

Of course x.l would still work, that's syntactically correct. But that's beside the point, this still disables features that works fine right now.

However I'm interested in the crash you mentioned. Do you have a small sample where I can see the server crashing without this feature?

@bung87
Copy link
Contributor Author

bung87 commented Jan 31, 2022

I tried but hav't found yet, but I got new problem, I found syntax check is not reliable, it reports wrong error for me , it reports invalid indentation while that line is valid.

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

Successfully merging this pull request may close these issues.

None yet

2 participants