Microsoft/monaco-editor
Auf GitHub ansehenJavaScript folding ranges are not semantic
Open
#1.847 geöffnet am 24. Feb. 2020
feature-requesthelp wantedopen for PRtypescript
Repository-Metriken
- Stars
- (14.836 Stars)
- PR-Merge-Metriken
- (Durchschn. Merge 6h 26m) (15 gemergte PRs in 30 T)
Beschreibung
monaco-editor version: 0.20.0 Browser: Chrome OS: Windows Playground code that reproduces the issue:: https://microsoft.github.io/monaco-editor/playground.html#creating-the-editor-hello-world
Playground code
monaco.editor.create(document.getElementById("container"), {
value: "function double(x) {\nreturn 2*x\n}\n\nfunction double2(x) {\n\treturn 2*x;\n}",
language: "javascript",
showFoldingControls: "always",
});

I realized that the folding icon is hidden when all the lines of a Javascript function have no indentation. Using the same code but with tabs/spaces, the folding icon is shown.
In Visual Studio Code for Web Playground, I am also able to repro this issue.