Skip to content

Commit d2b6ba0

Browse files
chore: clean up unused commands/views
1 parent 5090899 commit d2b6ba0

File tree

3 files changed

+7
-41
lines changed

3 files changed

+7
-41
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ You can also use the [command line tool](https://ast-grep.github.io/reference/cl
3838
ast-grep new
3939
```
4040

41+
## Commands
42+
43+
- `ast-grep.restartLanguageServer`
44+
Restart ast-grep langauge server. Useful to reload rule or configuration changes.
45+
4146
## Extension Settings
4247

4348
This extension contributes the following settings:

package.json

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,6 @@
2828
],
2929
"contributes": {
3030
"commands": [
31-
{
32-
"command": "ast-grep.search",
33-
"title": "Search pattern in current document",
34-
"category": "ast-grep"
35-
},
3631
{
3732
"command": "ast-grep.restartLanguageServer",
3833
"title": "restart Language Server",
@@ -71,12 +66,6 @@
7166
"type": "webview",
7267
"id": "ast-grep.search.input",
7368
"name": "Pattern Input"
74-
},
75-
{
76-
"name": "Structural Search Result",
77-
"id": "ast-grep.search.result",
78-
"icon": "media/favicon.svg",
79-
"contextualTitle": "Package Explorer"
8069
}
8170
]
8271
}

src/extension.ts

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -150,33 +150,7 @@ export class AstGrepSearchResultProvider
150150
}
151151

152152
function activateLsp(context: ExtensionContext) {
153-
let provider = new AstGrepSearchResultProvider()
154-
155-
window.createTreeView('ast-grep.search.result', {
156-
treeDataProvider: provider,
157-
showCollapseAll: false
158-
})
159153
context.subscriptions.push(
160-
commands.registerCommand('ast-grep.search', async _uri => {
161-
// TODO: change impl
162-
// let curWorkspace = workspace.workspaceFolders?.[0]
163-
// if (!curWorkspace) {
164-
// return
165-
// }
166-
// let pattern
167-
// try {
168-
// pattern = await window.showInputBox({})
169-
// } catch {
170-
// return
171-
// }
172-
// if (!pattern) {
173-
// return
174-
// }
175-
// let res = await client.sendRequest<ScanResult[]>('ast-grep/search', {
176-
// pattern: pattern
177-
// })
178-
// provider.updateResult(res)
179-
}),
180154
commands.registerCommand('ast-grep.restartLanguageServer', async () => {
181155
console.log(
182156
'Restart the ast-grep language server by ast-grep.restart command'
@@ -219,13 +193,11 @@ function activateLsp(context: ExtensionContext) {
219193

220194
// Start the client. This will also launch the server
221195
client.start()
222-
223-
// TODO: fix shit code
224-
return provider
225196
}
226197

227198
export function activate(context: ExtensionContext) {
228-
const provider = activateLsp(context)
199+
let provider = new AstGrepSearchResultProvider()
200+
activateLsp(context)
229201
// TODO: fix shit code
230202
activateWebview(context, provider)
231203
}

0 commit comments

Comments
 (0)