cursorless
cursorless copied to clipboard
Support type / interface fields in typescript
The problem
For example in the following code:
interface Foo {
bar: Bar;
baz: Baz;
}
If your cursor was before bar, then "take field" would select bar: Bar
Approach
Look for the property_signature node type
A couple options:
- Introduce a new term "prop". We may also want it to select property accesses (eg
foo.bar), and class property definitions - Modify "state" to target this scope type. I guess technically these aren't considered statements, but that seems a bit subtle to me
- Modify "item" to target this scope type
First raised in #24 by @brxck
I think this is fixed
Really? I don't see a field scope type. What am I missing?
Why use a new scope and not just item?
Oh does that work?
Also, I'm not sure "item" is what I'd use for that. I could see reusing an existing scope type, but I think I'd lean towards "statement", because although technically not a statement, it sure looks and feels a lot like one
For me, "item" is something in a comma-separated list