|
@@ -26,11 +26,19 @@ let
|
|
} // attrs);
|
|
} // attrs);
|
|
extra-treesitter-textobjects = writeTextFile {
|
|
extra-treesitter-textobjects = writeTextFile {
|
|
name = "extra-treesitter-textobjects";
|
|
name = "extra-treesitter-textobjects";
|
|
- destination = "/after/queries/javascript/textobjects.scm";
|
|
|
|
|
|
+ destination = "/queries/ecma/textobjects.scm";
|
|
text = ''
|
|
text = ''
|
|
- ; support swapping elements inside arrays too
|
|
|
|
- (array "," . (_) @parameter.inner)
|
|
|
|
- (array . (_) @parameter.inner ",")
|
|
|
|
|
|
+ ;; extends
|
|
|
|
+
|
|
|
|
+ ; consider array elements as @parameter text objects too
|
|
|
|
+ (array
|
|
|
|
+ "," @_start .
|
|
|
|
+ (_) @parameter.inner
|
|
|
|
+ (#make-range! "parameter.outer" @_start @parameter.inner))
|
|
|
|
+ (array
|
|
|
|
+ . (_) @parameter.inner
|
|
|
|
+ . ","? @_end
|
|
|
|
+ (#make-range! "parameter.outer" @parameter.inner @_end))
|
|
'';
|
|
'';
|
|
};
|
|
};
|
|
tsc = writeShellScriptBin "tsc" ''
|
|
tsc = writeShellScriptBin "tsc" ''
|