You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,5 +4,5 @@ Please see https://github.com/snyk/vscode-extension/releases for a detailed chan
4
4
5
5
## Unreleased
6
6
7
-
-Synthesize per-folder org rows from workspace folders for outbound LSP config when LS has not yet sent `$/snyk.folderConfigs`, so `workspace/didChangeConfiguration` includes non-empty `folderConfigs` after workspace settings changes.
7
+
-Outbound LSP `folderConfigs` use `configuration.getFolderConfigs()` when non-empty; otherwise synthesize per-folder rows from workspace folders when the workspace has folders. Remove the `ReceivedFolderConfigsFromLs` gate, `$/snyk.folderConfigs` notification registration, and `SNYK_FOLDERCONFIG` constant.
8
8
- When `snyk.advanced.cliReleaseChannel` changes, stop the language server and re-run CLI download only if automatic dependency management is enabled (manual CLI installs are unaffected).
Copy file name to clipboardExpand all lines: docs/configuration-gaf-ls-ide-flow.md
+11-12Lines changed: 11 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,11 @@
1
1
# Configuration: GAF → snyk-ls → IDE
2
2
3
-
High-level flow for how settings are stored in GAF, resolved in **snyk-ls**, pushed to IDEs, and how **merges** relate to the **VS Code** extension (`mergeInboundLspConfiguration`, IDE-1638).
3
+
High-level flow for how settings are stored in GAF, resolved in **snyk-ls**, pushed to IDEs, and how **merges** relate to the **VS Code** extension (`mergeInboundLspConfiguration`, IDE-1638). The language server delivers effective config (including per-folder rows) on **`$/snyk.configuration`** as **`LspConfigurationParam`**; the VS Code client does **not** subscribe to the legacy **`$/snyk.folderConfigs`** notification.
4
4
5
5
## Diagram
6
6
7
7
```mermaid
8
+
%% snyk-ls → IDE: $/snyk.configuration only; folder rows in param.folderConfigs (no separate $/snyk.folderConfigs).
|**1**|**snyk-ls / GAF / `ConfigResolver`**| Prefix layers (`user:global`, `user:folder`, `remote:*`, defaults) → **authoritative** effective value per setting, folder, and org. This is the real precedence chain (see snyk-ls `docs/configuration.md` when present). |
|**3**|**IDE (VS Code) — `mergeInboundLspConfiguration`**|**Presentation merge only**: spreads global map into each folder’s effective map so the UI can read one object per folder. Does **not** replace LS resolution; must use **same flag keys** as LS (pflag names). |
62
-
|**—**|**`$/snyk.folderConfigs` vs `$/snyk.configuration`**| Not the same merge: **folderConfigs notification** carries folder/org **metadata** and related fields; **configuration notification** carries the **map-based effective config** (protocol v25+). Both can land in the IDE; keep contracts separate. |
59
+
|**3**|**IDE (VS Code) — `mergeInboundLspConfiguration`**|**Not a second `ConfigResolver`**: shallow **`global ∪ folder`** overlay of one inbound payload into **`MergedLspConfigurationView`** for webview and persistence mappers. Does **not** re-run GAF precedence or override LS authority; pflag keys match LS. |
60
+
|**4**|**VS Code — outbound `folderConfigs` (init + `workspace/didChangeConfiguration`)**|**`LanguageServerSettings.resolveFolderConfigsForServerSettings`**: use **`IConfiguration.getFolderConfigs()`** when non-empty; if empty and the workspace has folders, **`synthesizeFolderConfigsFromWorkspace`**. Feeds **`LanguageServerSettings.fromConfiguration`** → **`serverSettingsToLspConfigurationParam`**. |
61
+
|**—**|**`$/snyk.configuration` (inbound)**| Carries **`LspConfigurationParam`**: global **`settings`** plus optional **`folderConfigs[]`** (per-folder paths and **`settings`** maps). VS Code merges with **`mergeInboundLspConfiguration`** for **UI + persistence** (see **#3**). **VS Code does not register** the legacy **`$/snyk.folderConfigs`** notification. |
63
62
64
63
## Round trip
65
64
66
-
-**LS → IDE:**`$/snyk.configuration` pushes effective state (and locks)for UI.
65
+
-**LS → IDE:**`$/snyk.configuration` pushes effective state (and locks); **`mergeInboundLspConfiguration`** shapes it for **UI and persistence** (still **not** authoritative vs merge #1).
67
66
-**LS → `settings.json` (VS Code, optional):**`ConfigurationPersistenceService.persistInboundLspConfiguration` maps the global snapshot into VS Code settings. For pflags the user has explicitly marked (`ExplicitLspConfigurationChangeTracker`, global memento) whose LS value **differs** from the current IDE value, the inbound value is **not** applied; **`LanguageServer.reconcileLanguageServerWithCurrentConfiguration`** then sends structured `workspace/didChangeConfiguration` so the language server matches the IDE.
68
67
-**IDE → LS:**`workspace/didChangeConfiguration` with **`LspConfigurationParam`-shaped** payload; only **changed** keys, `value: null` to clear override (per protocol).
69
68
@@ -75,9 +74,9 @@ The VS Code **`LanguageClient`** option **`synchronize.configurationSection`** (
75
74
76
75
Therefore the extension **does not** set **`configurationSection`** for Snyk. Outbound config updates must be sent with an **explicit**`workspace/didChangeConfiguration` (or equivalent) carrying **`{ settings: <LspConfigurationParam> }`** per the requirements below. Initialization and **`workspace/configuration`** middleware continue to supply **flat**`ServerSettings` where the protocol expects the legacy/IDE shape (e.g. pull / init).
77
76
78
-
After the language client starts, **`LanguageServer`** registers **`workspace.onDidChangeConfiguration`**, reacts only when **`affectsConfiguration('snyk')`**, debounces (same interval as other LS debounces), builds **`LspConfigurationParam`** via **`LanguageServerSettings.fromConfiguration`** + **`serverSettingsToLspConfigurationParam`**, and calls **`sendNotification('workspace/didChangeConfiguration', { settings })`**. While **`foldersBeingUpdatedByLS`** is non-empty (LS applying org from **`$/snyk.folderConfigs`**), outbound pushes are skipped to avoid feedback loops.
77
+
After the language client starts, **`LanguageServer`** registers **`workspace.onDidChangeConfiguration`**, reacts when **`affectsConfiguration('snyk')`** or **`affectsConfiguration('http')`** (proxy/TLS), debounces (same interval as other LS debounces), builds **`LspConfigurationParam`** via **`LanguageServerSettings.fromConfiguration`**(which resolves **`folderConfigs`** per **#4** above) + **`serverSettingsToLspConfigurationParam`**, and calls **`sendNotification('workspace/didChangeConfiguration', { settings })`**. While **`foldersBeingUpdatedByLS`** is non-empty (IDE is applying LS-driven org updates to folder settings from inbound configuration), outbound pushes are skipped to avoid feedback loops.
79
78
80
-
On startup, after **`client.start()`** and **`registerStructuredConfigurationChangeListener`**, the extension sends **one** structured **`workspace/didChangeConfiguration`** from **`client.onReady`** (deferred with **`setImmediate`** so workspace folders are registered with the server first), then **cancels** the pending debounced handler so a duplicate send from startup config churn is avoided. When the first **`$/snyk.folderConfigs`**batch is processed, **`folderConfigs`** become eligible in**`LanguageServerSettings`**— the extension sends **one**more outbound push so the payload includes per-folder settings (aligned with IntelliJ `addContentRoots` → `updateConfiguration`).
79
+
On startup, after **`client.start()`** and **`registerStructuredConfigurationChangeListener`**, the extension sends **one** structured **`workspace/didChangeConfiguration`** from **`client.onReady`** (deferred with **`setImmediate`** so workspace folders are registered with the server first), then **cancels** the pending debounced handler so a duplicate send from startup config churn is avoided. Inbound **`$/snyk.configuration`**may update persisted folder rows (e.g. via**`mergeFolderConfigsWithInboundLspView`**/ persistence); **`folderConfigs`**in every outbound payload still follow **`resolveFolderConfigsForServerSettings`** from current **`IConfiguration`**.
81
80
82
81
### IDE → LS outbound requirements (`LspConfigurationParam`)
0 commit comments