-
-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Description
Describe the issue
In a multi-root workspace, folder-level explicitFolding.rules from .vscode/settings.json can be ignored during language-scoped rule resolution.
When this happens, debug output shows fallback regex /a^/ and no foldings are produced, even though workspaceFolderValue contains valid rules.
To reproduce
- VSCode: Cursor (VS Code-compatible; reproduced on current installation)
- Explicit Folding: 0.24.3
- Language: FortranFreeForm
- Language Provider: Modern Fortran (
fortran-lang.linter-gfortran)
Code Example
SUBROUTINE explicit_fold_probe()
{{{ marker
IF ( .TRUE. ) THEN
PRINT *, "inside"
ENDIF
}}} marker
END SUBROUTINE explicit_fold_probeSettings
{
"editor.foldingStrategy": "auto",
"editor.defaultFoldingRangeProvider": "zokugun.explicit-folding",
"explicitFolding.debug": true,
"explicitFolding.rules": [
{
"begin": "{{{",
"end": "}}}"
}
]
}Repro context:
- Multi-root workspace with folders:
/home/alpha/palm_development/home/alpha/modeling/source2/Poisson
- Settings file:
/home/alpha/palm_development/.vscode/settings.json
- Test file:
/home/alpha/palm_development/explicit_folding_synthetic.f90
Expected behavior
Configured rules should be applied and produce fold ranges in FortranFreeForm files.
Debug output should show a compiled regex from configured rules (not /a^/).
Screenshots
N/A (using debug output logs)
Observed output:
[document] lang: FortranFreeForm, fileName: explicit_folding_synthetic.f90
[main] regex: /a^/
[document] foldings: []
Additional context
Runtime inspection indicated:
config.inspect('rules')had non-emptyworkspaceFolderValue- language rule resolution still returned an empty rules array
- provider was built with
ruleCount: 0
A local fix that resolves configuration with URI-scoped lookups in multi-root context fixes the issue:
workspace.getConfiguration(CONFIG_KEY, referenceUri)workspace.getConfiguration(CONFIG_KEY, { languageId, uri: referenceUri })
After this change, debug output shows compiled regex and foldings as expected.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels