-
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.
gopls/internal/golang: don't panic when findKeyword fails
As the existing comment attests, this can happen in the wild. Just skip it and move on. + a test Fixes golang/go#68205 Change-Id: I3227b0ce7ffacf3c8b4bbf2180a10e218bf87aa3 Reviewed-on: https://go-review.googlesource.com/c/tools/+/595117 Reviewed-by: Robert Findley <rfindley@google.com> Auto-Submit: Alan Donovan <adonovan@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
- Loading branch information
Showing
2 changed files
with
26 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
This test checks semanticTokens on ill-formed code. | ||
(Regression test for #68205.) | ||
|
||
-- settings.json -- | ||
{ | ||
"semanticTokens": true | ||
} | ||
|
||
-- flags -- | ||
-ignore_extra_diags | ||
|
||
-- a.go -- | ||
package p | ||
|
||
type _ <-<-chan int //@ token("<-", "operator", ""), token("chan", "keyword", "") |