fix(editor): handle Oracle line comments in DDL viewer

This commit is contained in:
zipg authored and GitHub committed 2026-07-13 16:14:56 +08:00
1 parent 29b351691a
commit cc9b802b49
6 files changed
+122 -24

No files matched your search

@@ -14,7 +14,7 @@ import { Button } from "@/components/ui/button";
import { Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle } from "@/components/ui/dialog";
import EditorSearchPanel from "@/components/editor/EditorSearchPanel.vue";
import type { EditorView } from "@codemirror/view";
import type { ObjectSourceKind } from "@/types/database";
import type { DatabaseType, ObjectSourceKind } from "@/types/database";
const props = withDefaults(
defineProps<{
@@ -24,7 +24,9 @@ const props = withDefaults(
schema?: string;
tableName: string;
objectType?: ObjectSourceKind;
/** SQL dialect for syntax highlighting. Non-PG/non-MSSQL databases fall back to MySQL (same as QueryEditor's source viewer). */
/** Effective database type selects database-specific syntax rules; older callers can still rely on the dialect fallback. */
databaseType?: DatabaseType;
/** SQL dialect fallback for syntax highlighting when the effective database type is unavailable. */
dialect: "mysql" | "postgres" | "sqlserver";
/** SQL formatter dialect. Kept separate from the syntax-highlighting dialect because several PG-compatible DBs highlight as MySQL. */
formatDialect?: SqlFormatDialect;
@@ -88,7 +90,7 @@ async function initDdlEditor(content: string) {
const fontFamily = settingsStore.editorSettings.fontFamily;
const themeExt = await loadEditorTheme(editorTheme, appAppearance, undefined, themePalette.value);
const fontExt = editorFontTheme(EditorView, fontSize, fontFamily, { fixedHeight: true, scrollable: true });
const dialect = createDbxCodeMirrorSqlDialect(langSql, props.dialect);
const dialect = createDbxCodeMirrorSqlDialect(langSql, props.dialect, props.databaseType);
const state = EditorState.create({
doc: content,
extensions: [