Skip to content
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

Re-think the way we locate nodes as targets and how addons declare the ones they are interested in. #2036

Closed
andyw8 opened this issue May 10, 2024 · 1 comment
Assignees
Labels
bug Something isn't working chore Chore task

Comments

@andyw8
Copy link
Contributor

andyw8 commented May 10, 2024

Description

As first mentioned here.:

This is because of #1981. We need to re-think the way we locate nodes as targets and how addons can accurately declare the ones they are interested in.

To correctly identify targets, there are many cases where you need two layers of information: a surrounding parent node (like the before_save call node) and the symbol argument.

Currently, if you register for call nodes, you can identify the callback properly, but it assigns the go to definition behaviour to the method call identifier. However, if you register for handling symbol nodes (or arguments node), then you don't have access to the surrounding call node.
I think we need to create a specialized Prism::Dispatcher that not only allows you to register for events, but keeps track of the "current context" of where a node is inserted.

Additional comment from @vinistock:

We need to think of a way for listener to say something like this:

method_call(:symbol)
             ^ attached behaviour when this is clicked
^ but include the method call so that we can verify that it's the method we're interested > in
@andyw8 andyw8 added bug Something isn't working chore Chore task and removed bug Something isn't working labels May 10, 2024
@andyw8 andyw8 self-assigned this May 22, 2024
@andyw8
Copy link
Contributor Author

andyw8 commented Jun 11, 2024

Completed in #2099

@andyw8 andyw8 closed this as completed Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working chore Chore task
Projects
None yet
Development

No branches or pull requests

1 participant