Skip to content

Commit bdd02d8

Browse files
committed
Add error message for importing with no active editor
1 parent d742e17 commit bdd02d8

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
All notable changes to the "ti-basic" extension will be documented in this file.
44

5+
## [1.0.3] - 2024-05-15
6+
7+
### Added
8+
9+
- Error message if no text editor is open when importing a file.
10+
511
## [1.0.2] - 2024-04-11
612

713
### Fixed

src/extension.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ function activate(context) {
2626
console.log('Selected file: ' + fileUri[0].fsPath);
2727
const editor = vscode.window.activeTextEditor;
2828

29+
if (editor == undefined) {
30+
console.error('No text editor active. Create a new file first, then try again.');
31+
vscode.window.showErrorMessage('Error: No text editor active. Create a new file first, then try again.');
32+
return;
33+
}
34+
2935
if (editor && lib) {
3036
let prgm;
3137

0 commit comments

Comments
 (0)