File tree Expand file tree Collapse file tree 1 file changed +4
-14
lines changed Expand file tree Collapse file tree 1 file changed +4
-14
lines changed Original file line number Diff line number Diff line change @@ -8,21 +8,11 @@ const openFiles = async (files: string[]) => {
88 }
99 for ( const filePath of files ) {
1010 try {
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
2616 const absoluteFilePath = join ( wr , filePath )
2717 const doc = await vscode . workspace . openTextDocument ( absoluteFilePath )
2818 await vscode . window . showTextDocument ( doc , vscode . ViewColumn . One )
You can’t perform that action at this time.
0 commit comments