Skip to content

Commit

Permalink
asdf
Browse files Browse the repository at this point in the history
  • Loading branch information
DetachHead committed Dec 14, 2024
1 parent 8ac1828 commit 33d9104
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
6 changes: 2 additions & 4 deletions packages/pyright-internal/src/common/console.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export class NullConsole implements ConsoleInterface {

export class StandardConsole implements ConsoleInterface {
/** useful for determining whether to exit with a non-zero exit code */
errorWasLogged = false;
errors = new Array<string>();
constructor(private _maxLevel: LogLevel = LogLevel.Log) {}

get level(): LogLevel {
Expand All @@ -110,9 +110,7 @@ export class StandardConsole implements ConsoleInterface {
}

error(message: string) {
if (!this.errorWasLogged) {
this.errorWasLogged = true;
}
this.errors.push(message);
if (getLevelNumber(this._maxLevel) >= getLevelNumber(LogLevel.Error)) {
console.error(message);
}
Expand Down
6 changes: 3 additions & 3 deletions packages/pyright-internal/src/pyright.ts
Original file line number Diff line number Diff line change
Expand Up @@ -548,8 +548,7 @@ const checkForErrors = (
configParseErrorOccurred: false | string,
console: ConsoleInterface
): boolean => {
if (console instanceof StandardConsole && console.errorWasLogged) {
console.errorWasLogged = false;
if (console instanceof StandardConsole && console.errors) {
exitStatus.resolve(ExitStatus.ConfigFileParseError);
return true;
}
Expand Down Expand Up @@ -581,7 +580,8 @@ async function runSingleThreaded(
}

if (checkForErrors(exitStatus, results.configParseErrorOccurred, output)) {
console.error(`singlethreaded config parse error occurred: ${results.configParseErrorOccurred}`);
const errors = console instanceof StandardConsole ? console.errors.join('\n') : 'no errors????';
console.error(`singlethreaded config parse error occurred: ${errors}`);
return;
}

Expand Down

0 comments on commit 33d9104

Please sign in to comment.