Qulaly icon indicating copy to clipboard operation
Qulaly copied to clipboard

How about querying semantics as well?

Open arturohernandez10 opened this issue 3 years ago • 2 comments

I love these query tools for JavaScript and typescript. And this is awesome!! But since you are using Roslyn which is much better than esprima. Would you consider adding support to query the semantic model as well? This would be an even more amazing tool. I already have it running using dotnet script.

I could lend a hand. If you like.

arturohernandez10 avatar Sep 25 '20 16:09 arturohernandez10

Thanks for the feedback. I would like to be able to write a query using SemanticModel too. So, I'm slightly stuck on what kind of selector to provide.

mayuki avatar Oct 07 '20 16:10 mayuki

I had the same question. This may be useful.

Often we would like to know type information. So there could be a :type modifier which would take many syntax elements and provide the type instead of a node.

From a type we may want to find the declaration. This is more complex than usual CSS selectors since I am not aware of any selector that travels outside of the tree that has been partially matched.

If this traveling quality of selectors could be justified. Other lookups could be done as well. Like reads or writes. Interestingly you could have :reads-nth. It would be very interesting to say the least.

arturohernandez10 avatar Oct 08 '20 05:10 arturohernandez10