Skip to content

Commit

Permalink
fix: remove incorrect document highlighting, fixes #283
Browse files Browse the repository at this point in the history
  • Loading branch information
a-h committed Nov 12, 2023
1 parent b0d1cdb commit fe52296
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 17 deletions.
2 changes: 1 addition & 1 deletion .version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2.464
0.2.465
16 changes: 0 additions & 16 deletions cmd/templ/lspcmd/proxy/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -624,22 +624,6 @@ func (p *Server) DocumentColor(ctx context.Context, params *lsp.DocumentColorPar
func (p *Server) DocumentHighlight(ctx context.Context, params *lsp.DocumentHighlightParams) (result []lsp.DocumentHighlight, err error) {
p.Log.Info("client -> server: DocumentHighlight")
defer p.Log.Info("client -> server: DocumentHighlight end")
isTemplFile, goURI := convertTemplToGoURI(params.TextDocument.URI)
if !isTemplFile {
return p.Target.DocumentHighlight(ctx, params)
}
templURI := params.TextDocument.URI
params.TextDocument.URI = goURI
result, err = p.Target.DocumentHighlight(ctx, params)
if err != nil {
return
}
if result == nil {
return
}
for i := 0; i < len(result); i++ {
result[i].Range = p.convertGoRangeToTemplRange(templURI, result[i].Range)
}
return
}

Expand Down

0 comments on commit fe52296

Please # to comment.