fix: pass trusted folders through didChangeConfiguration [IDE-1893]#1189
Conversation
The IDE-1786 refactoring moved TrustedFolders into InitializationOptions as init-only metadata, but on main it was updatable at runtime via writeSettings/updateTrustedFolders. This caused trusted folder changes sent via workspace/didChangeConfiguration to be silently dropped. Add TrustedFolders field to LspConfigurationParam (matching InitializationOptions) and wire it through handlePushModel and handlePullModel to applyTrustedFolders. Also add js-tests/fixtures/*.html to .gitignore as generated test artifacts.
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
This comment has been minimized.
This comment has been minimized.
…DE-1786-trusted-folders-in-didChangeConfiguration Fix trustedFolders nil vs empty: use \!= nil check instead of len > 0 so that an empty TrustedFolders slice (clear all) is handled correctly.
PR Reviewer Guide 🔍
|
| defer logger.Info().Str("method", "WorkspaceDidChangeConfiguration").Msg("DONE") | ||
|
|
||
| if len(params.Settings.Settings) > 0 || len(params.Settings.FolderConfigs) > 0 { | ||
| if len(params.Settings.Settings) > 0 || len(params.Settings.FolderConfigs) > 0 || params.Settings.TrustedFolders != nil { |
There was a problem hiding this comment.
it's a string slice, check for len
Description
The IDE-1786 refactoring moved
TrustedFoldersintoInitializationOptionsas init-only metadata, but onmainit was updatable at runtime viawriteSettings/updateTrustedFolders. This caused trusted folder changes sent viaworkspace/didChangeConfigurationto be silently dropped.Changes:
TrustedFolders []stringfield toLspConfigurationParam(matching the field onInitializationOptions)handlePushModelandhandlePullModelto callapplyTrustedFolderswith the new fieldTrustedFoldersdidChangeConfigurationpush modeljs-tests/fixtures/*.htmlto.gitignore(generated test artifacts)Checklist
make generate)make lint-fix)