# Monaco editor obscures code

**URL:** <https://discourse.nodered.org/t/monaco-editor-obscures-code/76660>\
**Category:** General\
**Created:** [17 March 2023 10:45 UTC](https://discourse.nodered.org/t/monaco-editor-obscures-code/76660 "2023-03-17T10:45:46Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [17 March 2023 10:45 UTC](https://discourse.nodered.org/t/monaco-editor-obscures-code/76660/1 "2023-03-17T10:45:47Z")

</div>

Is it my imagination or has the monaco editor become more eager than ever to cover up the code I'm trying to edit?

 ![Untitled 1](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/b/bb28e39a84e23a49133eaa6a26359f5d2fe35842.jpeg)

I quite like the simple explanation "Cannot find name 'flo' " in the smaller popover, but what is valuable enough about "any" or "Did you mean 'flow'? (2552) to be worth sticking over the top of the editor?

As for the larger popover - a list of everything the editor knows which starts with F ? And all that empty grey space! It keeps on changing the popover contents with each letter I type too. Perhaps it would be slightly less infuriating if it didnt dispay any of this junk until say 2 seconds inactivity.

Is there any way to control this popover behaviour?

---

<div class="post-metadata">

**Author:** ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)\
**Post date:** [17 March 2023 11:29 UTC](https://discourse.nodered.org/t/monaco-editor-obscures-code/76660/2 "2023-03-17T11:29:12Z")

</div>

Try in your `settings.js` file .. under monaco options

```auto
quickSuggestionsDelay: 2000, // ms

```

* * *

[https://microsoft.github.io/monaco-editor/docs.html#interfaces/editor.IStandaloneEditorConstructionOptions.html#quickSuggestionsDelay](https://microsoft.github.io/monaco-editor/docs.html#interfaces/editor.IStandaloneEditorConstructionOptions.html#quickSuggestionsDelay)

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [17 March 2023 11:29 UTC](https://discourse.nodered.org/t/monaco-editor-obscures-code/76660/3 "2023-03-17T11:29:43Z")

</div>

> [@jbudd](#):
>
> Is there any way to control this popover behaviour

Yes. Lots of tweaks possible. All in your settings.js follow the link.

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [17 March 2023 11:59 UTC](https://discourse.nodered.org/t/monaco-editor-obscures-code/76660/4 "2023-03-17T11:59:15Z")

</div>

Hmm. It makes a difference but I think it's actually less usable.  
Take this function code.

```auto
let tablist = flow.get("tablist")
for (let i in msg.payload) {
    let newmsg = {}
    if (msg.payload[i].type == "junction") {
        newmsg.payload = {"id": msg.payload[i].id, "Tab": tablist[msg.payload[i].z]}
        if (msg.payload[i].wires[0].length == 0) {
            node.send([null, newmsg])
        }
        else {
            node.send([newmsg, null])
        }
    }
}
return (tablist)

```

I want to change all incidences of variable i to foo  
I change the first instance then move the cursor down two lines to the first `[i]`. Just as I'm about to mouse click, this pops up

 ![Untitled 4](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/1/011a219fdf283e6409f0788352f9811a329d506f.jpeg)  
And now I'm trapped. Cant use the arrow keys because they just move up and down the popup. Can't click to go to my chosen location because that replaces some of my code with an insane function prototype.  
 ![Untitled 5](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/b/2bd38f0e6df4970289a1cd4cf5654064d5b974f6.jpeg)

Monaco is supposed to be a good editor, but my conclusion is that [in the default configuration for Node-red] it's totally out of control.

I'm going back to the old editor.

---

<div class="post-metadata">

**Author:** ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)\
**Post date:** [17 March 2023 12:10 UTC](https://discourse.nodered.org/t/monaco-editor-obscures-code/76660/5 "2023-03-17T12:10:50Z")

</div>

what about increasing the delay even higher .. more than 2 sec  
or disable the suggestions ?

```javascript
snippetSuggestions : "none",

```

ps. actually im gonna keep this setting also .. cause yea those suggestion can be a bit annoying 😉

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [17 March 2023 12:13 UTC](https://discourse.nodered.org/t/monaco-editor-obscures-code/76660/6 "2023-03-17T12:13:38Z")

</div>

> [@jbudd](#):
>
> And now I'm trapped

Click escape.

I suspect you can stop it popping up in the first place, but I haven't studied the link in settings yet.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [17 March 2023 13:23 UTC](https://discourse.nodered.org/t/monaco-editor-obscures-code/76660/7 "2023-03-17T13:23:57Z")

</div>

> [@jbudd](#):
>
> I'm going back to the old editor

Terrible Idea. Do you know the function signature of context.get? parseInt? Etc etc.

Yes, the suggestions can be annoying if you look at them when you don't need to.

My advice is to stop fighting it. Finish your line of text and the suggestions will disappear. However, if you get stuck you can look at the suggestions.

Additionally, anytime you want suggestions to disappear, hit escape.

I find code completion and parameter tips far more valuable than debugging something because I missed a parameter or use the wrong type.

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [17 March 2023 13:42 UTC](https://discourse.nodered.org/t/monaco-editor-obscures-code/76660/8 "2023-03-17T13:42:05Z")

</div>

Warning - may contain gratuitous references to early MS Word features

I know that Monaco brings some benefits Steve and sometimes the info it volunteers might be useful but surely not at the expense of me seeing what I am typing, in the context of the code around it.

Perhaps there is some way to shift the location of the popover?  
From

 ![Untitled 1](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/d/ed11925e9016a6f7d5f8fdbc321bbd4b560a253b.jpeg)

to this?

 ![Untitled 2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/8/78fd05f418b15885c0b4e90c55d9a9b39a3a9478.jpeg)

> [@Steve-Mcl](#):
>
> Additionally, anytime you want suggestions to disappear, hit escape.

Yup the escape key is valuable when using a sensible code editor - vi, but even in that famously obscure editor you don't have to keep hitting it _while in insert mode_

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [17 March 2023 14:09 UTC](https://discourse.nodered.org/t/monaco-editor-obscures-code/76660/9 "2023-03-17T14:09:05Z")

</div>

I agree that it would be nice if it popped up but did not cover the cursor area.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [16 May 2023 14:10 UTC](https://discourse.nodered.org/t/monaco-editor-obscures-code/76660/10 "2023-05-16T14:10:02Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
