Skip to content

Commit c24cb01

Browse files
author
Kartik Raj
committed
Only display folder name for more than one workspace folder scenario
1 parent 1dc6bc6 commit c24cb01

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/client/application/diagnostics/checks/pythonInterpreter.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,15 @@ export class InvalidPythonInterpreterDiagnostic extends BaseDiagnostic {
4848
scope = DiagnosticScope.WorkspaceFolder,
4949
) {
5050
let formatArg = '';
51-
if (workspaceService.workspaceFile) {
51+
if (
52+
workspaceService.workspaceFile &&
53+
workspaceService.workspaceFolders &&
54+
workspaceService.workspaceFolders?.length > 1
55+
) {
5256
// Specify folder name in case of multiroot scenarios
5357
const folder = workspaceService.getWorkspaceFolder(resource);
5458
if (folder) {
55-
formatArg = ` for ${path.basename(folder.uri.fsPath)}`;
59+
formatArg = ` ${localize('Common.for', 'for')} ${path.basename(folder.uri.fsPath)}`;
5660
}
5761
}
5862
super(code, messages[code].format(formatArg), DiagnosticSeverity.Error, scope, resource, undefined, 'always');

0 commit comments

Comments
 (0)