Skip to content

Commit

Permalink
Merge branch '#285' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
zero-plusplus committed Jan 30, 2023
2 parents 2258663 + 6a93975 commit 0163c7b
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ Also want to check the development status, check the [commit history](https://gi
* [#255](https://github.com/zero-plusplus/vscode-autohotkey-debug/issues/255) Objects with child elements in index notation such as `["a & -"]` may get stuck when retrieving child elements
* [#256](https://github.com/zero-plusplus/vscode-autohotkey-debug/issues/256) v2 only bug. If double/single quotes are used in #Include directive, they do not appear in Loaded Scripts
* [#262](https://github.com/zero-plusplus/vscode-autohotkey-debug/issues/262) If runtime is v2, it may be aborted with an error when attaching
* [#285](https://github.com/zero-plusplus/vscode-autohotkey-debug/issues/285) The `extends` attribute in launch.json does not work in the multi-root workspace and throws an error

## [1.11.0] - 2022-02-11
### Added
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ This extension is a debugger adapter for [VSCode](https://code.visualstudio.com/
* Fixed: [#255](https://github.com/zero-plusplus/vscode-autohotkey-debug/issues/255) Objects with child elements in index notation such as `["a & -"]` may get stuck when retrieving child elements
* Fixed: [#256](https://github.com/zero-plusplus/vscode-autohotkey-debug/issues/256) v2 only bug. If double/single quotes are used in #Include directive, they do not appear in Loaded Scripts
* Fixed: [#262](https://github.com/zero-plusplus/vscode-autohotkey-debug/issues/262) If runtime is v2, it may be aborted with an error when attaching
* Fixed: [#285](https://github.com/zero-plusplus/vscode-autohotkey-debug/issues/285) The `extends` attribute in launch.json does not work in the multi-root workspace and throws an error

* `1.11.0` - 2022-02-11
* Added: [#201](https://github.com/zero-plusplus/vscode-autohotkey-debug/issues/201) Add `useLoadedScripts` to launch.json
Expand Down
15 changes: 7 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1491,6 +1491,7 @@
"fast-glob": "^3.2.7",
"fast-xml-parser": "^3.16.0",
"he": "^1.2.0",
"jsonc-parser": "^3.2.0",
"lazy-promise": "^4.0.0",
"lodash": "^4.17.20",
"matcher": "^4.0.0",
Expand Down
8 changes: 6 additions & 2 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
/* eslint-disable @typescript-eslint/no-unsafe-argument */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable require-atomic-updates */
import { existsSync } from 'fs';
import { existsSync, readFileSync } from 'fs';
import * as path from 'path';
import * as vscode from 'vscode';
import JSONC from 'jsonc-parser';
import { defaults, groupBy, isString, range } from 'lodash';
import tcpPortUsed from 'tcp-port-used';
import { getAhkVersion } from './util/getAhkVersion';
Expand Down Expand Up @@ -134,7 +135,10 @@ export class AhkConfigurationProvider implements vscode.DebugConfigurationProvid
public config?: LaunchRequestArguments;
public resolveDebugConfiguration(folder: vscode.WorkspaceFolder | undefined, config: vscode.DebugConfiguration, token?: vscode.CancellationToken): vscode.ProviderResult<vscode.DebugConfiguration> {
if (config.extends) {
const launch = vscode.workspace.getConfiguration().get<Record<string, any>>('launch');
const launch = folder
? JSONC.parse(readFileSync(path.resolve(folder.uri.fsPath, '.vscode', 'launch.json'), 'utf-8'))
: vscode.workspace.getConfiguration().get<Record<string, any>>('launch');

if (launch && 'configurations' in launch && Array.isArray(launch.configurations)) {
const sourceConfig = launch.configurations.find((conf) => equalsIgnoreCase(conf.name, config.extends));
if (!sourceConfig) {
Expand Down

0 comments on commit 0163c7b

Please sign in to comment.