[tools] gopls/internal/test/marker: change range selection to position

0 views
Skip to first unread message

Hongxiang Jiang (Gerrit)

unread,
Jan 21, 2026, 11:47:39 PM (14 hours ago) Jan 21
to goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Go LUCI, Alan Donovan, Madeline Kalil, golang-co...@googlegroups.com

Hongxiang Jiang submitted the change

Change information

Commit message:
gopls/internal/test: use explicit positions in position-based tests

The test harness implementation of TextDocumentPositionParams has been
extended to support an optional Range.

Many existing tests defined their input using a range selection (e.g.,
@loc(f, "foo")), relying on the implicit behavior where the harness
simply used the start position of that range. Now that ranges are
explicitly supported, using a range selection for a position-only test
is imprecise and ambiguous.

This change updates these tests to use explicit point selections
(e.g., @loc(f, re"()foo")) to strictly define the input as a position.
Change-Id: Ibbddfa0da7c60016b6cc1c44e11681a8206fdd0e
Reviewed-by: Alan Donovan <adon...@google.com>
Files:
  • M gopls/internal/test/integration/completion/completion18_test.go
  • M gopls/internal/test/integration/completion/completion_test.go
  • M gopls/internal/test/integration/completion/postfix_snippet_test.go
  • M gopls/internal/test/integration/misc/hover_test.go
  • M gopls/internal/test/integration/misc/multiple_adhoc_test.go
  • M gopls/internal/test/integration/template/template_test.go
  • M gopls/internal/test/marker/testdata/completion/address.txt
  • M gopls/internal/test/marker/testdata/completion/alias.txt
  • M gopls/internal/test/marker/testdata/completion/anon.txt
  • M gopls/internal/test/marker/testdata/completion/append.txt
  • M gopls/internal/test/marker/testdata/completion/assign.txt
  • M gopls/internal/test/marker/testdata/completion/bad.txt
  • M gopls/internal/test/marker/testdata/completion/basic_lit.txt
  • M gopls/internal/test/marker/testdata/completion/builtins.txt
  • M gopls/internal/test/marker/testdata/completion/casesensitive.txt
  • M gopls/internal/test/marker/testdata/completion/cast.txt
  • M gopls/internal/test/marker/testdata/completion/channel.txt
  • M gopls/internal/test/marker/testdata/completion/comment.txt
  • M gopls/internal/test/marker/testdata/completion/complit.txt
  • M gopls/internal/test/marker/testdata/completion/danglingstmt.txt
  • M gopls/internal/test/marker/testdata/completion/deep.txt
  • M gopls/internal/test/marker/testdata/completion/deep2.txt
  • M gopls/internal/test/marker/testdata/completion/errors.txt
  • M gopls/internal/test/marker/testdata/completion/field_list.txt
  • M gopls/internal/test/marker/testdata/completion/foobarbaz.txt
  • M gopls/internal/test/marker/testdata/completion/func_rank.txt
  • M gopls/internal/test/marker/testdata/completion/func_sig.txt
  • M gopls/internal/test/marker/testdata/completion/func_snippets.txt
  • M gopls/internal/test/marker/testdata/completion/func_value.txt
  • M gopls/internal/test/marker/testdata/completion/fuzzy.txt
  • M gopls/internal/test/marker/testdata/completion/imported-std.txt
  • M gopls/internal/test/marker/testdata/completion/index.txt
  • M gopls/internal/test/marker/testdata/completion/interfacerank.txt
  • M gopls/internal/test/marker/testdata/completion/issue51783.txt
  • M gopls/internal/test/marker/testdata/completion/issue56505.txt
  • M gopls/internal/test/marker/testdata/completion/keywords.txt
  • M gopls/internal/test/marker/testdata/completion/labels.txt
  • M gopls/internal/test/marker/testdata/completion/lit.txt
  • M gopls/internal/test/marker/testdata/completion/maps.txt
  • M gopls/internal/test/marker/testdata/completion/multi_return.txt
  • M gopls/internal/test/marker/testdata/completion/nested_complit.txt
  • M gopls/internal/test/marker/testdata/completion/postfix.txt
  • M gopls/internal/test/marker/testdata/completion/postfix_placeholder.txt
  • M gopls/internal/test/marker/testdata/completion/printf.txt
  • M gopls/internal/test/marker/testdata/completion/randv2.txt
  • M gopls/internal/test/marker/testdata/completion/range_func.txt
  • M gopls/internal/test/marker/testdata/completion/rank.txt
  • M gopls/internal/test/marker/testdata/completion/snippet.txt
  • M gopls/internal/test/marker/testdata/completion/snippet_placeholder.txt
  • M gopls/internal/test/marker/testdata/completion/statements.txt
  • M gopls/internal/test/marker/testdata/completion/testy.txt
  • M gopls/internal/test/marker/testdata/completion/type_assert.txt
  • M gopls/internal/test/marker/testdata/completion/type_mods.txt
  • M gopls/internal/test/marker/testdata/completion/type_params.txt
  • M gopls/internal/test/marker/testdata/completion/unimported-std.txt
  • M gopls/internal/test/marker/testdata/completion/unimported.txt
  • M gopls/internal/test/marker/testdata/completion/unresolved.txt
  • M gopls/internal/test/marker/testdata/completion/unsafe.txt
  • M gopls/internal/test/marker/testdata/completion/variadic.txt
  • M gopls/internal/test/marker/testdata/configuration/static.txt
  • M gopls/internal/test/marker/testdata/definition/cgo.txt
  • M gopls/internal/test/marker/testdata/fixedbugs/issue71044.txt
  • M gopls/internal/test/marker/testdata/references/crosspackage.txt
  • M gopls/internal/test/marker/testdata/rename/issue42301.txt
  • M gopls/internal/test/marker/testdata/rename/prepare.txt
  • M gopls/internal/test/marker/testdata/signature/signature.txt
Change size: XL
Delta: 66 files changed, 706 insertions(+), 702 deletions(-)
Branch: refs/heads/master
Submit Requirements:
  • requirement satisfiedCode-Review: +2 by Alan Donovan
  • requirement satisfiedTryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: tools
Gerrit-Branch: master
Gerrit-Change-Id: Ibbddfa0da7c60016b6cc1c44e11681a8206fdd0e
Gerrit-Change-Number: 731800
Gerrit-PatchSet: 9
Gerrit-Owner: Hongxiang Jiang <hxj...@golang.org>
Gerrit-Reviewer: Alan Donovan <adon...@google.com>
Gerrit-Reviewer: Hongxiang Jiang <hxj...@golang.org>
Gerrit-Reviewer: Madeline Kalil <mka...@google.com>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages