Skip to content

Commit

Permalink
gopls/internal/lsp: followups to dropping line directives
Browse files Browse the repository at this point in the history
(This change was my independent effort to remove support
for line directives, which Peter already did in CL 439115.
The changes were substantially similar but this one also
made some follow-on simplifications.)

Also, NewMappedRange(token.File, ColumnMapper, ...) no
longer needs its first argument since it is redundant with
ColumnMapper.TokFile.

Also, inline away cache.parseGoSpan, and update various comments.

Fixes golang/go#55403

Change-Id: I951043c0ece9ee0a9ce65ae174d25057b0e1255a
Reviewed-on: https://go-review.googlesource.com/c/tools/+/457656
Reviewed-by: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
Run-TryBot: Alan Donovan <adonovan@google.com>
Reviewed-by: Peter Weinberger <pjw@google.com>
  • Loading branch information
adonovan authored and rinchsan committed Feb 19, 2023
1 parent 2eb424a commit fe116ea
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions internal/imports/sortimports.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ func sortImports(localPrefix string, tokFile *token.File, f *ast.File) {
d.Specs = specs

// Deduping can leave a blank line before the rparen; clean that up.
// Ignore line directives.
if len(d.Specs) > 0 {
lastSpec := d.Specs[len(d.Specs)-1]
lastLine := tokFile.PositionFor(lastSpec.Pos(), false).Line
Expand Down

0 comments on commit fe116ea

Please sign in to comment.