Skip to content

Commit

Permalink
Fix integer conversion (#767)
Browse files Browse the repository at this point in the history
Thanks :)
  • Loading branch information
guruh46 authored Nov 3, 2024
1 parent a750634 commit 395523c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions internal/lsp/span/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"strconv"
"strings"
"unicode/utf8"
"math"
)

// Parse returns the location represented by the input.
Expand Down Expand Up @@ -86,8 +87,10 @@ func rstripSuffix(input string) suffix {
if last >= 0 && last < len(remains)-1 {
number, err := strconv.ParseInt(remains[last+1:], 10, 64)
if err == nil {
num = int(number)
remains = remains[:last+1]
if number >= math.MinInt && number <= math.MaxInt {
num = int(number)
remains = remains[:last+1]
}
}
}
// now see if we have a trailing separator
Expand Down

0 comments on commit 395523c

Please sign in to comment.