tools/gopls/internal/template
Rob Findley 73d6794ebb gopls/internal/template: fix completion token boundary conditions
The template completion logic checked to see if the cursor position was
inside a logical {{ }} block, but the boundary conditions in the
relevant checks was wrong: in one case, a panic would occur if the
cursor was in between the pair of left braces. In another, it would
panic even if the cursor was at the start of a pair of left braces.

Fix the boundary conditions, with a test.

Fixes golang/go#57621

Change-Id: I826349906ee1ae67b2c5378e1b59d56e94c14fb2
Reviewed-on: https://go-review.googlesource.com/c/tools/+/622875
Auto-Submit: Robert Findley <rfindley@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-10-28 18:46:45 +00:00
..
completion.go gopls/internal/template: fix completion token boundary conditions 2024-10-28 18:46:45 +00:00
completion_test.go gopls/internal/protocol: move out of lsp/ 2024-01-24 00:48:12 +00:00
highlight.go gopls/internal/protocol: move out of lsp/ 2024-01-24 00:48:12 +00:00
implementations.go gopls/semantic: elide zero-length tokens 2024-02-07 02:37:50 +00:00
parse.go gopls/internal/protocol: move out of lsp/ 2024-01-24 00:48:12 +00:00
parse_test.go gopls/internal/lsp: remove lsp path segment 2023-11-30 17:51:48 +00:00
symbols.go gopls/internal/protocol: move out of lsp/ 2024-01-24 00:48:12 +00:00