Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Armando Aguirre Sepulveda committed Jan 7, 2025
1 parent c14c06f commit 6df7b24
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/server/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3058,9 +3058,7 @@ export class Session<TMessage = string> implements EventSender {
codeActions = project.getLanguageService().getCodeFixesAtPosition(file, startPosition, endPosition, args.errorCodes, this.getFormatOptions(file), this.getPreferences(file));
}
catch (e) {
if (!(e instanceof Error)) {
e = new Error(e);
}
const error = e instanceof Error ? e : new Error(e);

const ls = project.getLanguageService();
const existingDiagCodes = [
Expand All @@ -3072,9 +3070,9 @@ export class Session<TMessage = string> implements EventSender {
.map(d => d.code);
const badCode = args.errorCodes.find(c => !existingDiagCodes.includes(c));
if (badCode !== undefined) {
e.message += `\nAdditional information: BADCLIENT: Bad error code, ${badCode} not found in range ${startPosition}..${endPosition} (found: ${existingDiagCodes.join(", ")})`;
error.message += `\nAdditional information: BADCLIENT: Bad error code, ${badCode} not found in range ${startPosition}..${endPosition} (found: ${existingDiagCodes.join(", ")})`;
}
throw e;
throw error;
}
return simplifiedResult ? codeActions.map(codeAction => this.mapCodeFixAction(codeAction)) : codeActions;
}
Expand Down

0 comments on commit 6df7b24

Please sign in to comment.