Skip to content

Allow for multiple ide-contextual-queries/print-ast queries #923

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

Open
hvitved opened this issue Aug 18, 2021 · 3 comments
Open

Allow for multiple ide-contextual-queries/print-ast queries #923

hvitved opened this issue Aug 18, 2021 · 3 comments
Labels
enhancement New feature or request VSCode

Comments

@hvitved
Copy link
Contributor

hvitved commented Aug 18, 2021

Is your feature request related to a problem? Please describe.
For Ruby, we have two views of the AST: The rich AST, and the desugared AST. The AST viewer (that is, the underlying ide-contextual-queries/print-ast query) displays the former, but sometimes it would be nice to see the desugared view.

Describe the solution you'd like
Add a drop-down to the AST viewer where one can select among multiple ide-contextual-queries/print-ast queries (when multiple queries are present).

Describe alternatives you've considered

Additional context

@hvitved hvitved added the enhancement New feature or request label Aug 18, 2021
@aeisenberg
Copy link
Contributor

Perhaps this isn't possible, but could you always return both asts? They could be created as two top level nodes and the user would be able to see both at the same time.

@hvitved
Copy link
Contributor Author

hvitved commented Aug 19, 2021

Perhaps this isn't possible, but could you always return both asts? They could be created as two top level nodes and the user would be able to see both at the same time.

In this case the output would not be a tree, as some AST nodes would appear in both trees, and I am not sure that the viewer handles that well (and the test output, where we use @kind graph certainly doesn't). As a user, I also think it would be weird to have the same element appear multiple times; which one should we jump to, when selecting some code?

@aeisenberg
Copy link
Contributor

Yes. Good points. Not sure my suggestion makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request VSCode
Projects
None yet
Development

No branches or pull requests

2 participants