diff --git a/vscode/qodana/src/core/cli/executor.ts b/vscode/qodana/src/core/cli/executor.ts index 1adc205..63877b9 100644 --- a/vscode/qodana/src/core/cli/executor.ts +++ b/vscode/qodana/src/core/cli/executor.ts @@ -4,7 +4,7 @@ import { getLanguagesInWorkspace, getLinterByCode as getLinterImageByCode, getLi import * as os from 'os'; import * as path from 'path'; import * as fs from 'fs'; -import {NO_LINTERS_FOUND, NO_REPORT_FOUND, scanFinished} from '../messages'; +import {NO_LINTERS_FOUND, NO_REPORT_FOUND, NO_WORKSPACE_OPENED, scanFinished} from '../messages'; import { Events } from '../events'; import {LOCAL_REPORT, WS_REPORT_ID} from '../config'; @@ -72,7 +72,11 @@ export async function prepareRun(token: string): Promise { let langs = await getLanguagesInWorkspace(); let { communityLinters, paidLinters } = getLinters(langs); if (communityLinters.length === 0 && paidLinters.length === 0) { - vscode.window.showErrorMessage(NO_LINTERS_FOUND); + if (vscode.workspace.workspaceFolders === undefined) { + vscode.window.showErrorMessage(NO_WORKSPACE_OPENED); + } else { + vscode.window.showErrorMessage(NO_LINTERS_FOUND); + } return false; } diff --git a/vscode/qodana/src/core/messages/index.ts b/vscode/qodana/src/core/messages/index.ts index 980fbdd..b1b4bd8 100644 --- a/vscode/qodana/src/core/messages/index.ts +++ b/vscode/qodana/src/core/messages/index.ts @@ -87,6 +87,7 @@ export const GET_TOKEN = vscode.l10n.t('[Qodana] Enter Qodana token.'); // SELECTION export const NO_LINTERS_FOUND = vscode.l10n.t('[Qodana] No supported linters found in the workspace.'); +export const NO_WORKSPACE_OPENED = vscode.l10n.t('[Qodana] No workspace is currently opened.'); // CLI EXECUTION