diff --git a/src/vs/platform/tunnel/common/tunnel.ts b/src/vs/platform/tunnel/common/tunnel.ts index 1c0d70f63ff..9fd03586d78 100644 --- a/src/vs/platform/tunnel/common/tunnel.ts +++ b/src/vs/platform/tunnel/common/tunnel.ts @@ -126,6 +126,7 @@ export interface ITunnelService { canTunnel(uri: URI): boolean; openTunnel(addressProvider: IAddressProvider | undefined, remoteHost: string | undefined, remotePort: number, localPort?: number, elevateIfNeeded?: boolean, privacy?: string, protocol?: string): Promise | undefined; + setEnvironmentTunnel(remoteHost: string, remotePort: number, localAddress: string, privacy: string, protocol: string): void; closeTunnel(remoteHost: string, remotePort: number): Promise; setTunnelProvider(provider: ITunnelProvider | undefined): IDisposable; setTunnelFeatures(features: TunnelProviderFeatures): void; @@ -270,6 +271,17 @@ export abstract class AbstractTunnelService implements ITunnelService { this._tunnels.clear(); } + setEnvironmentTunnel(remoteHost: string, remotePort: number, localAddress: string, privacy: string, protocol: string): void { + this.addTunnelToMap(remoteHost, remotePort, Promise.resolve({ + tunnelRemoteHost: remoteHost, + tunnelRemotePort: remotePort, + localAddress, + privacy, + protocol, + dispose: () => Promise.resolve() + })); + } + openTunnel(addressProvider: IAddressProvider | undefined, remoteHost: string | undefined, remotePort: number, localPort?: number, elevateIfNeeded: boolean = false, privacy?: string, protocol?: string): Promise | undefined { this.logService.trace(`ForwardedPorts: (TunnelService) openTunnel request for ${remoteHost}:${remotePort} on local port ${localPort}.`); if (!addressProvider) { diff --git a/src/vs/workbench/contrib/comments/browser/commentsEditorContribution.ts b/src/vs/workbench/contrib/comments/browser/commentsEditorContribution.ts index 81de2638436..af59bb1d79c 100644 --- a/src/vs/workbench/contrib/comments/browser/commentsEditorContribution.ts +++ b/src/vs/workbench/contrib/comments/browser/commentsEditorContribution.ts @@ -50,7 +50,7 @@ import { CommentThreadRangeDecorator } from 'vs/workbench/contrib/comments/brows import { commentThreadRangeActiveBackground, commentThreadRangeActiveBorder, commentThreadRangeBackground, commentThreadRangeBorder } from 'vs/workbench/contrib/comments/browser/commentColors'; import { ICursorSelectionChangedEvent } from 'vs/editor/common/cursorEvents'; import { CommentsPanel } from 'vs/workbench/contrib/comments/browser/commentsView'; -import { withUndefinedAsNull } from 'vs/base/common/types'; +import { withNullAsUndefined, withUndefinedAsNull } from 'vs/base/common/types'; export const ID = 'editor.contrib.review'; @@ -180,11 +180,11 @@ class CommentingRangeDecorator { } } - public update(editor: ICodeEditor | undefined, commentInfos: ICommentInfo[]) { + public update(editor: ICodeEditor | undefined, commentInfos: ICommentInfo[], cursorLine?: number, range?: Range) { if (editor) { this._editor = editor; this._infos = commentInfos; - this._doUpdate(editor, commentInfos); + this._doUpdate(editor, commentInfos, cursorLine, range); } } @@ -493,7 +493,7 @@ export class CommentController implements IEditorContribution { }).then(commentInfos => { if (this.commentService.isCommentingEnabled) { const meaningfulCommentInfos = coalesce(commentInfos); - this._commentingRangeDecorator.update(this.editor, meaningfulCommentInfos); + this._commentingRangeDecorator.update(this.editor, meaningfulCommentInfos, this.editor?.getPosition()?.lineNumber, withNullAsUndefined(this.editor?.getSelection())); } }, (err) => { onUnexpectedError(err); diff --git a/src/vs/workbench/services/remote/common/remoteExplorerService.ts b/src/vs/workbench/services/remote/common/remoteExplorerService.ts index cbc2eef9ea9..234f9eb50c0 100644 --- a/src/vs/workbench/services/remote/common/remoteExplorerService.ts +++ b/src/vs/workbench/services/remote/common/remoteExplorerService.ts @@ -705,6 +705,7 @@ export class TunnelModel extends Disposable { description: nls.localize('tunnel.staticallyForwarded', "Statically Forwarded") } }); + this.tunnelService.setEnvironmentTunnel(tunnel.remoteAddress.host, tunnel.remoteAddress.port, localAddress, TunnelPrivacyId.ConstantPrivate, TunnelProtocol.Http); } } this._environmentTunnelsSet = true;