cursorless
cursorless copied to clipboard
Bug with arguments and Rust macros
Cursorless doesn't recognize arguments passed into Rust macros.
If you try to delete 1 using chuck arg 1:
fn main() {
println!("{}", 1);
}
It fails with the following error: Couldn't find containing argumentOrParameter.
I don't think this is trivial to fix. All we get (unsurprisingly) out of tree-sitter is a token tree:
> source_file
>> function_item
>>> body: block
>>>> expression_statement
>>>>> macro_invocation
>>>>>> token_tree
>>>>>>> integer_literal
>>>>>>> "1"
As a workaround, does the item scope do the trick?
@auscompgeek good call on "item". We are actually considering switching "arg" to use "item" under the hood, just restricting allowable parent nodes. We'd probably do that as follow-up work to #629