Skip to content

Commit db85f32

Browse files
committed
chore: add comments about TextEdits positions adjustements
1 parent 1851cda commit db85f32

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pkg/goanalysis/runners.go

+2
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ func buildIssues(diags []Diagnostic, linterNameBuilder func(diag *Diagnostic) st
106106
end = edit.Pos
107107
}
108108

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

0 commit comments

Comments
 (0)