Questions tagged [monaco-editor]

Monaco Editor is the JavaScript based text editing portion of VSCode extracted out into standalone library.

The Monaco Editor is the JavaScript based text editing portion of VSCode extracted out into standalone library. It provides an extensive plugin architecture as well as an extensible intellisense like system.

622 questions
28
votes
3 answers

Get the value of Monaco Editor

Microsoft recently open sourced their monaco editor (similar to ace/codemirror). https://github.com/Microsoft/monaco-editor I've got it up and running in the browser, but still can't figure out how to get the current text of the editor, like if I…
Kyle Gobel
  • 4,870
  • 7
  • 38
  • 63
21
votes
2 answers

Syntax validation of a custom language in Monaco editor

I'm trying to integrate a custom language to monaco editor and I went through https://microsoft.github.io/monaco-editor/monarch.html to get an idea on syntax highlighting. But I couldn't find any doc on how we can add error/warning validations…
user2894296
  • 530
  • 6
  • 20
20
votes
4 answers

Monaco editor dynamically resizable

I have been searching for a discussion about if it's possible to mimic the html tag textarea's resizing when using Monaco Editor's field all over the Internet but I couldn't find one answering my question. I'm using the monaco-editor npm package in…
elenaHristova
  • 381
  • 1
  • 5
  • 16
17
votes
1 answer

Monaco Editor - How to make some areas readonly

I'm trying to configure the Monaco Editor in a way that certain regions of the textcontent are readonly. More precise, I want the first and last line to be readonly. Example below: public something(someArgument) { // This is readonly // This is…
custi
  • 483
  • 1
  • 4
  • 10
15
votes
3 answers

Adding JavaScript type hints for VSCode/Monaco Intellisence

Is there a way to hint to VSCode/Monaco's intellisense the types of variables. I have some code like this var loc = window.location; var gl = context1.getContext("webgl"); var ctx = context2.getContext("2d"); I see that VSCode knows that loc is a…
gman
  • 83,286
  • 25
  • 191
  • 301
14
votes
3 answers

How to use addExtraLib in Monaco with an external type definition

I can see how to use addExtraLib in Monaco to add an ambient declaration file. What's not clear is how to use this function with an external declaration file so that Typescript code in the editor can do a: import * as External from "external"…
Joe Wood
  • 1,135
  • 1
  • 12
  • 24
14
votes
3 answers

How do I insert text into a Monaco Editor?

I have a monaco code editor embedded in my app. How do I programmatically insert text on a particular line? var editor = monaco.editor.create(document.getElementById("container"), { value: "// First line\nfunction hello() {\n\talert('Hello…
Doug
  • 10,752
  • 11
  • 57
  • 97
13
votes
3 answers

Monaco Editor intellisense from multiple files

I am using monaco-editor and I would like to include suggestions from multiple files. I am not sure what is the best way to do it but basically, I want that when I am exporting some functions in a file2.js, to be able to access that from another…
Bastien L.
  • 69
  • 1
  • 7
13
votes
1 answer

monaco editor matchBrackets do not highlight

I'm defining new language in monaco-editor. I expect that it automatically highlight matching brackets and parentheses because by default matchBrackets option is true. Should I do anything else? Sample Code: Look at this page it doesn't work in…
Iman Mahmoudinasab
  • 6,251
  • 3
  • 37
  • 63
12
votes
1 answer

Always show the "Show more" section in monaco-editor

I'm working with the Configure javascript defaults example from the monaco editor playground. https://microsoft.github.io/monaco-editor/playground.html#extending-language-services-configure-javascript-defaults When I start typing the pre-defined…
Thatkookooguy
  • 5,356
  • 1
  • 24
  • 47
12
votes
4 answers

Monaco Editor 'onChange' event?

I've just started investigating Monaco to be used as the editor for our internal code playground. And I'm unable to figure out how to create a handler for whenever the text in the editor window is changed, either by typing, pasting, or deleting. …
elora
  • 291
  • 1
  • 2
  • 11
11
votes
3 answers

monaco-editor: hide overview ruler

Is there a way to completely hide overview ruler in monaco-editor? It is still visible with the following: overviewRulerLanes: 0, hideCursorInOverviewRuler: true, scrollbar: { vertical: 'hidden' }, …
eprst
  • 633
  • 4
  • 12
11
votes
1 answer

Scroll to line in Monaco editor

I see there is a way to set scrolltop in monaco editor. How would one scroll to a specific line instead of a specific pixel?
Johnston
  • 18,560
  • 12
  • 64
  • 107
10
votes
0 answers

Is there an example project for monaco-editor with omnisharp on a webpage

In my project, I use C# Roslyn scripts for some automation that can my customer write alone. I compile and run this on runtime. Now I would like to have a web editor for c# with intellisense and spell check. For code completion, I would like also to…
Chape Hans
  • 101
  • 4
10
votes
1 answer

Monaco Editor registerCompletionItemProvider removes the default local variable completion

In Monaco Editor, using the standard initialization such as: monaco.editor.create(document.getElementById("container"), { value: "", language: "csharp" }); Will have an out-of-the-box local variables code completion. For example, using the…
Aldy J
  • 131
  • 8
1
2 3
41 42