Skip to content

Commit 685f0f8

Browse files
Clean up
1 parent 59bc1b4 commit 685f0f8

File tree

2 files changed

+15
-55
lines changed

2 files changed

+15
-55
lines changed

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

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -98,27 +98,6 @@ function unwrapGroupParens(
9898
};
9999
}
100100

101-
function extendToNamedSiblingIfExists(
102-
editor: TextEditor,
103-
node: Node,
104-
): SelectionWithContext {
105-
const startIndex = node.startIndex;
106-
let endIndex = node.endIndex;
107-
const sibling = node.nextNamedSibling;
108-
109-
if (sibling != null && sibling.isNamed) {
110-
endIndex = sibling.endIndex;
111-
}
112-
113-
return {
114-
selection: new Selection(
115-
editor.document.positionAt(startIndex),
116-
editor.document.positionAt(endIndex),
117-
),
118-
context: {},
119-
};
120-
}
121-
122101
const nodeMatchers: Partial<
123102
Record<SimpleScopeTypeType, NodeMatcherAlternative>
124103
> = {

queries/latex.scm

Lines changed: 15 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -125,38 +125,19 @@
125125
(end)
126126
] @functionCall
127127

128-
(subparagraph
129-
command: _ @functionCall.start
130-
.
131-
(_)? @functionCall.end
132-
)
133-
(paragraph
134-
command: _ @functionCall.start
135-
.
136-
(_)? @functionCall.end
137-
)
138-
(subsubsection
139-
command: _ @functionCall.start
140-
.
141-
(_)? @functionCall.end
142-
)
143-
(subsection
144-
command: _ @functionCall.start
145-
.
146-
(_)? @functionCall.end
147-
)
148-
(section
149-
command: _ @functionCall.start
150-
.
151-
(_)? @functionCall.end
152-
)
153-
(chapter
154-
command: _ @functionCall.start
155-
.
156-
(_)? @functionCall.end
157-
)
158-
(part
159-
command: _ @functionCall.start
160-
.
161-
(_)? @functionCall.end
128+
(
129+
(_
130+
command: _ @functionCall.start
131+
.
132+
(_)? @functionCall.end
133+
) @_dummy
134+
(#type?
135+
@_dummy
136+
paragraph
137+
subsubsection
138+
subsection
139+
section
140+
chapter
141+
part
142+
)
162143
)

0 commit comments

Comments
 (0)