Skip to content

Commit

Permalink
Bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kralicky committed Aug 3, 2024
1 parent 4fe82d7 commit 1847bda
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
github.com/google/uuid v1.6.0
github.com/kralicky/codegen v0.0.0-20240522012557-5193d3fdbeca
github.com/kralicky/gpkg v0.0.0-20240119195700-64f32830b14f
github.com/kralicky/protocompile v0.0.0-20240619225839-bdb3c73b0a9f
github.com/kralicky/protocompile v0.0.0-20240803192845-d63fb51209b3
github.com/kralicky/tools-lite v0.0.0-20240313161632-60bfa88304ff
github.com/mattn/go-tty v0.0.7
github.com/mitchellh/mapstructure v1.5.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ github.com/kralicky/gpkg v0.0.0-20240119195700-64f32830b14f h1:MsNe8A51V+7Fu5OMX
github.com/kralicky/gpkg v0.0.0-20240119195700-64f32830b14f/go.mod h1:vOkwMjs49XmP/7Xfo9ZL6eg2ei51lmtD/4U/Az5GTq8=
github.com/kralicky/protocompile v0.0.0-20240619225839-bdb3c73b0a9f h1:qC7Xkx8Kq5wgiN2fo+1zLXVWhZfMWC6DHVgv+mCh7gA=
github.com/kralicky/protocompile v0.0.0-20240619225839-bdb3c73b0a9f/go.mod h1:aE9D9loDNucSzYmT854laAVbgGQwGOckiSXYuwAJJSI=
github.com/kralicky/protocompile v0.0.0-20240803192845-d63fb51209b3 h1:wCDUvsVb3BjsIAO0f3bZsrLuLno0cdfDumnouC+/iRg=
github.com/kralicky/protocompile v0.0.0-20240803192845-d63fb51209b3/go.mod h1:aE9D9loDNucSzYmT854laAVbgGQwGOckiSXYuwAJJSI=
github.com/kralicky/tools-lite v0.0.0-20240313161632-60bfa88304ff h1:akxm/czMYHdr1xIGm6wmddABmc4M9KDcqksdwpIJx8A=
github.com/kralicky/tools-lite v0.0.0-20240313161632-60bfa88304ff/go.mod h1:V8GGYRLr40bvX/W3nZFxG+6S3iDFWn6o5J3NGDClr8U=
github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
Expand Down
3 changes: 3 additions & 0 deletions pkg/lsp/semantic.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ func semanticTokensRange(cache *Cache, doc protocol.TextDocumentIdentifier, rng
maybeLinkRes: maybeLinkRes,
}
a := enc.AST()
if a == nil {
return nil, fmt.Errorf("no AST for %s", doc.URI)
}
startOff, endOff, _ := mapper.RangeOffsets(rng)
startToken := a.TokenAtOffset(startOff)
endToken := a.TokenAtOffset(endOff)
Expand Down

0 comments on commit 1847bda

Please sign in to comment.