Skip to content

Commit

Permalink
docs: update website
Browse files Browse the repository at this point in the history
  • Loading branch information
HaydenOrz committed Nov 10, 2023
1 parent 2845a70 commit cde6104
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 20 deletions.
3 changes: 2 additions & 1 deletion website/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import { create, Workbench } from '@dtinsight/molecule';
import InstanceService from '@dtinsight/molecule/esm/services/instanceService';
import { ExtendsWorkbench } from './extensions/workbench';

import './languages';

import '@dtinsight/molecule/esm/style/mo.css';
import './App.css';
import './languageWorker';

function App(): React.ReactElement {
const refMoInstance = useRef<InstanceService>();
Expand Down
2 changes: 2 additions & 0 deletions website/src/extensions/workbench/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ export default class Sidebar extends React.Component {

componentDidMount() {
molecule.editor.onUpdateTab(this.analyseProblems);

monaco.editor.setTheme('sql-dark');
}

private get language(): string {
Expand Down
26 changes: 26 additions & 0 deletions website/src/languages/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import 'monaco-sql-languages/out/esm/monaco.contribution.js';
import './languageWorker';
import './theme';
import { setupLanguageFeatures, LanguageIdEnum } from 'monaco-sql-languages/out/esm/main.js';

import { completionService } from './helpers/completionService';

setupLanguageFeatures({
languageId: LanguageIdEnum.FLINK,
completionService
});

setupLanguageFeatures({
languageId: LanguageIdEnum.SPARK,
completionService
});

setupLanguageFeatures({
languageId: LanguageIdEnum.HIVE,
completionService
});

setupLanguageFeatures({
languageId: LanguageIdEnum.TRINO,
completionService
});
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @ts-nocheck
import EditorWorker from '../node_modules/monaco-editor/esm/vs/editor/editor.worker?worker';
import EditorWorker from '../../node_modules/monaco-editor/esm/vs/editor/editor.worker?worker';

import FlinkSQLWorker from 'monaco-sql-languages/out/esm/flinksql/flinksql.worker?worker';
import SparkSQLWorker from 'monaco-sql-languages/out/esm/sparksql/sparksql.worker?worker';
Expand Down
6 changes: 6 additions & 0 deletions website/src/languages/theme.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { editor } from 'monaco-editor/esm/vs/editor/editor.api';
import { vsPlusTheme } from 'monaco-sql-languages/out/esm/main';

editor.defineTheme('sql-dark', vsPlusTheme.darkThemeData);
editor.defineTheme('sql-light', vsPlusTheme.lightThemeData);
editor.defineTheme('sql-hc', vsPlusTheme.hcBlackThemeData);
1 change: 0 additions & 1 deletion website/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React from 'react';
import ReactDOM from 'react-dom/client';
import App from './App.tsx';
import './index.css';
import './sqlLanguages/index.ts';

ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
<React.StrictMode>
Expand Down
17 changes: 0 additions & 17 deletions website/src/sqlLanguages/index.ts

This file was deleted.

0 comments on commit cde6104

Please sign in to comment.