-
-
Notifications
You must be signed in to change notification settings - Fork 261
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
add primitive document symbol support #848
base: main
Are you sure you want to change the base?
Conversation
1cdf23f
to
d198750
Compare
OK, I admit there is a big problem with my approach: I didn't convert the templ URI to the Go URI, yet somehow it worked. It seems gopls is good at parsing partial results and skip over invalid block, therefore all the non templ elements are all returned. I then parsed and added the templ elements, namely |
Is this ready to be reviewed @jackielii ? |
I tested this on https://github.com/joerdav/shopping-list/blob/main/app/listsweb/list.templ And I got the following symbols:
I expected to also see the go functions there |
I spotted the TODO, oops! Thanks for the PR by the way, it's looking to be almost there! |
I've been using it, works most of the time. But because it uses gopls to parse the templ files directly. It has quite a few broken cases. I'll redo it using the proper way by converting to go files and find mapping symbols. |
Legend. 😀 |
try to fix #347
Currently it deals with Go symbols + parser.HTMLTemplate
TODOs: