question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to open files in monaco-editor ? Specially large files just like VS code does.

See original GitHub issue

“monaco-editor”: “^0.15.6”, “monaco-editor-webpack-plugin”: “^1.7.0”, “OS”: windows and mac I am using electron .

I am trying to display a file content in a monaco editor. All the examples I have seen so far has hard coded values . In all examples, ‘model’ is created with hard coded ‘value’ .like following example.

monaco.editor.create(document.getElementById("container"), {
	theme: 'vs',
	value: 'hard coded value that is to be display in editor'
});

So I read a file first and saved the file content into string variable. And then assigned to value attribute. This is working fine in case of small files. But I have files with size > 100MB. In those cases , it is not working properly.

Is there a way to solve this ? How VS code open large files in a just a second with the help of monaco editor ?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

0reactions
rcjsuencommented, Dec 16, 2019

@Ricardo-Paul You need to have a web server that is serving the files to your browser.

Perhaps you may be interested in Gitpod and other such projects.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to open files in monaco-editor ? Specially large ... - GitHub
I am trying to display a file content in a monaco editor. ... to open files in monaco-editor ? Specially large files just...
Read more >
Basic Editing in Visual Studio Code
VS Code allows you to quickly find text and replace in the currently opened file. Press Ctrl+F to open the Find Widget in...
Read more >
Use the Visual Studio Code editor in your own projects
Monaco Editor is packaged from Visual Studio Code repositories and can be installed via npm at the command line. This brings down three...
Read more >
Monaco Editor
getElementById('conway-canvas'); if(canvas == null) { canvas = document. ... This library is supported for use in Windows Tailored Apps only.
Read more >
Get the value of Monaco Editor - Stack Overflow
So as long as you keep a reference to the editor or model you can query the contents: ... function() { var editor...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found