-
-
Notifications
You must be signed in to change notification settings - Fork 288
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
feat: parse HTML element and attribute positions #548
Conversation
@a-h, I finished getting all the unit tests updated to reflect the position calculations so this should be ready for code review now. |
My immediate thoughts here are that maybe I could be being nit-picky but I think it makes more sense for there to be an HTML specific expression type. |
@joerdav, that sounds valid. I mainly reused it since it was already a pattern for storing positions. Should be simple enough to do a find and replace with a new name. Do you have anything in mind as an alternative to |
Considering that |
@joerdav, I went ahead and replaced |
@alehechka the type range makes sense, happy with that. I wonder if a better name for the property could be in order? The name |
Overview
This PR adds positions to the templ parser results for HTML elements and attributes relating to conversation in #498, specifically the recommendation made in #498 (comment).
This handles only calculating expression positions. I plan to open another PR when ready to use the calculated positions to enable LSP intellisense with a few hard-coded results. After that, I can work towards the solution I recommended in #498 (comment), to import an HTML LSP's data into templ's LSP.