INNER CODE UNIT · TypeScript
index
q2316367743/es-client · src/components/SqlEditor/index.ts:30
const index = useIndexStore().list.find(i => i.name === tableName || i.alias.includes(tableName));
if (!index) return [];
return index.fields.map(i => i.label);
}
}));
// 代码折叠
monaco.languages.registerFoldingRangeProvider('es-sql', restFoldingRangeProvider)
// 语法高亮主题
monaco.editor.defineTheme('es-sql-enhanced-dark', {
base: 'vs-dark',
inherit: true,
rules: [
{token: 'function.concat', foreground: '4EC9B0', fontStyle: 'bold'},
{token: 'function.date_format', foreground: 'C586C0', fontStyle: 'bold'},
{token: 'string.format', foreground: 'CE9178', fontStyle: 'italic'}, // 格式串斜体
{token: 'identifier.backtick', foreground: '999999', fontStyle: 'italic'}
],