Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit88a67fa

Browse files
committed
resolve workspace.root deprecation warning
1 parentafccb8b commit88a67fa

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

‎src/actions/utils/openFiles.ts

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,11 @@ const openFiles = async (files: string[]) => {
88
}
99
for(constfilePathoffiles){
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-
constwr=vscode.workspace.rootPath
23-
if(!wr){
24-
thrownewError('No workspace root path')
11+
constworkspaceFolders:vscode.WorkspaceFolder[]|undefined=vscode.workspace.workspaceFolders
12+
if(!workspaceFolders||!workspaceFolders.length){
13+
thrownewError('No workspace directory. Open a workspace directory and try again')
2514
}
15+
constwr:string=workspaceFolders[0].uri.path
2616
constabsoluteFilePath=join(wr,filePath)
2717
constdoc=awaitvscode.workspace.openTextDocument(absoluteFilePath)
2818
awaitvscode.window.showTextDocument(doc,vscode.ViewColumn.One)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp