MCPcopy Create free account
hub / github.com/bytebase/bytebase / buildAdviceHoverMessage

Function buildAdviceHoverMessage

frontend/src/react/components/monaco/utils.ts:136–154  ·  view source on GitHub ↗
(advice: {
  severity: "ERROR" | "WARNING";
  message: string;
  source?: string;
})

Source from the content-addressed store, hash-verified

134};
135
136export const buildAdviceHoverMessage = (advice: {
137 severity: "ERROR" | "WARNING";
138 message: string;
139 source?: string;
140}) => {
141 const colors = {
142 WARNING: callCssVariable("--color-warning"),
143 ERROR: callCssVariable("--color-error"),
144 };
145 const parts: string[] = [];
146 parts.push(
147 `<span style="color:${colors[advice.severity]};">[${advice.severity}]</span>`
148 );
149 if (advice.source) {
150 parts.push(` ${escapeMarkdown(advice.source)}`);
151 }
152 parts.push(`\n${escapeMarkdown(advice.message)}`);
153 return parts.join("");
154};

Callers 1

buildAdviceDecorationsFunction · 0.90

Calls 2

callCssVariableFunction · 0.90
escapeMarkdownFunction · 0.90

Tested by

no test coverage detected