Microsoft/monaco-editor

JavaScript folding ranges are not semantic

Open

#1847 aperta il 24 feb 2020

Vedi su GitHub
 (1 commento) (0 reazioni) (0 assegnatari)JavaScript (1283 fork)batch import
feature-requesthelp wantedopen for PRtypescript

Metriche repository

Star
 (14.836 star)
Metriche merge PR
 (Merge medio 6h 26m) (15 PR mergiate in 30 g)

Descrizione

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",	
});

image

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.

Guida contributor