mirror of
https://github.com/l0ng-ai/openidea.git
synced 2026-11-24 16:04:21 +00:00
test(plugins): keep the editor panel's problem levels out of the text catalog (#3896)
The severity map's `hint: "weakWarning"` entry read as UI text to the text-catalog check (`hint` is a text property), failing it on main since #3885. A function maps the levels instead.
This commit is contained in:
@@ -42,12 +42,8 @@ export interface EditorPanelDecl {
|
||||
}
|
||||
|
||||
/** The marker bar's levels (IDEA's): `info` is a weak warning; hints have no mark. */
|
||||
const PROBLEM_LEVEL: Record<Severity, EditorProblem["severity"]> = {
|
||||
error: "error",
|
||||
warning: "warning",
|
||||
info: "weakWarning",
|
||||
hint: "weakWarning",
|
||||
};
|
||||
const problemLevel = (severity: Severity): EditorProblem["severity"] =>
|
||||
severity === "error" || severity === "warning" ? severity : "weakWarning";
|
||||
|
||||
const syntaxMarks = new Map<string, Decoration>();
|
||||
const syntaxMark = (classes: string) => {
|
||||
@@ -280,7 +276,7 @@ export class PanelEditor implements FrameEditor {
|
||||
return markerBarProblems(view.state).map((m) => ({
|
||||
line: doc.lineAt(m.from).number - 1,
|
||||
lastLine: doc.lineAt(Math.max(m.from, m.to - 1)).number - 1,
|
||||
severity: PROBLEM_LEVEL[m.severity],
|
||||
severity: problemLevel(m.severity),
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user