Skip to content

Commit

Permalink
Change: #271
Browse files Browse the repository at this point in the history
Rename rightmostFile to lastFile
  • Loading branch information
zero-plusplus committed Feb 13, 2023
1 parent 0903666 commit 562ef76
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions demo/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
{
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
{
Expand Down Expand Up @@ -150,7 +150,7 @@
"when": "false"
},
{
"command": "vscode-autohotkey-debug.variables.rightmostFile",
"command": "vscode-autohotkey-debug.variables.lastFile",
"when": "false"
},
{
Expand Down
10 changes: 5 additions & 5 deletions src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 562ef76

Please sign in to comment.