mirror of https://github.com/astral-sh/ruff
Fix stale diagnostics in Ruff playground (#17583)
This commit is contained in:
parent
8abf93f5fb
commit
624f5c6c22
|
|
@ -41,10 +41,10 @@
|
||||||
"pyodide": "^0.27.4",
|
"pyodide": "^0.27.4",
|
||||||
"react": "^19.0.0",
|
"react": "^19.0.0",
|
||||||
"react-dom": "^19.0.0",
|
"react-dom": "^19.0.0",
|
||||||
"react-resizable-panels": "^2.1.8",
|
"react-resizable-panels": "^2.1.7",
|
||||||
"red_knot_wasm": "file:red_knot_wasm",
|
"red_knot_wasm": "file:red_knot_wasm",
|
||||||
"shared": "0.0.0",
|
"shared": "0.0.0",
|
||||||
"smol-toml": "^1.3.3"
|
"smol-toml": "^1.3.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"vite-plugin-static-copy": "^2.3.0"
|
"vite-plugin-static-copy": "^2.3.0"
|
||||||
|
|
@ -6087,14 +6087,14 @@
|
||||||
"monaco-editor": "^0.52.0",
|
"monaco-editor": "^0.52.0",
|
||||||
"react": "^19.0.0",
|
"react": "^19.0.0",
|
||||||
"react-dom": "^19.0.0",
|
"react-dom": "^19.0.0",
|
||||||
"react-resizable-panels": "^2.1.8",
|
"react-resizable-panels": "^2.0.0",
|
||||||
"ruff_wasm": "file:ruff_wasm",
|
"ruff_wasm": "file:ruff_wasm",
|
||||||
"shared": "0.0.0",
|
"shared": "0.0.0",
|
||||||
"smol-toml": "^1.3.3"
|
"smol-toml": "^1.3.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ruff/ruff_wasm": {
|
"ruff/ruff_wasm": {
|
||||||
"version": "0.11.3",
|
"version": "0.11.4",
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"shared": {
|
"shared": {
|
||||||
|
|
@ -6103,7 +6103,7 @@
|
||||||
"@monaco-editor/react": "^4.7.0",
|
"@monaco-editor/react": "^4.7.0",
|
||||||
"classnames": "^2.3.2",
|
"classnames": "^2.3.2",
|
||||||
"react": "^19.0.0",
|
"react": "^19.0.0",
|
||||||
"react-resizable-panels": "^2.1.8"
|
"react-resizable-panels": "^2.1.7"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -66,27 +66,28 @@ function Items({
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const uniqueIds: Map<string, number> = new Map();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ul className="space-y-0.5 grow overflow-y-scroll">
|
<ul className="space-y-0.5 grow overflow-y-scroll">
|
||||||
{diagnostics.map((diagnostic, index) => {
|
{diagnostics.map((diagnostic) => {
|
||||||
|
const row = diagnostic.start_location.row;
|
||||||
|
const column = diagnostic.start_location.column;
|
||||||
|
const mostlyUniqueId = `${row}:${column}-${diagnostic.code}`;
|
||||||
|
|
||||||
|
const disambiguator = uniqueIds.get(mostlyUniqueId) ?? 0;
|
||||||
|
uniqueIds.set(mostlyUniqueId, disambiguator + 1);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<li
|
<li key={`${mostlyUniqueId}-${disambiguator}`}>
|
||||||
key={`${diagnostic.start_location.row}:${diagnostic.start_location.column}-${diagnostic.code ?? index}`}
|
|
||||||
>
|
|
||||||
<button
|
<button
|
||||||
onClick={() =>
|
onClick={() => onGoTo(row, column)}
|
||||||
onGoTo(
|
|
||||||
diagnostic.start_location.row,
|
|
||||||
diagnostic.start_location.column,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
className="w-full text-start cursor-pointer select-text"
|
className="w-full text-start cursor-pointer select-text"
|
||||||
>
|
>
|
||||||
{diagnostic.message}{" "}
|
{diagnostic.message}{" "}
|
||||||
<span className="text-gray-500">
|
<span className="text-gray-500">
|
||||||
{diagnostic.code != null && `(${diagnostic.code})`} [Ln{" "}
|
{diagnostic.code != null && `(${diagnostic.code})`} [Ln {row},
|
||||||
{diagnostic.start_location.row}, Col{" "}
|
Col {column}]
|
||||||
{diagnostic.start_location.column}]
|
|
||||||
</span>
|
</span>
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue