Skip to content

Commit

Permalink
fix: hint content type for sources with query strings (#1769)
Browse files Browse the repository at this point in the history
  • Loading branch information
connor4312 committed Aug 1, 2023
1 parent 027ae05 commit 4d7c704
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
6 changes: 3 additions & 3 deletions src/adapter/sources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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';
}
}
Expand Down

0 comments on commit 4d7c704

Please sign in to comment.