提交 8a8a5023 编写于 作者: M Matt Bierner

Rename fields

上级 826dd8a3
......@@ -1385,14 +1385,14 @@ declare module 'vscode' {
*/
export interface WebviewPortMapping {
/**
* Port to remap on localhost.
* Localhost port to remap inside the webview.
*/
readonly from: number;
readonly port: number;
/**
* Destination port. The `from` port is resolved to this port.
* Destination port. The `port` is resolved to this port.
*/
readonly to: number;
readonly resolvedPort: number;
}
export interface WebviewOptions {
......
......@@ -21,13 +21,13 @@ import { areWebviewInputOptionsEqual } from './webviewEditorService';
import { WebviewFindWidget } from './webviewFindWidget';
export interface WebviewPortMapping {
readonly from: number;
readonly to: number;
readonly port: number;
readonly resolvedPort: number;
}
export interface WebviewPortMapping {
readonly from: number;
readonly to: number;
readonly port: number;
readonly resolvedPort: number;
}
export interface WebviewOptions {
......@@ -159,11 +159,11 @@ class WebviewPortMappingProvider extends Disposable {
if (localhostMatch) {
const port = +localhostMatch[1];
for (const mapping of mappings()) {
if (mapping.from === port && mapping.from !== mapping.to) {
if (mapping.port === port && mapping.port !== mapping.resolvedPort) {
return {
redirectURL: details.url.replace(
new RegExp(`^${uri.scheme}://localhost:${mapping.from}/`),
`${uri.scheme}://localhost:${mapping.to}/`)
new RegExp(`^${uri.scheme}://localhost:${mapping.port}/`),
`${uri.scheme}://localhost:${mapping.resolvedPort}/`)
};
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册