File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed
Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change 5252 "view/item/context" : [
5353 {
5454 "command" : " spectrogram.revealInFileExplorer" ,
55- "when" : " view == spectrogram && viewItem == fileItem" ,
55+ "when" : " view == spectrogram" ,
56+ "group" : " navigation"
57+ }
58+ ],
59+ "view/title" : [
60+ {
61+ "command" : " spectrogram.refresh" ,
62+ "when" : " view == spectrogram" ,
5663 "group" : " navigation"
5764 }
5865 ]
Original file line number Diff line number Diff line change @@ -14,11 +14,25 @@ class TreeView {
1414 vscode . commands . executeCommand ( 'revealFileInOS' , uri )
1515 } )
1616
17+ vscode . commands . registerCommand ( 'spectrogram.refresh' , ( ) => {
18+ specTreeDataProvider . refresh ( )
19+ } )
20+
21+ vscode . workspace . onDidChangeWorkspaceFolders ( ( ) => {
22+ specTreeDataProvider . refresh ( )
23+ } )
24+
1725 return vscode . window . createTreeView ( 'spectrogram' , {
1826 treeDataProvider : specTreeDataProvider ,
1927 showCollapseAll : true
2028 } )
2129 }
30+
31+ static refresh ( ) {
32+ const path = vscode . workspace . workspaceFolders ? vscode . workspace . workspaceFolders [ 0 ] . uri . fsPath : null
33+ const specTreeDataProvider = new SpecTreeDataProvider ( path )
34+ specTreeDataProvider . refresh ( )
35+ }
2236}
2337
2438class SpecTreeDataProvider {
You can’t perform that action at this time.
0 commit comments