1
0
mirror of https://github.com/golang/go synced 2024-10-01 08:18:32 -06:00
go/internal/lsp/testdata
Pontus Leitzler 8d7dbee4c8 internal/lsp/source: support labeled statements when highlighting loops
When document.Highlight is called with the cursor on a loop statement or
branch statement, gopls doesn't look for labels. Placing the cursor at
the break statement below highlights the inner for loop:

Outer:
for {
    for {
        break Outer
    }
}

By making highlight label aware, and ensure that unlabeled "break" in
"switch"/"select" doesn't highlight the outer loop, this change fixes
loop highlighting.

Adding support for highlight of "switch" and "select" will be handled in
a separate CL.

Updates golang/go#39275

Change-Id: I7014aa7b0dfb1da871863ced611623be995f3944
Reviewed-on: https://go-review.googlesource.com/c/tools/+/236524
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2020-06-10 05:20:24 +00:00
..
indirect internal/lsp: added a fill struct code action 2020-06-04 04:23:27 +00:00
lsp internal/lsp/source: support labeled statements when highlighting loops 2020-06-10 05:20:24 +00:00
missingdep internal/lsp: added a fill struct code action 2020-06-04 04:23:27 +00:00
missingtwodep internal/lsp: added a fill struct code action 2020-06-04 04:23:27 +00:00
unused internal/lsp: added a fill struct code action 2020-06-04 04:23:27 +00:00
upgradedep internal/lsp: added a fill struct code action 2020-06-04 04:23:27 +00:00