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

language server sends invalid position sometimes in publishDiagnostics #752

Closed
rchl opened this issue Sep 12, 2019 · 0 comments · Fixed by #753
Closed

language server sends invalid position sometimes in publishDiagnostics #752

rchl opened this issue Sep 12, 2019 · 0 comments · Fixed by #753
Labels
bug Issue identified by VS Code Team member as probable bug

Comments

@rchl
Copy link
Contributor

rchl commented Sep 12, 2019

For an issue like Newline required at end of file but not found, eslint doesn't report endLine or endChar and current code is wrong in checking those properties for null but not for undefined. So server ends up sending null/None value for line and character properties in Position object which is invalid according to the spec [1] (only numbers are allowed).

[1] https://microsoft.github.io/language-server-protocol/specification#position

rchl added a commit to rchl/vscode-eslint that referenced this issue Sep 12, 2019
For some issues eslint triggers error with no `endLine` and/or
`endColumn` defined. In that case the code should use `line` and
`column` for the values, respectively. While the code has attempted to
do that, it only checked for `null` value for those while eslint
actually doesn't even have them set so they are undefined.

Fix by checking that value is either null or undefined.

This problem causes random exceptions on some LSP clients (for me it
triggered in Sublime LSP). Not sure if it affected Vetur.

Resolves microsoft#752
@dbaeumer dbaeumer added the bug Issue identified by VS Code Team member as probable bug label Sep 17, 2019
dbaeumer pushed a commit that referenced this issue Sep 17, 2019
For some issues eslint triggers error with no `endLine` and/or
`endColumn` defined. In that case the code should use `line` and
`column` for the values, respectively. While the code has attempted to
do that, it only checked for `null` value for those while eslint
actually doesn't even have them set so they are undefined.

Fix by checking that value is either null or undefined.

This problem causes random exceptions on some LSP clients (for me it
triggered in Sublime LSP). Not sure if it affected Vetur.

Resolves #752
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants