Skip to content

Commit 2244577

Browse files
Migrate argument
1 parent 685f0f8 commit 2244577

File tree

4 files changed

+71
-131
lines changed

4 files changed

+71
-131
lines changed

packages/cursorless-engine/src/languages/LegacyLanguageId.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
* The language IDs that we have full tree-sitter support for using our legacy
33
* modifiers.
44
*/
5-
export const legacyLanguageIds = ["latex", "rust"] as const;
5+
export const legacyLanguageIds = ["rust"] as const;
66

77
export type LegacyLanguageId = (typeof legacyLanguageIds)[number];

packages/cursorless-engine/src/languages/getNodeMatcher.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import type {
88
} from "../typings/Types";
99
import { notSupported } from "../util/nodeMatchers";
1010
import { selectionWithEditorFromRange } from "../util/selectionUtils";
11-
import latex from "./latex";
1211
import type { LegacyLanguageId } from "./LegacyLanguageId";
1312
import rust from "./rust";
1413

@@ -40,7 +39,6 @@ export const languageMatchers: Record<
4039
LegacyLanguageId,
4140
Partial<Record<SimpleScopeTypeType, NodeMatcher>>
4241
> = {
43-
latex,
4442
rust,
4543
};
4644

packages/cursorless-engine/src/languages/latex.ts

Lines changed: 0 additions & 117 deletions
This file was deleted.

queries/latex.scm

Lines changed: 70 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@
5656
(
5757
(_
5858
text: (_
59-
(_) @name
60-
) @name.removal
59+
(_) @name @argumentOrParameter
60+
) @_.removal
6161
) @name.domain
6262
(#type?
6363
@name.domain
@@ -75,17 +75,17 @@
7575
;; ! ^^^^^
7676
(begin
7777
name: (_
78-
text: (_) @name
79-
)
80-
) @_.domain
78+
text: (_) @name @argumentOrParameter
79+
) @_.removal
80+
) @name.domain
8181

8282
;;!! \end{quote}
8383
;; ! ^^^^^
8484
(end
8585
name: (_
86-
text: (_) @name
87-
)
88-
) @_.domain
86+
text: (_) @name @argumentOrParameter
87+
) @_.removal
88+
) @name.domain
8989

9090
[
9191
(displayed_equation)
@@ -123,16 +123,17 @@
123123
(tikz_library_import)
124124
(begin)
125125
(end)
126-
] @functionCall
126+
] @functionCall @argumentOrParameter.iteration
127127

128128
(
129129
(_
130-
command: _ @functionCall.start
130+
command: _ @functionCall.start @argumentOrParameter.iteration.start
131131
.
132-
(_)? @functionCall.end
132+
(_)? @functionCall.end @argumentOrParameter.iteration.end
133133
) @_dummy
134134
(#type?
135135
@_dummy
136+
subparagraph
136137
paragraph
137138
subsubsection
138139
subsection
@@ -141,3 +142,61 @@
141142
part
142143
)
143144
)
145+
146+
(
147+
(_
148+
[
149+
(curly_group)
150+
(curly_group_text)
151+
(curly_group_text_list)
152+
(curly_group_path)
153+
(curly_group_path_list)
154+
(curly_group_command_name)
155+
(curly_group_key_value)
156+
(curly_group_glob_pattern)
157+
(curly_group_impl)
158+
(brack_group)
159+
(brack_group_text)
160+
(brack_group_argc)
161+
(brack_group_key_value)
162+
] @argumentOrParameter @_.removal
163+
) @_dummy
164+
(#character-range! @argumentOrParameter 1 -1)
165+
(#type?
166+
@_dummy
167+
displayed_equation
168+
generic_command
169+
inline_formula
170+
math_set
171+
block_comment
172+
package_include
173+
class_include
174+
latex_include
175+
biblatex_include
176+
bibtex_include
177+
graphics_include
178+
svg_include
179+
inkscape_include
180+
verbatim_include
181+
import_include
182+
caption
183+
citation
184+
label_definition
185+
label_reference
186+
label_reference_range
187+
label_number
188+
new_command_definition
189+
old_command_definition
190+
let_command_definition
191+
environment_definition
192+
glossary_entry_definition
193+
glossary_entry_reference
194+
acronym_definition
195+
acronym_reference
196+
theorem_definition
197+
color_definition
198+
color_set_definition
199+
color_reference
200+
tikz_library_import
201+
)
202+
)

0 commit comments

Comments
 (0)