Skip to content

Create a smarter iteration scope for "item" #1047

Closed
@pokey

Description

@pokey

Today, the parse tree code can takeover "item" if it wants, but can't just indicate to ItemStage the iteration scope and let it do the rest. We'd like to enable that behaviour, so we can have uniformity of implementation of "item" while still supporting cases where there is no surrounding pair, eg the items foo and bar in var foo, bar = ....

Approach

It will be a cascading scope type (#1045) combining the following:

One of the constituent scope types will be just be surrounding pair, but where we ask pair for inside before returning it in getTarget(); domain is just the surrounding pair

The other constituent scope type is a tree-sitter syntactic scope handler with a tree-sitter pattern that languages can define however they want. For example, Typescript could define it to be foo, bar in var foo, bar = ...

See also #1046, as this approach is very similar

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions