-
-
Notifications
You must be signed in to change notification settings - Fork 325
Closed
Description
Before you begin
❯ templ version
v0.2.778
Describe the bug
Attempting to use Neovim templ LSP to go to the definition of a templ template inside of a .templ file will produce error:
Error executing vim.schedule lua callback: /usr/local/share/nvim/runtime/lua/vim/lsp/util.lua:17
98: index out of range
stack traceback:
[C]: in function '_str_byteindex_enc'
/usr/local/share/nvim/runtime/lua/vim/lsp/util.lua:1798: in function 'locations_to_items
'
/usr/local/share/nvim/runtime/lua/vim/lsp/handlers.lua:436: in function 'handler'
/usr/local/share/nvim/runtime/lua/vim/lsp/client.lua:687: in function ''
vim/_editor.lua: in function <vim/_editor.lua:0>
Press ENTER or type command to continue
To Reproduce
https://github.com/catgoose/templ_issue_repro
Follow steps in readme
Expected behavior
Issuing vim.lsp.buf.definition
on a templ template reference in a templ file should go to that templates definition
Taken from the reproduction repo above
Logs
Log file templ.log
included in repro repo
templ info
output
❯ templ info
(✓) os [ goos=linux goarch=amd64 ]
(✓) go [ location=/usr/local/go/bin/go version=go version go1.23.1 linux/amd64 ]
(✓) gopls [ location=/home/catgoose/go/bin/gopls version=golang.org/x/tools/gopls v0.16.2 ]
(✓) templ [ location=/home/catgoose/go/bin/templ version=v0.2.778 ]
Desktop (please complete the following information):
- OS: Ubuntu 24.04.1
- templ version: v0.2.778
- Go version: go version go1.23.1 linux/amd64
gopls
version: golang.org/x/tools/gopls v0.16.2
Additional context
This seems to have been fixed here #893 but the issue persists
Reported here catgoose/templ-goto-definition#1
Metadata
Metadata
Assignees
Labels
No labels