From 390d9d78a2429f5684c0c4d1f93943d82cf56d2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maria=20Jos=C3=A9=20Solano?= Date: Sun, 9 Mar 2025 15:06:15 -0700 Subject: [PATCH] Include diagnostic key in data --- server/src/eslint.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/src/eslint.ts b/server/src/eslint.ts index 053256aa..13a2eb6e 100644 --- a/server/src/eslint.ts +++ b/server/src/eslint.ts @@ -411,8 +411,7 @@ export class Fixes { public getScoped(diagnostics: Diagnostic[]): Problem[] { const result: Problem[] = []; for (const diagnostic of diagnostics) { - const key = Diagnostics.computeKey(diagnostic); - const editInfo = this.edits.get(key); + const editInfo = this.edits.get(diagnostic.data.key); if (editInfo) { result.push(editInfo); } @@ -635,6 +634,7 @@ namespace Diagnostics { end: { line: endLine, character: endChar } } }; + result.data = { key: computeKey(result) }; if (problem.ruleId) { const url = RuleMetaData.getUrl(problem.ruleId); result.code = problem.ruleId; @@ -733,7 +733,7 @@ export namespace CodeActions { edits = new Map(); CodeActions.set(uri, edits); } - edits.set(Diagnostics.computeKey(diagnostic), { + edits.set(diagnostic.data.key, { label: `Fix this ${problem.ruleId} problem`, documentVersion: document.version, ruleId: problem.ruleId,