Skip to content

Fix None position values in publishDiagnostics message#753

Merged
dbaeumer merged 1 commit intomicrosoft:masterfrom
rchl:fix/none-line-and-character
Sep 17, 2019
Merged

Fix None position values in publishDiagnostics message#753
dbaeumer merged 1 commit intomicrosoft:masterfrom
rchl:fix/none-line-and-character

Conversation

@rchl
Copy link
Contributor

@rchl rchl commented 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 #752

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
@dbaeumer
Copy link
Member

Thanks!

@dbaeumer dbaeumer merged commit 3ea0bb0 into microsoft:master Sep 17, 2019
@rchl rchl deleted the fix/none-line-and-character branch September 17, 2019 10:08
@dbaeumer dbaeumer added this to the 1.9.2 milestone Sep 23, 2019
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.

language server sends invalid position sometimes in publishDiagnostics

2 participants