@@ -8,21 +8,11 @@ const openFiles = async (files: string[]) => {
88}
99for ( const filePath of files ) {
1010try {
11- // TODO figure out why this does not work
12- // try {
13- // const absoluteFilePath = join(workspaceRoot.uri.path, filePath)
14- // const doc = await vscode.workspace.openTextDocument(absoluteFilePath)
15- // await vscode.window.showTextDocument(doc, vscode.ViewColumn.One)
16- // // there are times when initialization leave the panel behind any files opened
17- // // ensure the panel is redrawn on the right side first
18- // // webview.createOrShow()
19- // } catch (error) {
20- // console.log(`Failed to open file ${filePath}`, error)
21- // }
22- const wr = vscode . workspace . rootPath
23- if ( ! wr ) {
24- throw new Error ( 'No workspace root path' )
11+ const workspaceFolders :vscode . WorkspaceFolder [ ] | undefined = vscode . workspace . workspaceFolders
12+ if ( ! workspaceFolders || ! workspaceFolders . length ) {
13+ throw new Error ( 'No workspace directory. Open a workspace directory and try again' )
2514}
15+ const wr :string = workspaceFolders [ 0 ] . uri . path
2616const absoluteFilePath = join ( wr , filePath )
2717const doc = await vscode . workspace . openTextDocument ( absoluteFilePath )
2818await vscode . window . showTextDocument ( doc , vscode . ViewColumn . One )