diff --git a/CHANGELOG.md b/CHANGELOG.md index 9cad8d60..311c67d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,7 +23,7 @@ Also want to check the development status, check the [commit history](https://gi * [#266](https://github.com/zero-plusplus/vscode-autohotkey-debug/issues/266) Add `setHiddenBreakpoints` attribute in launch.json * [#271](https://github.com/zero-plusplus/vscode-autohotkey-debug/issues/271) Add `vscode-autohotkey-debug.variables.pinnedFile` [command variable](https://code.visualstudio.com/docs/editor/variables-reference#_command-variables) * [#271](https://github.com/zero-plusplus/vscode-autohotkey-debug/issues/271) Add `vscode-autohotkey-debug.variables.firstFile` [command variable](https://code.visualstudio.com/docs/editor/variables-reference#_command-variables) -* [#271](https://github.com/zero-plusplus/vscode-autohotkey-debug/issues/271) Add `vscode-autohotkey-debug.variables.rightmostFile` [command variable](https://code.visualstudio.com/docs/editor/variables-reference#_command-variables) +* [#271](https://github.com/zero-plusplus/vscode-autohotkey-debug/issues/271) Add `vscode-autohotkey-debug.variables.lastFile` [command variable](https://code.visualstudio.com/docs/editor/variables-reference#_command-variables) * [#286](https://github.com/zero-plusplus/vscode-autohotkey-debug/issues/286) Support autocomplete in Debug Console and Conditional Breakpoint ### Changed diff --git a/README.md b/README.md index 45b7a149..727c6e71 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ This extension is a debugger adapter for [VSCode](https://code.visualstudio.com/ * Added: [#266](https://github.com/zero-plusplus/vscode-autohotkey-debug/issues/266) Add `setHiddenBreakpoints` attribute in launch.json * Added: [#271](https://github.com/zero-plusplus/vscode-autohotkey-debug/issues/271) Add `vscode-autohotkey-debug.variables.pinnedFile` [command variable](https://code.visualstudio.com/docs/editor/variables-reference#_command-variables) * Added: [#271](https://github.com/zero-plusplus/vscode-autohotkey-debug/issues/271) Add `vscode-autohotkey-debug.variables.firstFile` [command variable](https://code.visualstudio.com/docs/editor/variables-reference#_command-variables) - * Added: [#271](https://github.com/zero-plusplus/vscode-autohotkey-debug/issues/271) Add `vscode-autohotkey-debug.variables.rightmostFile` [command variable](https://code.visualstudio.com/docs/editor/variables-reference#_command-variables) + * Added: [#271](https://github.com/zero-plusplus/vscode-autohotkey-debug/issues/271) Add `vscode-autohotkey-debug.variables.lastFile` [command variable](https://code.visualstudio.com/docs/editor/variables-reference#_command-variables) * Added: [#286](https://github.com/zero-plusplus/vscode-autohotkey-debug/issues/286) Support autocomplete in Debug Console and Conditional Breakpoint * Changed: [#60](https://github.com/zero-plusplus/vscode-autohotkey-debug/issues/60) Change to suppress error dialogs if runtime supports them * Changed: [#116](https://github.com/zero-plusplus/vscode-autohotkey-debug/issues/116) Enhanced conditional breakpoint diff --git a/demo/.vscode/launch.json b/demo/.vscode/launch.json index 8fdfde3e..728e7d56 100644 --- a/demo/.vscode/launch.json +++ b/demo/.vscode/launch.json @@ -45,11 +45,11 @@ "extends": "AutoHotkey Debug" }, { - "name": "rightmostFile Test", + "name": "lastFile Test", "type": "autohotkey", "request": "launch", - "program": "${command:vscode-autohotkey-debug.variables.rightmostFile}", - "openFileOnExit": "${command:vscode-autohotkey-debug.variables.rightmostFile}", + "program": "${command:vscode-autohotkey-debug.variables.lastFile}", + "openFileOnExit": "${command:vscode-autohotkey-debug.variables.lastFile}", "extends": "AutoHotkey Debug" }, { diff --git a/package.json b/package.json index b2818a8b..fa3be45b 100644 --- a/package.json +++ b/package.json @@ -99,7 +99,7 @@ "title": "Returns the path of the first file found in the first tab group" }, { - "command": "vscode-autohotkey-debug.variables.rightmostFile", + "command": "vscode-autohotkey-debug.variables.lastFile", "title": "Returns the path of the last file found in the last tab group" }, { @@ -150,7 +150,7 @@ "when": "false" }, { - "command": "vscode-autohotkey-debug.variables.rightmostFile", + "command": "vscode-autohotkey-debug.variables.lastFile", "when": "false" }, { diff --git a/src/commands.ts b/src/commands.ts index fe63c008..c598101e 100644 --- a/src/commands.ts +++ b/src/commands.ts @@ -133,7 +133,7 @@ export const registerCommands = (context: vscode.ExtensionContext): void => { } throw Error('`vscode-autohotkey-debug.variables.firstFile` can be used with vscode v1.67.0 or higher.'); })); - context.subscriptions.push(vscode.commands.registerCommand('vscode-autohotkey-debug.variables.rightmostFile', (): string => { + context.subscriptions.push(vscode.commands.registerCommand('vscode-autohotkey-debug.variables.lastFile', (): string => { if (semver.gte(vscode.version, '1.67.0')) { // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access const tabGroups: any = (vscode.window as any).tabGroups; @@ -148,15 +148,15 @@ export const registerCommands = (context: vscode.ExtensionContext): void => { throw Error('File not found.'); } // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access - const firstTab = tab.tabs[tab.tabs.length - 1]; + const lasttTab = tab.tabs[tab.tabs.length - 1]; // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access - if (firstTab.input?.uri) { + if (lasttTab.input?.uri) { // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access - return URI.parse(firstTab.input.uri).fsPath; + return URI.parse(lasttTab.input.uri).fsPath; } throw Error('File not found.'); } - throw Error('`vscode-autohotkey-debug.variables.rightmostFile` can be used with vscode v1.67.0 or higher.'); + throw Error('`vscode-autohotkey-debug.variables.lastFile` can be used with vscode v1.67.0 or higher.'); })); context.subscriptions.push(vscode.commands.registerCommand('vscode-autohotkey-debug.commands.runToEndOfFunction', (): void => { enableRunToEndOfFunction = true;