News Articles monaco-editor

Why react-monaco-editor do not surpport an API like componentDidUpdate

Why react-monaco-editor do not surpport an API like componentDidUpdate const [loading, setLoading] = useState(false) // … function editorDidMount(editor, monaco) { editor.addCommand(monaco.KeyMod.Shift | monaco.KeyCode.Enter, () => { if (!loading) { // here is the problem, when i press shift & enter, loading is always false sendCode() } }) editor.focus() } function sendCode() { setLoading(true) setTimeout(() => […]

Why is a random part of the code highlighted?

We have an online editor made by monaco-editor, here is the link: https://v3.10studio.tech/#/formula-editor-addin?app=formula-editor-addin. Users could enter an Excel formula like =1+2+3+4+5, then click on the Format button to see the formatted formula. What is odd is that, after clicking on Format button, a random part of the formula is often highlighted: Does anyone know what’s […]

Indented SASS support for Monaco Editor

This question concerns the javascript Monaco editor. The Monaco Editor supports SCSS, but the scss parameter doesn’t work with SASS indented syntax and sass just doesn’t seem to exist. How is it possible to have syntax colorization and code completion for indented SASS ? Here is how I create my editor: SASSEditor = monaco.editor.create(document.querySelector("#sass_editor"), { […]

Indented SASS support for Monaco Editor

This question concerns the javascript Monaco editor. The Monaco Editor supports SCSS, but the scss parameter doesn’t work with SASS indented syntax and sass just doesn’t seem to exist. How is it possible to have syntax colorization and code completion for indented SASS ? Here is how I create my editor: SASSEditor = monaco.editor.create(document.querySelector("#sass_editor"), { […]

Indented SASS support for Monaco Editor

This question concerns the javascript Monaco editor. The Monaco Editor supports SCSS, but the scss parameter doesn’t work with SASS indented syntax and sass just doesn’t seem to exist. How is it possible to have syntax colorization and code completion for indented SASS ? Here is how I create my editor: SASSEditor = monaco.editor.create(document.querySelector("#sass_editor"), { […]

Indented SASS support for Monaco Editor

This question concerns the javascript Monaco editor. The Monaco Editor supports SCSS, but the scss parameter doesn’t work with SASS indented syntax and sass just doesn’t seem to exist. How is it possible to have syntax colorization and code completion for indented SASS ? Here is how I create my editor: SASSEditor = monaco.editor.create(document.querySelector("#sass_editor"), { […]

Indented SASS support for Monaco Editor

This question concerns the javascript Monaco editor. The Monaco Editor supports SCSS, but the scss parameter doesn’t work with SASS indented syntax and sass just doesn’t seem to exist. How is it possible to have syntax colorization and code completion for indented SASS ? Here is how I create my editor: SASSEditor = monaco.editor.create(document.querySelector("#sass_editor"), { […]

How to catch and handle error in monaco-editor with angular 9

I’m using angular-monaco-editor with my project and I want to restrict the user of saving code that contains errors, I would like to catch if the script typed contains errors so I can create my function based on it! I dived a little bit before asking but I can’t find the event that may help […]

Change inlay hints style in monaco editor

I registered an inlay hint provider which is added in monaco editor 0.26, and I want to make the style of it consistent with other editors. But I can’t change anything other than font size and font family of them. I can add some new CSS rules but class name is machine generated and cryptic […]

Adding inline widget in monaco editor

I am developing an expression editor using the Monaco editor. I want to be able to insert "tokens" for function parameters. Something similar to this UI from Google DataStudio: Google datastudio field editor As in the above example, if the user types in the following expression: LENGTH(CONCAT({Country Code}, {Country Name}, "some text")) Both {Country Code} […]

Angular Monaco Editor: Not showing suggestion icons properly

I am using Monaco Editor as XML editor in my Angular project. It is working properly as expected, but getting some problems with the styling of the suggestion box. Its showing suggestions like this: My Code HTML: <div class="ui-lg-12 ui-md-12 ui-g-12 editor-container" fxLayout="column"> <ngx-monaco-editor [options]="editorOptions" [(ngModel)]="code" (init)="editorInit($event)"> </ngx-monaco-editor> </div> TS: @ViewChild(MonacoEditorComponent, { static: false }) […]

My monaco editor instance fails to update

The issue: I’m attempting to integrate monaco-editor/react into my web application and have successfully loaded it, but encounter an error whenever I change it in my front-end. Everything works as expected until I modify my editor instance in any way (i.e. add text, resize, etc.) The web application I’m using, Grafana, spits out this error […]

Monaco-editor : disable command palette

I’m creating an electron app using monaco-editor but I want to disable the command palette when I press on F1. I tried e.preventDefault or e.stopPropagation but it didn’t work. Thanks Source: CSS – Stack Overflow

Component definition – Missing display name error

I’m trying to build a custom panel option editor in web app called Grafana, but am running into an error I suspect is no more than a React syntax issue. 195:15 error Component definition is missing display name react/display-name To use a custom panel option editor, use the addCustomEditor on the OptionsUIBuilder object in your […]

Sitemap | Terms | Privacy | Cookies | Advertising

Senior Software Developer

Creator of @LzoMedia I am a backend software developer based in London who likes beautiful code and has an adherence to standards & love's open-source.