summaryrefslogtreecommitdiffstats
path: root/web_src/js/features/codeeditor.js
diff options
context:
space:
mode:
authorXinyu Zhou <i@sourcehut.net>2022-11-09 18:02:19 +0800
committerGitHub <noreply@github.com>2022-11-09 18:02:19 +0800
commitdd7f1c0334dff5fb5eb93765dff3b951a9f6b3fc (patch)
tree7e44eb736c9de3089445a292b9fa17dc07180d8b /web_src/js/features/codeeditor.js
parent7e40ceee9e90bd2cab0339f4301c476040d7121b (diff)
downloadgitea-dd7f1c0334dff5fb5eb93765dff3b951a9f6b3fc.tar.gz
gitea-dd7f1c0334dff5fb5eb93765dff3b951a9f6b3fc.zip
Quick fixes monaco-editor error: "vs.editor.nullLanguage" (#21734)
fixes: https://github.com/go-gitea/gitea/issues/21733 Uncaught Error: Language id "vs.editor.nullLanguage" is not configured nor known Note that this monaco-editor worked fine on 0.33.0 and broke on 0.34.0. If upstream fixed, remove this code. Signed-off-by: Xinyu Zhou <i@sourcehut.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'web_src/js/features/codeeditor.js')
-rw-r--r--web_src/js/features/codeeditor.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/web_src/js/features/codeeditor.js b/web_src/js/features/codeeditor.js
index 0366afc2c0..23a26ba2b0 100644
--- a/web_src/js/features/codeeditor.js
+++ b/web_src/js/features/codeeditor.js
@@ -99,6 +99,10 @@ export async function createMonaco(textarea, filename, editorOpts) {
}
});
+ // Quick fix: https://github.com/microsoft/monaco-editor/issues/2962
+ monaco.languages.register({id: 'vs.editor.nullLanguage'});
+ monaco.languages.setLanguageConfiguration('vs.editor.nullLanguage', {});
+
const editor = monaco.editor.create(container, {
value: textarea.value,
theme: 'gitea',