fix(spelling): Rename identifiers on Typo fixes, add inspection controls, cut false positives (#51)

Root causes: Typo "Change to" replaced one occurrence even for declared names (breaking references); inspections had no Disable / Edit settings controls anywhere; en_US Hunspell does not derive agent nouns like "checkpointer" and compound identifier words were flagged; local inspections (Typo, file references, SQL) never reached Problems.
Fix (IDEA): "Typo: Rename to…" renames via LSP rename, falling back to syntax-based local rename, never a silent single replace, and lists identifier-safe words only; intention submenu (→) with Edit inspection profile setting / Disable inspection for every inspection; Problems and Inspection Results get Disable Inspection, Change Severity, Edit Inspection Profile Setting; Typo options Process code / literals / comments; -er/-ers derivation and identifier compounds accepted, common misspellings still flagged.
Siblings covered: all LSP and built-in inspections' intentions, file reference and SQL inspections in Problems, severity counter.
Verified: ide-spell tests (issue examples + ~50 real misspellings), vitest (286), in-app on macOS: only 'mesage' flagged, submenu, Rename to → 'message' updated both occurrences.

Claude-Session: https://claude.ai/code/session_01VUYsdXA2nkF5v6zsC93dpn
Цей коміт міститься в:
l0ng-ai authored and GitHub committed 2026-10-27 10:38:53 +08:00
1 джерело eda8cae0a1
коміт aa5821bb46
32 files changed
+1289 -61

No files matched your search

+10
Переглянути файл
@@ -6,6 +6,7 @@
import { create } from "zustand";
import type { Diagnostic, Severity } from "@/bindings";
import { onIdeEvent } from "@/platform/ipc";
import { onLocalDiagnostics } from "@/platform/localDiagnostics";
import {
applyProfile,
inspectionProfile,
@@ -53,6 +54,12 @@ export function fileDiagnostics(map: ProblemsMap, path: string): Diagnostic[] {
);
}
/** The producer (inspection) that reported `d`, one of `path`'s problems in `map`. */
export function producerFor(map: ProblemsMap, path: string, d: Diagnostic): string | null {
for (const [source, items] of map.get(path) ?? []) if (items.includes(d)) return source;
return null;
}
export interface ProblemOrder {
/** Errors before warnings before infos (IDEA's default). */
bySeverity: boolean;
@@ -130,11 +137,14 @@ export function clearProblems() {
export function installProblemsEvents(): () => void {
const off = onIdeEvent("diagnostics", (e) => applyDiagnosticsEvent(e.path, e.source, e.items));
// Typo, file references, SQL: inspections the editor runs itself.
const offLocal = onLocalDiagnostics(applyDiagnosticsEvent);
const offProfile = subscribeInspectionProfile(() =>
useProblems.setState((s) => ({ map: profiledProblems(s.raw, inspectionProfile()) })),
);
return () => {
off();
offLocal();
offProfile();
};
}