Skip to content

Commit 95907d4

Browse files
Migrate name
1 parent 8039549 commit 95907d4

File tree

2 files changed

+36
-6
lines changed

2 files changed

+36
-6
lines changed

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import {
1111
cascadingMatcher,
1212
createPatternMatchers,
1313
matcher,
14-
patternMatcher,
1514
} from "../util/nodeMatchers";
1615

1716
const COMMANDS = [
@@ -140,11 +139,6 @@ const nodeMatchers: Partial<
140139
matcher(patternFinder(...COMMANDS, "begin", "end")),
141140
matcher(patternFinder(...sectioningCommand), extendToNamedSiblingIfExists),
142141
),
143-
144-
name: cascadingMatcher(
145-
matcher(patternFinder(...sectioningText), unwrapGroupParens),
146-
patternMatcher("begin[name][text]", "end[name][text]"),
147-
),
148142
};
149143

150144
export default createPatternMatchers(nodeMatchers);

queries/latex.scm

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,39 @@
5050
(begin) @collectionItem.iteration.start.endOf
5151
(end) @collectionItem.iteration.end.startOf
5252
) @collectionItem.iteration.domain
53+
54+
;;!! \section{foo bar}
55+
;;! ^^^^^^^
56+
(
57+
(_
58+
text: (_
59+
(_) @name
60+
) @name.removal
61+
) @name.domain
62+
(#type?
63+
@name.domain
64+
subparagraph
65+
paragraph
66+
subsubsection
67+
subsection
68+
section
69+
chapter
70+
part
71+
)
72+
)
73+
74+
;;!! \begin{quote}
75+
;; ! ^^^^^
76+
(begin
77+
name: (_
78+
text: (_) @name
79+
)
80+
) @_.domain
81+
82+
;;!! \end{quote}
83+
;; ! ^^^^^
84+
(end
85+
name: (_
86+
text: (_) @name
87+
)
88+
) @_.domain

0 commit comments

Comments
 (0)