Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

style: add underscore example to multiple-defs error (#7084)

Myles Scolnicka0fbce9da681
diff --git a/frontend/src/components/editor/output/MarimoErrorOutput.tsx b/frontend/src/components/editor/output/MarimoErrorOutput.tsx
index 7281bdd082..a025988c44 100644
--- a/frontend/src/components/editor/output/MarimoErrorOutput.tsx
+++ b/frontend/src/components/editor/output/MarimoErrorOutput.tsx
@@ -9,6 +9,7 @@ import {
AccordionTrigger,
} from "@/components/ui/accordion";
import { Button } from "@/components/ui/button";
+import { Kbd } from "@/components/ui/kbd";
import { ExternalLink } from "@/components/ui/links";
import type { CellId } from "@/core/cells/ids";
import type { MarimoError } from "../../../core/kernel/messages";
@@ -260,6 +261,7 @@ export const MarimoErrorOutput = ({
}
if (multipleDefsErrors.length > 0) {
+ const firstName = multipleDefsErrors[0].name;
messages.push(
<div key="multiple-defs">
<p className="text-muted-foreground font-medium">
@@ -294,7 +296,8 @@ export const MarimoErrorOutput = ({
<p className="py-2">
Try merging this cell with the mentioned cells or wrapping it in a
function. Alternatively, rename variables to make them private to
- this cell by prefixing them with an underscore.
+ this cell by prefixing them with an underscore (e.g.{" "}
+ <Kbd className="inline">_{firstName}</Kbd>).
</p>
<p className="py-2">