File tree Expand file tree Collapse file tree 3 files changed +7
-41
lines changed Expand file tree Collapse file tree 3 files changed +7
-41
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,11 @@ You can also use the [command line tool](https://ast-grep.github.io/reference/cl
3838ast-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
4348This extension contributes the following settings:
Original file line number Diff line number Diff line change 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" ,
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 }
Original file line number Diff line number Diff line change @@ -150,33 +150,7 @@ export class AstGrepSearchResultProvider
150150}
151151
152152function 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
227198export 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}
You can’t perform that action at this time.
0 commit comments