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:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This is the method we use in VSCode – https://github.com/Microsoft/vscode/blob/d6c200ea57fc3104af1c237dfd16ff0d83c3ad2a/src/vs/editor/common/model/textModel.ts#L48
@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.