This repository was archived by the owner on Oct 1, 2024. It is now read-only.
File tree 2 files changed +5
-3
lines changed
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
77
77
var backgroundcolor = styles.getPropertyValue('--background-color') || '#1e1e1e';
78
78
var color = styles.getPropertyValue('--color') || '#d4d4d4';
79
79
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 ( ) } ?" +
81
81
"theme=" + encodeURIComponent(theme.trim()) +
82
82
"&backgroundcolor=" + encodeURIComponent(backgroundcolor.trim()) +
83
83
"&color=" + encodeURIComponent(color.trim());
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import * as bodyParser from "body-parser";
5
5
import * as express from "express" ;
6
6
import * as http from "http" ;
7
7
import * as path from "path" ;
8
+ import { Uri } from "vscode" ;
8
9
9
10
export default class LocalWebServer {
10
11
private app = express ( ) ;
@@ -19,8 +20,9 @@ export default class LocalWebServer {
19
20
public getServerUrl ( ) : string {
20
21
return `http://localhost:${ this . server . address ( ) . port } ` ;
21
22
}
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 } ` ) ;
24
26
}
25
27
26
28
public addHandler ( url : string , handler : ( req , res ) => void ) : void {
You can’t perform that action at this time.
0 commit comments