diff --git a/build/secrets/.secrets.baseline b/build/secrets/.secrets.baseline index b4050b4ef4e..fd4c3c5db8c 100644 --- a/build/secrets/.secrets.baseline +++ b/build/secrets/.secrets.baseline @@ -94,10 +94,6 @@ "path": "detect_secrets.filters.common.is_baseline_file", "filename": "build/secrets/.secrets.baseline" }, - { - "path": "detect_secrets.filters.common.is_ignored_due_to_verification_policies", - "min_level": 2 - }, { "path": "detect_secrets.filters.heuristic.is_indirect_reference" }, @@ -905,7 +901,7 @@ "filename": "src/vs/server/node/webClientServer.ts", "hashed_secret": "66e26ed510af41f1d322d1ebda4389302f4a03c7", "is_verified": false, - "line_number": 445, + "line_number": 450, "is_secret": false }, { @@ -913,7 +909,7 @@ "filename": "src/vs/server/node/webClientServer.ts", "hashed_secret": "f769de45d1747b634dfe3d7eb842f6967c4c5e98", "is_verified": false, - "line_number": 445, + "line_number": 450, "is_secret": false }, { @@ -921,7 +917,7 @@ "filename": "src/vs/server/node/webClientServer.ts", "hashed_secret": "93f2efffc36c6e096cdb21d6aadb7087dc0d7478", "is_verified": false, - "line_number": 452, + "line_number": 457, "is_secret": false } ], @@ -1912,5 +1908,5 @@ } ] }, - "generated_at": "2024-09-11T23:58:52Z" + "generated_at": "2024-09-26T21:49:10Z" } diff --git a/src/vs/server/node/webClientServer.ts b/src/vs/server/node/webClientServer.ts index 62689280aab..2317aef0a8d 100644 --- a/src/vs/server/node/webClientServer.ts +++ b/src/vs/server/node/webClientServer.ts @@ -163,7 +163,12 @@ export class WebClientServer { } // --- PWB Start: Server proxy support --- if (kProxyRegex.test(pathname)) { - const path: string = pathname.replace('/proxy/', 'http://0.0.0.0:'); + let path: string = pathname.replace('/proxy/', 'http://0.0.0.0:'); + + // Append query string if it exists + if (parsedUrl.search) { + path = path.concat(parsedUrl.search); + } return this._proxyServer.web(req, res, { ignorePath: true, diff --git a/src/vs/workbench/contrib/positronHelp/browser/positronHelpService.ts b/src/vs/workbench/contrib/positronHelp/browser/positronHelpService.ts index 6cc1a7ae967..b261fed634f 100644 --- a/src/vs/workbench/contrib/positronHelp/browser/positronHelpService.ts +++ b/src/vs/workbench/contrib/positronHelp/browser/positronHelpService.ts @@ -5,6 +5,7 @@ import { localize } from 'vs/nls'; import { FileAccess } from 'vs/base/common/network'; +import { join } from 'vs/base/common/path'; import { Emitter, Event } from 'vs/base/common/event'; import { Disposable } from 'vs/base/common/lifecycle'; import { ILogService } from 'vs/platform/log/common/log'; @@ -649,6 +650,7 @@ class PositronHelpService extends Disposable implements IPositronHelpService { sourceUrl.protocol = proxyServerOriginUrl.protocol; sourceUrl.hostname = proxyServerOriginUrl.hostname; sourceUrl.port = proxyServerOriginUrl.port; + sourceUrl.pathname = join(proxyServerOriginUrl.pathname, targetUrl.pathname); // Basically this can't happen. if (!session) { diff --git a/src/vs/workbench/services/positronConsole/browser/classes/activityItemStream.ts b/src/vs/workbench/services/positronConsole/browser/classes/activityItemStream.ts index b007869b444..c23962ef3ec 100644 --- a/src/vs/workbench/services/positronConsole/browser/classes/activityItemStream.ts +++ b/src/vs/workbench/services/positronConsole/browser/classes/activityItemStream.ts @@ -19,7 +19,7 @@ export class ActivityItemStream { /** * Gets the ActivityItemStream array. */ - private activityItemStreams: ActivityItemStream[] = []; + private activityItemStreams: this[] = []; /** * Gets the ANSIOutput that is processing this ActivityItemStream. @@ -47,12 +47,17 @@ export class ActivityItemStream { /** * Constructor. + * + * Never to be called directly. + * Internally, use `newActivityItemStream()` instead. + * Externally, use `ActivityItemOutputStream` or `ActivityItemErrorStream` constructors instead. + * * @param id The identifier. * @param parentId The parent identifier. * @param when The date. * @param text The text. */ - constructor( + protected constructor( readonly id: string, readonly parentId: string, readonly when: Date, @@ -70,9 +75,7 @@ export class ActivityItemStream { * @param activityItemStream The ActivityItemStream to add. * @returns The remainder ActivityItemStream, or undefined. */ - public addActivityItemStream( - activityItemStream: ActivityItemStream - ): ActivityItemStream | undefined { + public addActivityItemStream(activityItemStream: this): this | undefined { // If this ActivityItemStream is terminated, copy its styles to the ActivityItemStream being // added and return it as the remainder ActivityItemStream to be processed. if (this.terminated) { @@ -95,7 +98,7 @@ export class ActivityItemStream { const remainderText = activityItemStream.text.substring(newlineIndex + 1); // Add an ActivityItemStream with the text containing the newline. - this.activityItemStreams.push(new ActivityItemStream( + this.activityItemStreams.push(this.newActivityItemStream( activityItemStream.id, activityItemStream.parentId, activityItemStream.when, @@ -116,7 +119,7 @@ export class ActivityItemStream { } // Create the remainder ActivityItemStream. - activityItemStream = new ActivityItemStream( + activityItemStream = this.newActivityItemStream( activityItemStream.id, activityItemStream.parentId, activityItemStream.when, @@ -153,15 +156,53 @@ export class ActivityItemStream { } } + /** + * Polymorphic constructor for internal creation of new `ActivityItemStream`s + * + * Uses polymorphic `this` to actually return extension class types, like + * `ActivityItemOutputStream` and `ActivityItemErrorStream`. + * + * Note that we have to manually cast `this.constructor()` to the right type, as otherwise + * it is just a generic `Function`. + * https://github.com/microsoft/TypeScript/issues/3841 + * https://stackoverflow.com/questions/64638771/how-can-i-create-a-new-instance-of-a-class-using-this-from-within-method + * + * @param id The identifier. + * @param parentId The parent identifier. + * @param when The date. + * @param text The text. + * @returns A newly constructed activity item stream of type `this`. + */ + private newActivityItemStream( + id: string, + parentId: string, + when: Date, + text: string + ): this { + const constructor = ( + this.constructor as + new (id: string, parentId: string, when: Date, text: string) => this + ); + return new constructor(id, parentId, when, text); + } + //#endregion Private Methods } /** * ActivityItemOutputStream class. */ -export class ActivityItemOutputStream extends ActivityItemStream { } +export class ActivityItemOutputStream extends ActivityItemStream { + constructor(id: string, parentId: string, when: Date, text: string) { + super(id, parentId, when, text); + } +} /** * ActivityItemErrorStream class. */ -export class ActivityItemErrorStream extends ActivityItemStream { } +export class ActivityItemErrorStream extends ActivityItemStream { + constructor(id: string, parentId: string, when: Date, text: string) { + super(id, parentId, when, text); + } +}