From 4d7c704d3f07c65ba99b29c2a6ddff6e318e5391 Mon Sep 17 00:00:00 2001 From: Connor Peet Date: Tue, 1 Aug 2023 16:27:42 -0700 Subject: [PATCH] fix: hint content type for sources with query strings (#1769) Fixes https://github.com/microsoft/vscode/issues/181746 --- CHANGELOG.md | 2 ++ src/adapter/sources.ts | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 24d5c7d38..c391de82a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ This changelog records changes to stable releases since 1.50.2. "TBA" changes he ## Nightly (only) - fix: child processes from extension host not getting spawned during debug +- fix: immediately log stdout/err unless EXT is encountered ([vscode#181785](https://github.com/microsoft/vscode/issues/181785)) +- fix: hint content type for sources with query strings ([vscode#181746](https://github.com/microsoft/vscode/issues/181746)) ## v1.81 (July 2023) diff --git a/src/adapter/sources.ts b/src/adapter/sources.ts index c25d4ce48..747002dbc 100644 --- a/src/adapter/sources.ts +++ b/src/adapter/sources.ts @@ -18,7 +18,7 @@ import { forceForwardSlashes, isSubdirectoryOf, properResolve } from '../common/ import { delay, getDeferred } from '../common/promiseUtil'; import { ISourceMapMetadata, SourceMap } from '../common/sourceMaps/sourceMap'; import { CachingSourceMapFactory, ISourceMapFactory } from '../common/sourceMaps/sourceMapFactory'; -import { ISourcePathResolver, InlineScriptOffset } from '../common/sourcePathResolver'; +import { InlineScriptOffset, ISourcePathResolver } from '../common/sourcePathResolver'; import * as sourceUtils from '../common/sourceUtils'; import { prettyPrintAsSourceMap } from '../common/sourceUtils'; import * as utils from '../common/urlUtils'; @@ -225,8 +225,8 @@ export class Source { */ get getSuggestedMimeType(): string | undefined { // only return an explicit mimetype if the file has no extension (such as - // with node internals.) Otherwise, let the editor guess. - if (!/\.[^/]+$/.test(this.url)) { + // with node internals) or a query path. Otherwise, let the editor guess. + if (!/\.[^/]+$/.test(this.url) || this.url.includes('?')) { return 'text/javascript'; } }