refactor(lsp): replace FolderConfig with LspFolderConfig using direct map access [IDE-1639]#797
Draft
bastiandoetsch wants to merge 15 commits intomasterfrom
Draft
refactor(lsp): replace FolderConfig with LspFolderConfig using direct map access [IDE-1639]#797bastiandoetsch wants to merge 15 commits intomasterfrom
bastiandoetsch wants to merge 15 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
Force jackson-bom 2.19.0 to override transitive 2.17.0 from IntelliJ test-framework, fixing directory traversal vulnerability SNYK-JAVA-COMFASTERXMLJACKSONCORE-12238608 (CWE-22, CVSS 9.2) in jackson-core.
Collaborator
Author
|
/describe |
|
PR Description updated to latest commit (ed6e599) |
…DE-1639] - Move product enablement, filters, scan behaviour settings from LsSettingsKeys to LsFolderSettingsKeys (folder-scoped) - Add new machine-scope keys: CLI_RELEASE_CHANNEL, FORMAT, HOVER_VERBOSITY, CLIENT_PROTOCOL_VERSION, TRUSTED_FOLDERS - Add new folder-scope keys: CWE_IDS, CVE_IDS, RULE_IDS, REFERENCE_BRANCH, CLI_ADDITIONAL_OSS_PARAMETERS, SAST_SETTINGS - Update LanguageServerWrapper.getSettings() to properly categorize machine-scope vs folder-scope settings - Refactor SnykLanguageClient to process folder-scope settings from folderConfigs instead of top-level settings map - Call updateConfiguration() after saving config in SaveConfigHandler - Enable new HTML config dialog by default (snyk.useNewConfigDialog) - Add test for updateConfiguration() call after config save
Collaborator
Author
|
/describe |
|
PR Description updated to latest commit (83fd25c) |
…[IDE-1639] Add folderExplicitChanges map to SnykApplicationSettingsStateService to track which folder-scoped settings were explicitly changed by the user. This ensures the changed/UserOverride status survives IDE restarts. Changes: - Add overloaded markExplicitlyChanged(folderPath, key) and isExplicitlyChanged(folderPath, key) following the same pattern as global explicit changes - Wire SaveConfigHandler.applyFolderConfigs to call markExplicitlyChanged only when the new value differs from the existing setting (value comparison prevents marking unchanged fields) - Add applyPersistedFolderChangedFlags in LanguageServerWrapper to enrich folder configs with persisted changed flags when building settings for the Language Server - Add unit test for folder-level explicit change tracking with cross-folder isolation
Collaborator
Author
|
/describe |
|
PR Description updated to latest commit (336bbfe) |
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
Description
Refactor LSP configuration to use a new model.
Introduce explicit change tracking for settings.
Update UI components to use LspFolderConfig.
Enhance folder-specific settings management.
Diagram Walkthrough
flowchart LR subgraph IDE subgraph Settings SnykApplicationSettingsStateService -->|Updates| LsSettingsKeys SnykApplicationSettingsStateService -->|Updates| LsFolderSettingsKeys SnykProjectSettingsConfigurable -->|Uses| withSetting SnykSettingsDialog -->|Uses| LspFolderConfig ReferenceChooserDialog -->|Uses| LspFolderConfig SaveConfigHandler -->|Uses| markExplicitlyChanged SaveConfigHandler -->|Uses| updateConfiguration SnykToolWindowPanel -->|Uses| LspFolderConfig end subgraph UI ConfigurationDataClasses -->|New fields| LspFolderConfig SaveConfigHandler -->|Processes| SaveConfigRequest end subgraph LSP LanguageServerWrapper -->|Sends| InitializationOptions LanguageServerWrapper -->|Handles| LspConfigurationParam SnykLanguageClient -->|Receives| LspConfigurationParam SnykLanguageClient -->|Updates| SnykApplicationSettingsStateService SnykLanguageClient -->|Updates| FolderConfigSettings end subgraph Data Models LsSettingsKeys <-->|Defines keys for| ConfigSetting LsFolderSettingsKeys <-->|Defines keys for| ConfigSetting LspFolderConfig <-->|Wraps| ConfigSetting LspConfigurationParam <-->|Contains| LspFolderConfig InitializationOptions <-->|Contains| LspConfigurationParam end endFile Walkthrough
1 files
Add jackson-bom dependency3 files
Add explicit change tracking and update LSP protocol versionAdd new fields to FolderConfigData for granular settingsIntroduce LsSettingsKeys and LsFolderSettingsKeys constants10 files
Refactor applyFolderConfigChanges to use withSettingUpdate to use LspFolderConfig and settings mapUpdate UI to use LspFolderConfig and settings mapImplement explicit change tracking and update configuration flowUpdate to use LspFolderConfigReplace LanguageServerSettings with LspConfigurationParam andInitializationOptionsHandle $/snyk.configuration notification and update settingsRemove deprecated FolderConfig and related typesUpdate FolderConfigSettings to use LspFolderConfig and settings mapRemove obsolete LanguageServerSettings class9 files
Add test for requiredLsProtocolVersionUpdate tests for new settings model and change trackingUpdate tests for LspFolderConfig and settings map accessUpdate tests for LspFolderConfig and settings map accessAdd test for LanguageServerWrapper updateConfiguration callUpdate tests for new configuration data models and keysUpdate tests for snykConfiguration notification and settings updatesUpdate tests for LspFolderConfig and settings map accessAdd helper function for creating LspFolderConfig instances4 files
Update commit workflow rules for new configuration changesUpdate plan creation for new configuration structureUpdate implementation workflow for new configurationUpdate project rules for new configuration model1 files
Enable new config dialog by default4 files