Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix][Web]fix monaco use cdn,but should use local #2701

Merged
merged 2 commits into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions dinky-web/src/components/CustomEditor/CodeEdit/function.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ import ITextModel = editor.ITextModel;
import ProviderResult = languages.ProviderResult;
import CompletionList = languages.CompletionList;
import CompletionItem = languages.CompletionItem;
import {loader} from "@monaco-editor/react";
// 导入 lodash
loader.config({ monaco });

/**
* get keyWordJson from {@link ./keyword.json}
Expand Down
4 changes: 3 additions & 1 deletion dinky-web/src/components/CustomEditor/CodeEdit/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { handleInitEditorAndLanguageOnBeforeMount } from '@/components/CustomEdi
import { StateType } from '@/pages/DataStudio/model';
import { MonacoEditorOptions, SuggestionInfo } from '@/types/Public/data';
import { convertCodeEditTheme } from '@/utils/function';
import { Editor, Monaco, OnChange } from '@monaco-editor/react';
import {Editor, loader, Monaco, OnChange} from '@monaco-editor/react';
import { connect } from '@umijs/max';
import useMemoCallback from 'rc-menu/es/hooks/useMemoCallback';
import { memo, useCallback, useRef } from 'react';
Expand All @@ -35,6 +35,8 @@ import CompletionContext = languages.CompletionContext;
import CompletionList = languages.CompletionList;
import ProviderResult = languages.ProviderResult;

loader.config({ monaco });

let provider = {
dispose: () => {}
};
Expand Down
6 changes: 5 additions & 1 deletion dinky-web/src/components/CustomEditor/CodeShow/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,12 @@ import { EditorLanguage } from 'monaco-editor/esm/metadata';

import FullscreenBtn from '@/components/CustomEditor/FullscreenBtn';
import { handleInitEditorAndLanguageOnBeforeMount } from '@/components/CustomEditor/function';
import { Editor, Monaco } from '@monaco-editor/react';
import {Editor, loader, Monaco} from '@monaco-editor/react';
import { CSSProperties, useRef, useState } from 'react';
import * as monaco from "monaco-editor";

loader.config({ monaco });


export type CodeShowFormProps = {
height?: string | number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,13 @@ import {
} from '@/pages/DataStudio/MiddleContainer/StudioEditor/constants';
import { convertCodeEditTheme } from '@/utils/function';
import { l } from '@/utils/intl';
import { DiffEditor } from '@monaco-editor/react';
import {DiffEditor, loader} from '@monaco-editor/react';
import { Col, Modal, Row, Space, Table, Tabs, Typography } from 'antd';
import React, { memo } from 'react';
import styles from './index.less';
import * as monaco from "monaco-editor";

loader.config({ monaco });

const { Text, Link } = Typography;

Expand Down
Loading