fix(engine): resolve correct arity from inside ~H sigil #314
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes a deficiency of a previous implementation of jump-to-definition from HEEx templates (#278). While it worked for some cases, it always looked up a function of arity 2. This happened because
arity_at_pointfunction looked up arity ofsigil_Hfunction, which is two.This change introduces partial parsing of the contents of the ~H sigil and adds more precise arity resolving for these cases. This also enables some hover inside ~H (#291).
Additional notes
HeexNormalizertoHeex, because it's not only normalizing anymore. Once the proper support for plugins is added (Macro related Go to definition support and other integrations #270), this module would contain LiveView-specific addons in one place.Phoenix.LiveView.TagEngine, but that would create a runtime dependency, which I think is not good without proper extensions support.