@@ -6,6 +6,7 @@ import * as path from "path";
66import * as fs from "fs" ;
77import { glob } from "glob" ;
88import mm from "micromatch" ;
9+ import { logger } from "./logger" ;
910
1011export function registerCommands ( ctx :vscode . ExtensionContext ) {
1112 const ctrl = new Controller ( ctx ) ;
@@ -33,15 +34,19 @@ export function registerCommands(ctx:vscode.ExtensionContext) {
3334
3435 function ctxOpen ( msg :LockMessage ) {
3536 vscode . workspace . workspaceFolders ?. forEach ( ( ws ) => {
36- const [ ns , fileName ] = msg . file . split ( ":" ) ;
37- const mask = path . join ( ws . uri . path , '**' , ns , "**" , fileName ) ;
37+ const [ , fileName ] = msg . file . split ( ":" ) ;
38+ // const mask = path.join(ws.uri.path,'**',ns,"**",fileName);
39+ const mask = path . join ( ws . uri . path , "**" , fileName ) ;
3840 glob ( mask )
3941 . then ( ( files ) => {
42+ console . log ( "FILES" , files ) ;
4043 if ( files ?. length ) {
4144 const [ file ] = files ;
4245 vscode . window . showTextDocument ( vscode . Uri . parse ( file ) ) ;
4346 } else {
44- vscode . window . showErrorMessage ( `Cannot open document,using ${ mask } ` ) ;
47+ const err = `Cannot file any files by ${ mask } ` ;
48+ logger . error ( err ) ;
49+ vscode . window . showErrorMessage ( err ) ;
4550 }
4651 } ) ;
4752 } ) ;
0 commit comments