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.

Revert "update"

Myles Scolnick111593e2d82d
diff --git a/frontend/src/core/codemirror/language/__tests__/extension.test.ts b/frontend/src/core/codemirror/language/__tests__/extension.test.ts
index 4dded16d90..45ff2348bd 100644
--- a/frontend/src/core/codemirror/language/__tests__/extension.test.ts
+++ b/frontend/src/core/codemirror/language/__tests__/extension.test.ts
@@ -1,5 +1,5 @@
/* Copyright 2024 Marimo. All rights reserved. */
-import { describe, expect, it } from "vitest";
+import { beforeAll, describe, expect, it } from "vitest";
import {
adaptiveLanguageConfiguration,
getInitialLanguageAdapter,
@@ -8,6 +8,8 @@ import {
} from "../extension";
import { EditorState } from "@codemirror/state";
import { OverridingHotkeyProvider } from "@/core/hotkeys/hotkeys";
+import { store } from "@/core/state/jotai";
+import { capabilitiesAtom } from "@/core/config/capabilities";
import { EditorView } from "@codemirror/view";
import type { CellId } from "@/core/cells/ids";
import { cellConfigExtension } from "../../config/extension";
@@ -43,6 +45,13 @@ function createState(content: string, selection?: { anchor: number }) {
}
describe("getInitialLanguageAdapter", () => {
+ beforeAll(() => {
+ store.set(capabilitiesAtom, {
+ sql: true,
+ terminal: true,
+ });
+ });
+
it("should return python", () => {
let state = createState("def f():\n return 1");
expect(getInitialLanguageAdapter(state).type).toBe("python");
diff --git a/frontend/src/core/codemirror/language/__tests__/sql.test.ts b/frontend/src/core/codemirror/language/__tests__/sql.test.ts
index f92ab5a9bf..d9391d54d9 100644
--- a/frontend/src/core/codemirror/language/__tests__/sql.test.ts
+++ b/frontend/src/core/codemirror/language/__tests__/sql.test.ts
@@ -1,7 +1,16 @@
/* Copyright 2024 Marimo. All rights reserved. */
-import { expect, describe, it, afterAll, afterEach, beforeEach } from "vitest";
+import {
+ expect,
+ describe,
+ it,
+ beforeAll,
+ afterAll,
+ afterEach,
+ beforeEach,
+} from "vitest";
import { SQLCompletionStore, SQLLanguageAdapter } from "../sql";
import { store } from "@/core/state/jotai";
+import { capabilitiesAtom } from "@/core/config/capabilities";
import {
dataSourceConnectionsAtom,
DEFAULT_ENGINE,
@@ -13,6 +22,13 @@ import { PostgreSQL } from "@codemirror/lang-sql";
const adapter = new SQLLanguageAdapter();
describe("SQLLanguageAdapter", () => {
+ beforeAll(() => {
+ store.set(capabilitiesAtom, {
+ sql: true,
+ terminal: true,
+ });
+ });
+
describe("transformIn", () => {
afterAll(() => {
adapter.engine = DEFAULT_ENGINE;