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.

Enable editor code lens (#10507)

Shahmir Varqhab48e16cbce18
diff --git a/frontend/src/core/codemirror/code-lens/__tests__/extension.test.ts b/frontend/src/core/codemirror/code-lens/__tests__/extension.test.ts
index ddedb0d996..2e2ad6afda 100644
--- a/frontend/src/core/codemirror/code-lens/__tests__/extension.test.ts
+++ b/frontend/src/core/codemirror/code-lens/__tests__/extension.test.ts
@@ -103,7 +103,7 @@ describe("codeLensBundle", () => {
beforeEach(() => {
vi.useFakeTimers();
- mockFlags({ editor_code_lens: true, cache_panel: true });
+ mockFlags({ cache_panel: true });
seedStore({});
});
@@ -141,11 +141,6 @@ describe("codeLensBundle", () => {
return [...v.dom.querySelectorAll<HTMLElement>(".mo-code-lens")];
}
- it("returns an empty extension when the flag is off", () => {
- mockFlags({ editor_code_lens: false });
- expect(codeLensBundle(cellId("cell1"))).toEqual([]);
- });
-
it("renders a lens at a dataframe declaration", async () => {
seedStore({ tables: [DF_TABLE] });
const v = await mount("df = load()\nx = 1");
@@ -293,7 +288,7 @@ describe("codeLensBundle", () => {
);
it("does not render cache lenses when the cache panel is disabled", async () => {
- mockFlags({ editor_code_lens: true, cache_panel: false });
+ mockFlags({ cache_panel: false });
const v = await mount("@mo.cache\ndef f():\n return 1");
expect(lenses(v)).toHaveLength(0);
diff --git a/frontend/src/core/codemirror/code-lens/extension.ts b/frontend/src/core/codemirror/code-lens/extension.ts
index fec717acbf..840d69466c 100644
--- a/frontend/src/core/codemirror/code-lens/extension.ts
+++ b/frontend/src/core/codemirror/code-lens/extension.ts
@@ -281,12 +281,8 @@ const codeLensTheme = EditorView.baseTheme({
/**
* Inline icons linking datasource/bucket variables and `mo.cache` /
* `mo.persistent_cache` calls to their panels.
- * Gated behind the `editor_code_lens` feature flag.
*/
export function codeLensBundle(cellId: CellId): Extension {
- if (!getFeatureFlag("editor_code_lens")) {
- return [];
- }
return [
codeLensField,
codeLensHoverField,
diff --git a/frontend/src/core/config/feature-flag.tsx b/frontend/src/core/config/feature-flag.tsx
index cefb4b9389..1a75fe4e3e 100644
--- a/frontend/src/core/config/feature-flag.tsx
+++ b/frontend/src/core/config/feature-flag.tsx
@@ -13,7 +13,6 @@ export interface ExperimentalFeatures {
external_agents: boolean;
debugger: boolean; // Live frame-watching debugger (gutter breakpoints + pdb)
line_timing: boolean; // Green active-line highlight + per-line elapsed timer
- editor_code_lens: boolean; // Inline icons in cell editors linking datasources/buckets/caches to their panels
// Add new feature flags here
}
@@ -25,7 +24,6 @@ const defaultValues: ExperimentalFeatures = {
external_agents: import.meta.env.DEV,
debugger: false,
line_timing: false,
- editor_code_lens: import.meta.env.DEV,
};
export function getFeatureFlag<T extends keyof ExperimentalFeatures>(
diff --git a/marimo/_smoke_tests/editor_code_lens.py b/marimo/_smoke_tests/editor_code_lens.py
index a92d7179c7..e4a44442a5 100644
--- a/marimo/_smoke_tests/editor_code_lens.py
+++ b/marimo/_smoke_tests/editor_code_lens.py
@@ -19,9 +19,9 @@ def _(mo):
mo.md(r"""
# Editor code lens
- Requires the `editor_code_lens` experimental flag (on by default in dev
- builds; otherwise run `setFeatureFlag("editor_code_lens", true)` in the
- browser console). Cache icons also require the `cache_panel` flag.
+ Cache icons require the `cache_panel` experimental flag (on by default in
+ dev builds; otherwise run `setFeatureFlag("cache_panel", true)` in the
+ browser console).
Each cell below creates something that gets a small inline icon next to
it in the editor. Clicking the icon opens the matching panel:
diff --git a/marimo/_smoke_tests/editor_code_lens_stress.py b/marimo/_smoke_tests/editor_code_lens_stress.py
index 4ded3fa2c4..afaa46dbf2 100644
--- a/marimo/_smoke_tests/editor_code_lens_stress.py
+++ b/marimo/_smoke_tests/editor_code_lens_stress.py
@@ -19,9 +19,9 @@ def _(mo):
mo.md(r"""
# Editor code lens (stress test)
- Stress-tests `editor_code_lens` with many datasources, SQL engines, storage
- buckets, and cache sites. Requires `editor_code_lens` (on in dev builds)
- and `cache_panel` for cache icons.
+ Stress-tests editor code lens with many datasources, SQL engines, storage
+ buckets, and cache sites. Cache icons require the `cache_panel` flag (on
+ in dev builds).
Current notebook scale: 200 tables, 50 engines, 50 buckets, 100 cache sites.
""")