@@ -17,7 +17,9 @@ const commandErrorMessageFilter: ErrorMessageFilter = {
1717 }
1818}
1919
20- const runCommands = async ( commands : string [ ] , language : string ) => {
20+
21+ // TODO: pass command and command name down for filtering. Eg. JAVASCRIPT, 'npm install'
22+ const runCommands = async ( commands : string [ ] , language : string = 'JAVASCRIPT' ) => {
2123 for ( const command of commands ) {
2224 const { stdout, stderr} = await node . exec ( command )
2325 if ( stderr ) {
@@ -43,13 +45,28 @@ const setupActions = async (workspaceRoot: vscode.WorkspaceFolder, {commands, co
4345 }
4446
4547 // run command
46-
48+ await runCommands ( commands )
4749
4850 // open files
4951 for ( const filePath of files ) {
5052 console . log ( `OPEN_FILE ${ filePath } ` )
5153 try {
52- const absoluteFilePath = join ( workspaceRoot . uri . path , filePath )
54+ // TODO: figure out why this does not work
55+ // try {
56+ // const absoluteFilePath = join(workspaceRoot.uri.path, filePath)
57+ // const doc = await vscode.workspace.openTextDocument(absoluteFilePath)
58+ // await vscode.window.showTextDocument(doc, vscode.ViewColumn.One)
59+ // // there are times when initialization leave the panel behind any files opened
60+ // // ensure the panel is redrawn on the right side first
61+ // // webview.createOrShow(vscode.ViewColumn.Two)
62+ // } catch (error) {
63+ // console.log(`Failed to open file ${filePath}`, error)
64+ // }
65+ const wr = vscode . workspace . rootPath
66+ if ( ! wr ) {
67+ throw new Error ( 'No workspace root path' )
68+ }
69+ const absoluteFilePath = join ( wr , filePath )
5370 const doc = await vscode . workspace . openTextDocument ( absoluteFilePath )
5471 await vscode . window . showTextDocument ( doc , vscode . ViewColumn . One )
5572 // there are times when initialization leave the panel behind any files opened
@@ -61,4 +78,6 @@ const setupActions = async (workspaceRoot: vscode.WorkspaceFolder, {commands, co
6178 }
6279}
6380
64- export default setupActions
81+ export default setupActions
82+
83+
0 commit comments