mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-09-24 16:04:36 +08:00
fix(plugin-sql-editor): CB-184 handle unknown dialect
This commit is contained in:
@@ -75,9 +75,11 @@ export class CodeEditorController {
|
||||
[value]: value,
|
||||
}), {});
|
||||
|
||||
if (this.bindings.options && this.dialect.name) {
|
||||
if (this.bindings.options) {
|
||||
const name = this.dialect.name && findModeByName(this.dialect.name)?.mime;
|
||||
|
||||
this.bindings.options.mode = {
|
||||
name: findModeByName(this.dialect.name).mime,
|
||||
name: name || COMMON_EDITOR_CONFIGURATION.mode,
|
||||
keywords,
|
||||
builtin,
|
||||
};
|
||||
|
||||
+1
-1
@@ -16,5 +16,5 @@ declare module 'codemirror' {
|
||||
ext?: string[];
|
||||
alias?: string[];
|
||||
}
|
||||
function findModeByName(name: string): ModeInfo;
|
||||
function findModeByName(name: string): ModeInfo | undefined;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user