vscode-explicit-folding icon indicating copy to clipboard operation
vscode-explicit-folding copied to clipboard

Folding resets after restarting VS Code

Open Kycko opened this issue 1 year ago • 5 comments

Describe the issue

VS Code resets all the folding when I close it and open again. I've found the problem in your extention, see https://github.com/microsoft/vscode/issues/189610.

To reproduce

Fold some functions in .gs file (Google Apps Script, language mode JavaScript), close and then open again VS Code. You will see all the functions unfolded.

  • VSCode: 1.85.2
  • Explicit Folding: 0.23.1
  • Language: Google Apps Script (basically JavaScript)
  • Language Provider: built-in?

Code Example

function SH_get_full_range(sheet) {
    return sheet.getRange(1, 1, sheet.getMaxRows(), sheet.getMaxColumns());
}

Settings

"explicitFolding.rules": {
        "javascript": [
            {
                "begin": "{",
                "end"  : "}"
            },
            {
                "begin": "`",
                "end"  : "`"
            },
            {"foldLastLine": true}
        ],
        "snippets": [
            {
                "begin": "{",
                "end"  : "}"
            },
            {
                "begin": "`",
                "end"  : "`"
            },
            {"foldLastLine": true}
        ]
    }

Expected behavior

Save the folding state after VS Code restarts.

Screenshots

image image

Kycko avatar Jan 19 '24 11:01 Kycko