Skip to content

bug(lsp): autocomplete missing on branching statements #1086

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
phenpessoa opened this issue Mar 3, 2025 · 1 comment · Fixed by #1155
Closed

bug(lsp): autocomplete missing on branching statements #1086

phenpessoa opened this issue Mar 3, 2025 · 1 comment · Fixed by #1155
Labels
bug Something isn't working lsp

Comments

@phenpessoa
Copy link
Contributor

Describe the bug
I don't get any auto completion on .templ files for branching statements such as for loops and ifs. I do get autocomplete on expressions though.

To Reproduce
Try to get auto complete on neovim on branching statements.
I don't know if this is helpful, but here is my config: https://github.com/phenpessoa/nvim

Expected behavior
Auto complete shows up as expected.

Screenshots
Image

templ info output

(✓) os [ goos=linux goarch=amd64 ]
(✓) go [ location=/usr/local/go/bin/go version=go version go1.24.0 linux/amd64 ]
(✓) gopls [ location=/home/phenpessoa/.local/share/nvim/mason/bin/gopls version=golang.org/x/tools/gopls v0.18.1 ]
(✓) templ [ location=/home/phenpessoa/go/bin/templ version=v0.3.833 ]

Desktop (please complete the following information):

  • OS: linux
  • templ CLI version v0.3.833
  • Go version go1.24.0 linux/amd64
  • gopls version golang.org/x/tools/gopls v0.18.1
@a-h
Copy link
Owner

a-h commented May 15, 2025

I've started work on this in the branch https://github.com/a-h/templ/tree/issue_1086_improve_lsp_invalid_files

Here's a video of what the improvements look like:

lsp_improvements.mp4

@a-h a-h added bug Something isn't working lsp labels May 16, 2025
@a-h a-h changed the title No autocomplete on branching statements bug(lsp): autocomplete missing on branching statements May 16, 2025
@a-h a-h closed this as completed in #1155 May 31, 2025
@a-h a-h closed this as completed in 5450d27 May 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lsp
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants