Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add comments about TextEdits positions adjustements
Browse files Browse the repository at this point in the history
ldez committed Dec 17, 2024
1 parent 1851cda commit db85f32
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/goanalysis/runners.go
Original file line number Diff line number Diff line change
@@ -106,6 +106,8 @@ func buildIssues(diags []Diagnostic, linterNameBuilder func(diag *Diagnostic) st
end = edit.Pos
}

// To be applied the positions need to be "adjusted" based on the file.
// This is the difference between the "displayed" positions and "effective" positions.
nsf.TextEdits = append(nsf.TextEdits, analysis.TextEdit{
Pos: token.Pos(diag.File.Offset(edit.Pos)),
End: token.Pos(diag.File.Offset(end)),

0 comments on commit db85f32

Please sign in to comment.