0
如何禁用特定括號的自動關閉? 我有一個java模式激活和摩納哥是自動關閉「<」到「<>」禁用摩納哥編輯器中的括號自動關閉
如何禁用特定括號的自動關閉? 我有一個java模式激活和摩納哥是自動關閉「<」到「<>」禁用摩納哥編輯器中的括號自動關閉
您可以使用編輯器選項autoClosingBrackets
/**
* Enable auto closing brackets.
* Defaults to true.
*/
autoClosingBrackets?: boolean;
您可以使用在創建選項或更高版本此選項:
// 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 });
的問題是在JAVA,其中<被設置爲自動關閉的語言定義。我不得不刪除該定義,並且一切正常。
感謝您的回答,但不幸的是,這會禁用所有自動關閉括號。我在JAVA的語言定義中發現了錯誤,其中'<'被設置爲自動關閉括號。我刪除它,一切都很好。 – tomitrescak