microsoft / monaco-editor

A browser based code editor
https://microsoft.github.io/monaco-editor/
MIT License
40.51k stars 3.6k forks source link

Add flag to Disable Worker #380

Open meriturva opened 7 years ago

meriturva commented 7 years ago

monaco-editor npm version: 0.8.1 Browser: Chrome OS: Windows 10

We use monaco editor has viewer of big files and it works like a charm! I just would like to know if it is possible to disable web worker in that case (readonly = true). I think it is unused when editor is just a text viewer.

So thanks.

alexdima commented 7 years ago

The editor, depending on the language for the model, can end up spawning one or two web workers. For any file (including plain/text), the web worker is dynamically created when:

I agree, we should have an option for turning link detection off, in which case, for a read only editor that shows a plaintext file there will be no web worker spawned.

We end up spawning two web workers when using a rich language e.g. javascript/typescript/html/etc. where extra rich computation needs to be done when e.g. hovering. That is computed on a language specific web worker.

FrankFang commented 6 years ago

Any plan for this flag?

TomasHubelbauer commented 5 years ago

Have there been any changes on the availability of this flag by chance?

loufushuai commented 3 years ago

T_T,i need this feature

marcellobarile commented 2 years ago

web workers are causing troubles while testing monaco editor with cypress. +1 for the flag to disable those.

lipengzhou commented 1 year ago

+1