-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/lsp/template: fix error that causes crashes
When LSP asks for a completion it sends a position, which is the position of the first character after the cursor. The old code mistakenly thought it was the position of the last character seen, and sometimes produced an impossible slice to parse. The example at line 29 of completion_test.go used to cause a panic. Fixes: golang/go#49600 Change-Id: I772fe38a1a12d3876ef866819e6a878b297bb92f Reviewed-on: https://go-review.googlesource.com/c/tools/+/366036 Run-TryBot: Peter Weinberger <[email protected]> gopls-CI: kokoro <[email protected]> TryBot-Result: Go Bot <[email protected]> Trust: Peter Weinberger <[email protected]> Reviewed-by: Hyang-Ah Hana Kim <[email protected]>
- Loading branch information
Showing
2 changed files
with
36 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters