Revert "Upgrade Monaco Editor (#847)" (#850)

This reverts commit 5e2b8d7df0.
This commit is contained in:
Steve Faulkner
2021-05-28 15:49:29 -05:00
committed by GitHub
parent b875407d49
commit 04b3ef051a
5 changed files with 12 additions and 35 deletions

View File

@@ -52,7 +52,7 @@ class EditorViewModel extends JsonEditorViewModel {
if (EditorViewModel.providerRegistered.indexOf("sql") < 0) {
const { SqlCompletionItemProvider } = await import("@azure/cosmos-language-service");
const monaco = await loadMonaco();
monaco.languages.registerCompletionItemProvider("sql", new SqlCompletionItemProvider() as any); //TODO: Remove any. The upstream cosmos language service needs to be fixed
monaco.languages.registerCompletionItemProvider("sql", new SqlCompletionItemProvider());
EditorViewModel.providerRegistered.push("sql");
}
}

View File

@@ -62,7 +62,7 @@ export class EditorReact extends React.Component<EditorReactProps> {
* Create the monaco editor and attach to DOM
*/
private async createEditor(createCallback: (e: monaco.editor.IStandaloneCodeEditor) => void) {
const options = {
const options: monaco.editor.IEditorConstructionOptions = {
value: this.props.content,
language: this.props.language,
readOnly: this.props.isReadOnly,

View File

@@ -90,7 +90,7 @@ export class JsonEditorViewModel extends WaitsForTemplateViewModel {
protected async createEditor(content: string, createCallback: (e: monaco.editor.IStandaloneCodeEditor) => void) {
this.registerCompletionItemProvider();
this.editorContainer = document.getElementById(this.getEditorId());
const options = {
const options: monaco.editor.IEditorConstructionOptions = {
value: content,
language: this.getEditorLanguage(),
readOnly: this.params.isReadOnly,