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

False errors due to off-by-one-character in identifiers or types #1807

Closed
2-5 opened this issue Sep 3, 2022 · 10 comments
Closed

False errors due to off-by-one-character in identifiers or types #1807

2-5 opened this issue Sep 3, 2022 · 10 comments
Labels
bug Something isn't working

Comments

@2-5
Copy link
Contributor

2-5 commented Sep 3, 2022

Volar 0.40.5

I get frequent false errors due to Volar complaining about invalid identifiers due to off-by-one-character errors, like in the screenshot:

The fix is to restart VS Code, closing and reopening the source file with the reported false error doesn't work due to some form of cache.

2022-09-03_151745

Other example that happend: complaining about unknown type nboolean instead of boolean which is in source code.

@johnsoncodehk johnsoncodehk added the bug Something isn't working label Sep 3, 2022
@johnsoncodehk
Copy link
Member

Since v0.40.2 we have handle incremental update logic in language server for support incremental parser and resolve diagnosis display flicker (#1718), it should be the reason. Please let me know if you can reproduce this problem stably and how.

After v0.40.6 you can setting "volar.vueserver.textDocumentSync": "full" to disable incremental update.

@Sun-ZhenXing
Copy link

Same problem. In recent updates, this has become more common. I hope it will be solved soon.
Restarting VS Code has been difficult to fix and I keep getting a lot of errors in the <template> element that actually compile fine.
image

@johnsoncodehk
Copy link
Member

@Sun-ZhenXing can you reproduce this problem in https://github.com/johnsoncodehk/volar-starter?

@Sun-ZhenXing

This comment was marked as resolved.

@johnsoncodehk
Copy link
Member

@Sun-ZhenXing I think this is a different problem and it should be fixed in v0.40.8.

@johnsoncodehk
Copy link
Member

@2-5 Since I haven't seen other similar reports, I'm guess it may no longer occur, can you try revert volar.vueserver.textDocumentSync setting to and see if this problem reproduce?

@rchl
Copy link
Collaborator

rchl commented Oct 15, 2022

I did have it happen in 1.0.7 yesterday in a *.ts file.

@johnsoncodehk
Copy link
Member

johnsoncodehk commented Oct 15, 2022

@rchl It would be very helpful if you can provide the LSP logs that record at the moment the problem occurred.

@2-5
Copy link
Contributor Author

2-5 commented Oct 15, 2022

A few days later I did revert the textDocumentSync setting, to see if the issue was fixed by the new versions of Volar. It seems so, I haven't seen this particular issue since, but at the same time I didn't do any heavy refactorings either (lots of edits in one file) which appeared to have triggered it.

@rchl
Copy link
Collaborator

rchl commented Oct 16, 2022

@rchl It would be very helpful if you can provide the LSP logs that record at the moment the problem occurred.

I'm sure it would but I can't reproduce it on demand and once I notice it, I might not have logs reaching far enough for them to be useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants