-
-
Notifications
You must be signed in to change notification settings - Fork 84
Add tree-sitter related node support #1430
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
Conversation
4ff3022
to
06f3c99
Compare
18a473b
to
5e5562b
Compare
* @param ancestorIndex How many ancestors to go up. 0 means the immediate containing scope | ||
* @returns A target representing the containing scope, or undefined if no containing scope found | ||
*/ | ||
export function getContainingScopeTarget( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Factored out the core implementation of ContainingScopeStage
so that EveryScopeStage
could use it directly for expanding to containing iteration scope, because iteration scopes don't necessarily have a well-defined scope type, so it's easier if it can just pass in a scope handler rather than making a dummy scope type just for this purpose
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the way this scope handler defines its iteration scopes got a bit more complex because its constituent scopes could use a custom iteration scope handler
case "custom": | ||
return scopeType.scopeHandler; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For convenience, you can pass in a custom scope type. It's just as easy for the caller to grab the scope handler themselves, but the uniformity of just calling scopeHandlerFactory.create
can make their life easier
5e5562b
to
33c09ec
Compare
33c09ec
to
d106ab4
Compare
@_.domain
,@_.leading
,@_.trailing
,@_.removal
, and@_.interior
tree-sitter query captures@_.iteration
tree-sitter query capture to allow indicating iteration scope for tree-sitter scope handlersChecklist