Skip to content

Commit 165441f

Browse files
fix: remove unnecessary code
1 parent 6acb089 commit 165441f

File tree

3 files changed

+1
-48
lines changed

3 files changed

+1
-48
lines changed

package.json

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -81,22 +81,6 @@
8181
"dark": "media/expand-dark.svg"
8282
}
8383
},
84-
{
85-
"command": "ast-grep.enableYAML",
86-
"title": "Use YAML",
87-
"icon": {
88-
"light": "media/yaml-light.svg",
89-
"dark": "media/yaml-dark.svg"
90-
}
91-
},
92-
{
93-
"command": "ast-grep.enablePattern",
94-
"title": "Use Pattern",
95-
"icon": {
96-
"light": "media/pattern-light.svg",
97-
"dark": "media/pattern-dark.svg"
98-
}
99-
},
10084
{
10185
"command": "ast-grep.searchByCode",
10286
"title": "ast-grep: Search by Code"
@@ -123,16 +107,6 @@
123107
}
124108
],
125109
"view/title": [
126-
{
127-
"command": "ast-grep.enableYAML",
128-
"when": "view == ast-grep.search.input && !ast-grep.yamlMode",
129-
"group": "navigation"
130-
},
131-
{
132-
"command": "ast-grep.enablePattern",
133-
"when": "view == ast-grep.search.input && ast-grep.yamlMode",
134-
"group": "navigation"
135-
},
136110
{
137111
"command": "ast-grep.collapseAll",
138112
"when": "view == ast-grep.search.input && !ast-grep.searchDefaultCollapse",

src/extension/codelens.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export function activateCodeLens(context: vscode.ExtensionContext) {
1818
parentPort.postMessage('searchByYAML', {
1919
text,
2020
})
21+
vscode.commands.executeCommand('ast-grep.search.input.focus')
2122
},
2223
)
2324

src/extension/webview.ts

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ export function activateWebview(context: vscode.ExtensionContext) {
1919
commands.registerCommand('ast-grep.clearSearchResults', clearSearchResults),
2020
commands.registerCommand('ast-grep.expandAll', toggleAllSearch),
2121
commands.registerCommand('ast-grep.collapseAll', toggleAllSearch),
22-
commands.registerCommand('ast-grep.enableYAML', enableYAML),
23-
commands.registerCommand('ast-grep.enablePattern', enablePattern),
2422
)
2523
}
2624

@@ -124,26 +122,6 @@ function clearSearchResults() {
124122
parentPort.postMessage('clearSearchResults', {})
125123
}
126124

127-
function enableYAML() {
128-
parentPort.postMessage('enableYAML', true)
129-
parentPort.postMessage('clearSearchResults', {})
130-
vscode.commands.executeCommand(
131-
'setContext',
132-
'ast-grep.yamlMode',
133-
true,
134-
)
135-
}
136-
137-
function enablePattern() {
138-
parentPort.postMessage('enableYAML', false)
139-
parentPort.postMessage('clearSearchResults', {})
140-
vscode.commands.executeCommand(
141-
'setContext',
142-
'ast-grep.yamlMode',
143-
false,
144-
)
145-
}
146-
147125
let defaultCollapse = false
148126

149127
// reset default collapse when starting a new search

0 commit comments

Comments
 (0)