@@ -42,7 +42,7 @@ export class AmazonQChatViewProvider implements WebviewViewProvider {
4242 context : WebviewViewResolveContext ,
4343 _token : CancellationToken
4444 ) {
45- const lspDir = Uri . parse ( LanguageServerResolver . defaultDir ( ) )
45+ const lspDir = Uri . file ( LanguageServerResolver . defaultDir ( ) )
4646 const dist = Uri . joinPath ( globals . context . extensionUri , 'dist' )
4747
4848 const resourcesRoots = [ lspDir , dist ]
@@ -54,7 +54,7 @@ export class AmazonQChatViewProvider implements WebviewViewProvider {
5454 const mynahUIPath = getAmazonQLspConfig ( ) . ui
5555 if ( process . env . WEBPACK_DEVELOPER_SERVER && mynahUIPath ) {
5656 const dir = path . dirname ( mynahUIPath )
57- resourcesRoots . push ( Uri . parse ( dir ) )
57+ resourcesRoots . push ( Uri . file ( dir ) )
5858 }
5959
6060 webviewView . webview . options = {
@@ -68,11 +68,9 @@ export class AmazonQChatViewProvider implements WebviewViewProvider {
6868
6969 this . connectorAdapterPath =
7070 serverHostname !== undefined
71- ? Uri . parse ( serverHostname )
72- . with ( { path : `/${ source } ` } )
73- . toString ( )
74- : webviewView . webview . asWebviewUri ( Uri . parse ( path . join ( dist . fsPath , source ) ) ) . toString ( )
75- this . uiPath = webviewView . webview . asWebviewUri ( Uri . parse ( this . mynahUIPath ) ) . toString ( )
71+ ? `${ serverHostname } /${ source } `
72+ : webviewView . webview . asWebviewUri ( Uri . joinPath ( dist , source ) ) . toString ( )
73+ this . uiPath = webviewView . webview . asWebviewUri ( Uri . file ( this . mynahUIPath ) ) . toString ( )
7674
7775 webviewView . webview . html = await this . getWebviewContent ( )
7876
@@ -105,11 +103,11 @@ export class AmazonQChatViewProvider implements WebviewViewProvider {
105103 const regionProfileString : string = JSON . stringify ( regionProfile )
106104
107105 const entrypoint = process . env . WEBPACK_DEVELOPER_SERVER
108- ? 'http: localhost'
109- : 'https: file+.vscode-resources .vscode-cdn.net'
106+ ? 'http:// localhost:8080 '
107+ : 'https:// file+.vscode-resource .vscode-cdn.net'
110108
111109 const contentPolicy = `default-src ${ entrypoint } data: blob: 'unsafe-inline';
112- script-src ${ entrypoint } filesystem: ws: wss: 'unsafe-inline';`
110+ script-src ${ entrypoint } filesystem: file: vscode-resource: https: ws: wss: 'unsafe-inline';`
113111
114112 return `
115113 <!DOCTYPE html>
0 commit comments