From 192221a34075092f47d2c5084630240290bff51a Mon Sep 17 00:00:00 2001 From: detachhead Date: Mon, 23 Dec 2024 21:09:44 +1000 Subject: [PATCH] warn instead of error when placeholder `` path is not found --- packages/pyright-internal/src/analyzer/service.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/pyright-internal/src/analyzer/service.ts b/packages/pyright-internal/src/analyzer/service.ts index 6a1a6a47e..783c100e3 100644 --- a/packages/pyright-internal/src/analyzer/service.ts +++ b/packages/pyright-internal/src/analyzer/service.ts @@ -1441,9 +1441,13 @@ export class AnalyzerService { } if (!foundFileSpec) { - (this._console as ConsoleInterface).error( - `File or directory "${includeSpec.wildcardRoot.toUserVisibleString()}" does not exist.` - ); + const path = includeSpec.wildcardRoot.toUserVisibleString(); + const message = `File or directory "${path}" does not exist.`; + if (path.includes(Uri.DefaultWorkspaceRootComponent)) { + this._console.warn(message); + } else { + this._console.error(message); + } } } });