This repository was archived by the owner on Oct 1, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ export class ArduinoContentProvider implements vscode.TextDocumentContentProvide
7777 var backgroundcolor = styles.getPropertyValue('--background-color') || '#1e1e1e';
7878 var color = styles.getPropertyValue('--color') || '#d4d4d4';
7979 var theme = document.body.className || 'vscode-dark';
80- var url = "${ this . _webserver . getEndpointUri ( type ) } ?" +
80+ var url = "${ ( await vscode . env . asExternalUri ( this . _webserver . getEndpointUri ( type ) ) ) . toString ( ) } ?" +
8181 "theme=" + encodeURIComponent(theme.trim()) +
8282 "&backgroundcolor=" + encodeURIComponent(backgroundcolor.trim()) +
8383 "&color=" + encodeURIComponent(color.trim());
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import * as bodyParser from "body-parser";
55import * as express from "express" ;
66import * as http from "http" ;
77import * as path from "path" ;
8+ import { Uri } from "vscode" ;
89
910export default class LocalWebServer {
1011 private app = express ( ) ;
@@ -19,8 +20,9 @@ export default class LocalWebServer {
1920 public getServerUrl ( ) : string {
2021 return `http://localhost:${ this . server . address ( ) . port } ` ;
2122 }
22- public getEndpointUri ( type : string ) : string {
23- return `http://localhost:${ this . server . address ( ) . port } /${ type } ` ;
23+
24+ public getEndpointUri ( type : string ) : Uri {
25+ return Uri . parse ( `http://localhost:${ this . server . address ( ) . port } /${ type } ` ) ;
2426 }
2527
2628 public addHandler ( url : string , handler : ( req , res ) => void ) : void {
You can’t perform that action at this time.
0 commit comments