refactor(lsp): replace FolderConfig with LspFolderConfig using direct map access [IDE-1639]#797
Draft
bastiandoetsch wants to merge 11 commits intomasterfrom
Draft
refactor(lsp): replace FolderConfig with LspFolderConfig using direct map access [IDE-1639]#797bastiandoetsch wants to merge 11 commits intomasterfrom
bastiandoetsch wants to merge 11 commits intomasterfrom
Conversation
…E-1639] Made-with: Cursor
… map access [IDE-1639] Remove custom FolderConfig data class and LspFolderConfigExtensions.kt. Store LspFolderConfig directly in FolderConfigSettings, eliminating conversion boilerplate between FolderConfig and LspFolderConfig. All UI consumers and tests now access settings via the LspFolderConfig settings map using LsFolderSettingsKeys constants. The withSetting extension function is preserved in LanguageServerSettings.kt for immutable config updates.
✅ 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. |
Collaborator
Author
|
/describe |
|
PR Description updated to latest commit (a2b9036) |
Contributor
Code Coverage
|
- Remove unused LanguageServerSettings data class (replaced by the LspConfigurationParam/getSettings() approach with LsSettingsKeys) - Remove unused defaultSettings and trustedFolders variables in getSettings() that were computed but never referenced - Remove unused SnykApplicationSettingsStateService import
Adapt .cursor rules and skills to Claude Code equivalents: - CLAUDE.md: project rules (adapted from .cursor/rules/general.mdc) - .claude/commands/commit.md: commit workflow skill - .claude/commands/create-implementation-plan.md: planning skill - .claude/commands/verification.md: code verification skill - .claude/commands/implementation.md: implementation workflow skill - .gitignore: exclude .claude/settings.local.json (machine-specific)
…errides; remove dead env info settings - Set changed=true for automaticAuthentication and trustEnabled so they are always transmitted as user-overrides to the language server - Set changed=true for token (always a user-override when present) - Remove environment info entries from settings map (integration_name, integration_version, device_id, os_platform, os_arch, runtime_name, runtime_version) — snyk-ls reads these from top-level InitializationOptions fields, not from the settings map
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
Summary
Remove custom
FolderConfigdata class andLspFolderConfigExtensions.kt. StoreLspFolderConfigdirectly inFolderConfigSettings, eliminating conversion boilerplate betweenFolderConfigandLspFolderConfig.All UI consumers and tests now access settings via the
LspFolderConfig.settingsmap usingLsFolderSettingsKeysconstants. ThewithSettingextension function is preserved inLanguageServerSettings.ktfor immutable config updates.Changes
FolderConfigdata class fromTypes.ktLspFolderConfigExtensions.kt(typed extension properties, factory functions)FolderConfigSettingsto store/retrieveLspFolderConfigdirectlySnykLanguageClientandLanguageServerWrapperto skip FolderConfig conversionSnykSettingsDialog,ReferenceChooserDialog,SnykToolWindowPanel,SaveConfigHandler) to use direct map accessTestFolderConfigHelper.ktfor test conveniencePR Type
Enhancement, Bug fix
Description
Replace
FolderConfigwithLspFolderConfigusing map-based settings.Update LSP protocol version to 25.
Refactor settings synchronization with Language Server.
Introduce explicit change tracking for settings.
Diagram Walkthrough
File Walkthrough
2 files
Update LSP protocol version and add explicit change trackingAdd new fields to UI configuration data classes11 files
Adapt project settings to use LspFolderConfig and keysUpdate dialog to use LspFolderConfig and map settings accessUpdate settings dialog to display LspFolderConfig map valuesRefactor save handler to use LspFolderConfig and explicit changetrackingUpdate tool window panel to use LspFolderConfig structureImplement new InitializationOptions and LspConfigurationParamstructureReplace folderConfigs notification with snykConfigurationRemove deprecated FolderConfig and FolderConfigsParam data classesUpdate FolderConfigSettings to manage LspFolderConfigDefine new LSP configuration data classes (LspFolderConfig,ConfigSetting)Define constants for LSP settings keys8 files
Add test for updated LSP protocol versionUpdate tests for LspFolderConfig and map-based settingsUpdate tests for LspFolderConfig and map-based settingsUpdate tests for LspFolderConfig usageUpdate tests for InitializationOptions and LspConfigurationParamUpdate tests for snykConfiguration and LspConfigurationParamUpdate tests for LspFolderConfig and map-based settings managementAdd helper to create LspFolderConfig instances2 files