Move by ArgumentsThis small VSCode extension leverages a syntactic structure common to many languages---arguments---and lets you move and select text in terms of this structure. Here, a set of arguments is defined as all text within a pair of brackets: Using this extension, you can move the cursor by arguments or select arguments. You can also select the entire set of arguments plus the preceding identifier: a very common form for a function call. LimitationsWhile this extension is quite usable, to keep things simple it leverages only the built-in APIs for interacting with brackets and syntax. This leads to some unfortunate drawbacks:
Ideally there would be a way to leverage the parsing VSCode already performs for syntax highlighting using a bulit-in API. However, this is not possible (see #580). The alternative, which would be to parse the entire source file redundantly within each extension, is not a sustainable approach for multiple, small extensions to take. |