Skip to content
This repository was archived by the owner on May 4, 2023. It is now read-only.

Commit 735fdd5

Browse files
Merge pull request #78 from codiga/fix-undefined-editor
Record the last active editor when the user changes editor tabs
2 parents 5103731 + 9869fec commit 735fdd5

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"React",
3030
"Typescript"
3131
],
32-
"version": "0.9.0",
32+
"version": "0.9.1",
3333
"engines": {
3434
"node": "^16.0.0",
3535
"vscode": "^1.70.0"

src/extension.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,16 @@ export async function activate(context: vscode.ExtensionContext) {
318318
vscode.workspace.onDidChangeTextDocument(() => {
319319
recordLastActivity();
320320
});
321+
322+
323+
/**
324+
* Whenever the user switches to a different tab, we record the new active text editor,
325+
* so that Codiga Assistant preview/insert has a target editor to work with.
326+
*/
327+
vscode.window.onDidChangeActiveTextEditor(editor => {
328+
if (editor)
329+
recordLastEditor();
330+
});
321331
}
322332

323333
// this method is called when your extension is deactivated

0 commit comments

Comments
 (0)