Skip to content
This repository was archived by the owner on Oct 1, 2024. It is now read-only.

Commit a0a5f95

Browse files
authored
Merge pull request #1459 from davidcooper1/remote-fix
Support Remote Development Board Selection
2 parents 6352b4f + e5ece19 commit a0a5f95

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/arduino/arduinoContentProvider.ts

+1-1
Original file line numberDiff line numberDiff 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());

src/arduino/localWebServer.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import * as bodyParser from "body-parser";
55
import * as express from "express";
66
import * as http from "http";
77
import * as path from "path";
8+
import { Uri } from "vscode";
89

910
export 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 {

0 commit comments

Comments
 (0)