mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-23 22:01:11 -05:00
Refactor out of utils
This commit is contained in:
15
src/core/webview/getUri.ts
Normal file
15
src/core/webview/getUri.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { Uri, Webview } from "vscode"
|
||||
/**
|
||||
* A helper function which will get the webview URI of a given file or resource.
|
||||
*
|
||||
* @remarks This URI can be used within a webview's HTML as a link to the
|
||||
* given file/resource.
|
||||
*
|
||||
* @param webview A reference to the extension webview
|
||||
* @param extensionUri The URI of the directory containing the extension
|
||||
* @param pathList An array of strings representing the path to a file/resource
|
||||
* @returns A URI pointing to the file/resource
|
||||
*/
|
||||
export function getUri(webview: Webview, extensionUri: Uri, pathList: string[]) {
|
||||
return webview.asWebviewUri(Uri.joinPath(extensionUri, ...pathList))
|
||||
}
|
||||
Reference in New Issue
Block a user