0

How can I disable auto closing of specific brackets? I have a java mode active and Monaco is auto closing '<' to '<>'

tomitrescak
  • 903
  • 10
  • 21

2 Answers2

0

You can use the editor option autoClosingBrackets

/**
 * Enable auto closing brackets.
 * Defaults to true.
 */
autoClosingBrackets?: boolean;

You can use this option in the creation options or later:

// When creating the editor
var editor = monaco.editor.create(container, { autoClosingBrackets: false });

// -----------------------
// Changing the option at a later time
var editor = monaco.editor.create(container);
// ...
editor.updateOptions({ autoClosingBrackets: false });
Alex Dima
  • 17,553
  • 1
  • 12
  • 13
  • Thanks for your answer., yet, this disables ALL auto-close brackets unfortunately. I have found bug in the language definition of JAVA where ' – tomitrescak Mar 01 '17 at 21:40
0

The problem was in the language definition of JAVA, where < was set to autoclose. I had to remove that definition and all was working ok.

tomitrescak
  • 903
  • 10
  • 21