Skip to content

Commit

Permalink
fix: js files with sourceURLs opening readonly versions (#1487)
Browse files Browse the repository at this point in the history
Fixes #1476
  • Loading branch information
connor4312 authored Dec 16, 2022
1 parent d3cb030 commit 3477c7f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ This changelog records changes to stable releases since 1.50.2. "TBA" changes he

## Nightly (only)

- fix: js files with sourceURLs opening readonly versions ([#1476](https://github.com/microsoft/vscode-js-debug/issues/1476))
- fix: breakpoints not setting in paths with special glob characters ([vscode#166400](https://github.com/microsoft/vscode/issues/166400))
- fix: better handling of multiple glob patterns and negations ([#1479](https://github.com/microsoft/vscode-js-debug/issues/1479))
- fix: skipFiles making catastrophic regexes ([#1469](https://github.com/microsoft/vscode-js-debug/issues/1469))
Expand Down
2 changes: 1 addition & 1 deletion src/adapter/sources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,7 @@ export class SourceContainer {
: undefined,
inlineSourceRange,
runtimeScriptOffset,
this.launchConfig.enableContentValidation ? contentHash : undefined,
contentHash,
);

this._addSource(source);
Expand Down
8 changes: 5 additions & 3 deletions src/adapter/threads.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ export class ExecutionContext {
export type Script = {
url: string;
scriptId: string;
hash: string;
source: Promise<Source>;
resolvedSource?: Source;
};
Expand Down Expand Up @@ -1451,7 +1450,11 @@ export class Thread implements IVariableStoreLocationProvider {
resolvedSourceMapUrl,
inlineSourceOffset,
runtimeScriptOffset,
event.hash,
// only include the script hash if content validation is enabled, and if
// the source does not have a redirected URL. In the latter case the
// original file won't have a `# sourceURL=...` comment, so the hash
// never matches: https://github.com/microsoft/vscode-js-debug/issues/1476
!event.hasSourceURL && this.launchConfig.enableContentValidation ? event.hash : undefined,
);

// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
Expand All @@ -1472,7 +1475,6 @@ export class Thread implements IVariableStoreLocationProvider {
url: event.url,
scriptId: event.scriptId,
source: createSource(),
hash: event.hash,
};
script.source.then(s => (script.resolvedSource = s));

Expand Down

0 comments on commit 3477c7f

Please sign in to comment.