Skip to content

Commit af63618

Browse files
committed
add back deleted function
1 parent 1536e49 commit af63618

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

packages/core/src/shared/utilities/uriUtils.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,15 @@ export class UriSchema<T> {
4646
}
4747
}
4848
}
49+
50+
/**
51+
* Converts a string path to a Uri, or returns the given Uri if it is already a Uri.
52+
*
53+
* A convenience function so you do not need to care about the type of path received.
54+
*/
55+
export function toUri(path: string | vscode.Uri): vscode.Uri {
56+
if (path instanceof vscode.Uri) {
57+
return path
58+
}
59+
return vscode.Uri.file(path)
60+
}

0 commit comments

Comments
 (0)