@@ -11,40 +11,37 @@ import { useUCDExplorer } from "./views/ucd-explorer";
1111
1212const { activate, deactivate } = defineExtension ( async ( ) => {
1313 useCommand ( Meta . commands . browseUcdFiles , async ( ) => {
14- logger . info ( "Browsing UCD files..." ) ;
15- const store = useUCDStore ( ) ;
16- const data = await store . value ?. getFilePaths ( "16.0.0" ) ;
17- logger . info ( `Fetched files for version 16.0.0: ${ JSON . stringify ( data , null , 2 ) } ` ) ;
14+ executeCommand ( "ucd:explorer.focus" ) ;
1815 } ) ;
1916
2017 useCommand ( Meta . commands . refreshExplorer , async ( ) => {
2118 logger . info ( "Refreshing UCD Explorer..." ) ;
2219 logger . info ( "UCD Explorer refreshed." ) ;
20+
21+ const store = useUCDStore ( ) ;
22+ if ( ! store . value ) {
23+ logger . error ( "UCD Store is not initialized." ) ;
24+ return ;
25+ }
26+
27+ store . refresh ( ) ;
2328 } ) ;
2429
2530 useCommand ( Meta . commands . visualizeFile , ( ) => {
26- logger . info ( "Visualizing UCD file..." ) ;
27- // require that current editor is a UCD File
28- const editor = useActiveTextEditor ( ) ;
29- logger . info ( "Current active editor:" , JSON . stringify ( editor . value , null , 2 ) ) ;
30- useEditorDecorations ( editor , {
31- backgroundColor : "red" ,
32- } , ( ) => [
33- editor . value ?. visibleRanges [ 0 ] || new Range ( 0 , 0 , 20 , 20 ) ,
34- ] ) ;
31+ window . showErrorMessage ( "This command is not implemented yet." ) ;
3532 } ) ;
3633
37- useCommand ( Meta . commands . openExplorerEntry , async ( versionOrTreeView : string | TreeViewNode , filePath ?: string ) => {
34+ useCommand ( Meta . commands . openEntry , async ( versionOrTreeView : string | TreeViewNode , filePath ?: string ) => {
3835 if ( versionOrTreeView == null ) {
39- logger . error ( "No entry provided to openExplorerEntry command." ) ;
36+ logger . error ( "No entry provided to openEntry command." ) ;
4037 return ;
4138 }
4239
4340 if ( typeof versionOrTreeView === "object" && "treeItem" in versionOrTreeView ) {
4441 const treeView = versionOrTreeView ;
4542
4643 if ( ! treeView . treeItem || ! ( treeView . treeItem as UCDTreeItem ) . __ucd ) {
47- logger . error ( "Invalid entry provided to openExplorerEntry command." ) ;
44+ logger . error ( "Invalid entry provided to openEntry command." ) ;
4845 return ;
4946 }
5047
0 commit comments