Skip to content

Fix runtime error in lint command #523

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 11, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/linter/LintManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,11 @@ export default class LintManager {
async runLintTool() {
// Check for language id
this.logger.info('Executing runLintTool()');
let lang: string = vscode.window.activeTextEditor.document.languageId;
const editor = vscode.window.activeTextEditor;
if (
vscode.window.activeTextEditor === undefined ||
(lang !== 'verilog' && lang !== 'systemverilog')
!editor ||
(editor.document.languageId !== 'verilog' &&
editor.document.languageId !== 'systemverilog')
) {
vscode.window.showErrorMessage('Verilog-HDL/SystemVerilog: No document opened');
return;
Expand Down Expand Up @@ -151,8 +152,8 @@ export default class LintManager {
}
this.logger.info('Using ' + linter.name + ' linter');

linter.removeFileDiagnostics(vscode.window.activeTextEditor.document);
linter.startLint(vscode.window.activeTextEditor.document);
linter.removeFileDiagnostics(editor.document);
linter.startLint(editor.document);
}
);
}
Expand Down
Loading