Repository navigation
NuGet audit policy evaluates like MSBuild: last unconditional assignment, project over props - #609
Merged
Merged
Conversation
…ody so the project's value wins, the last unconditional assignment in a file wins, and a conditioned group or property never overrides it
MelbourneDeveloper
enabled auto-merge (squash)
November 19, 2026 17:26
MelbourneDeveloper
added a commit
that referenced
this pull request
Nov 19, 2026
…sts flake) (#610) ## TLDR A cancelled Test Explorer Debug gesture no longer leaves a leftover "SharpLsp Test Debug" terminal beside the next debug run. This is the cause of the repeated Linux `debug-tests` failures (`the cancelled gesture leaves no ghost terminal beside the live debug run`, `2 !== 1`). ## Details - `test-debug.ts`: - **An already-cancelled gesture opens no terminal.** It runs nothing worth showing. - **A run's end disposes its terminal window.** Firing the pty's close event alone only reaches a terminal VS Code has opened. On headless Linux, VS Code may never open the pty of a short-lived run, so its terminal stayed open. - #607's open-time close stays, for a run that ends while its terminal is opening. - Live runs are unchanged: the terminal still opens, stays live while the debugger attaches, and closes when the run ends. ## How Do The Automated Tests Prove It Works? - `debug-test-stop-e2e.test.ts` *Stop ends its host and terminal, never retries, and the next Debug starts clean* (F# and C#, VSTest and MTP) asserts exactly one test-debug terminal after a pre-cancelled gesture. - It failed on Linux CI on the first run of #606, #607 and #609 with `2 !== 1`. - CI on this PR is the proof, because it always passed locally on macOS. - Locally: the `debug-test-mtp`, `debug-test-stop`, `debug-terminal-cancel` and `debug-test-debugging` suites pass, 35 tests. - `test-explorer-outcomes.test.ts` still asserts that the Debug profile opens exactly one live terminal for a real run.
MelbourneDeveloper
added a commit
that referenced
this pull request
Nov 19, 2026
…ile watcher (Windows F# add-file hover) (#613) ## TLDR Adding an F# file from the Solution Explorer now reloads the F# project right away. Before, the reload waited for the file watcher to notice the host's own `.fsproj` write; on Windows it sometimes didn't, and the new file stayed unowned, with no hover or diagnostics. ## Details - **Symptom:** the Windows `workspace` leg failed on #607, #609 and #612 in *Solution Explorer — Add F# Source File: project node: adds .fs before the last Compile item and FCS owns it*. A hover on the new file stayed `[]` for the test's 90-second polling limit. Each failure passed on re-run. - **Mechanism, from the uploaded host and sidecar logs of a passing run:** - `sharplsp/project/addCompileItem` edits the `.fsproj` through the C# sidecar's MSBuild editing. - Nothing then told the F# sidecar. Its reload ("F# loaded …fsproj, which owns …NewLogic.fs") came about 1.8 s later, only because the native watcher noticed the write. - The Windows logs show watcher `EPERM` and "watcher shutdown" errors. When the event is lost, the project is never reloaded. - **Fix:** - `pull_diagnostics/monitor.rs` gains `written(paths)`. It posts the same `workspace/didChangeWatchedFiles` notification the native watcher sends (type Changed, `sharplspRescan: false`) onto the foreground dispatch queue. - `project_edit.rs` calls it after any compile-item edit that modified the project. - A watcher event that also arrives is merged into the same reload by the existing reload worker. - `pull_diagnostics/state.rs` exposes the dispatch queue (`inbound()`). Both files stay under 500 lines. ## How Do The Automated Tests Prove It Works? - `written_tests::a_project_file_the_host_writes_is_announced_as_a_watched_change` (new) checks three cases: 1. Before the dispatch queue exists, the call is a no-op. 2. Once the queue exists, one `didChangeWatchedFiles` arrives, carrying exactly `[{ uri: <project>, type: 2 }]` with `sharplspRescan: false`. 3. Writing no paths sends no notification. - All 371 host unit tests pass (`--test-threads=1`), and clippy is clean. - On this PR, the Windows `workspace` leg runs the Add F# Source File suite end to end.
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.
TLDR
The NuGet audit settings (
NuGetAudit,NuGetAuditLevel,CentralPackageTransitivePinningEnabled) are now read the way MSBuild evaluates them, so SharpLsp's vulnerability warnings match whatdotnet restorereports.Details
nuget/vulnerability/settings.rs:propertyreturned the FIRST<NuGetAuditLevel>, solowfollowed byhighreportedlow-level advisories that NuGet hides.PropertyGroup,Whenor property with aCondition. The host cannot evaluate the condition, and assuming it true let a CI-only value override the real one.Directory.Build.propsandDirectory.Packages.propsbefore the project body. Before, the project was read first and the props overrode it, and aNuGetAudit=falsein a props file could never be re-enabled by the project. The newevaluation_orderreads the props first and the project last.pins_transitives_centrallyuses the same order and takes the last value.policy_fileskeeps its order, becauseaudited_filesdepends on it.mainagainst v0.33.0. The bug is in code added since the release, so no issue was filed.How Do The Automated Tests Prove It Works?
audit_settings_follow_msbuild_last_assignment_and_project_precedence(new) uses real files in a temporary folder:lowthenhighin one file givesHigh. Before the fix it failed withleft: Some(Low) right: Some(High).PropertyGroup, and separately a conditioned property, set tocriticalleaveLow.NuGetAudit=trueandmoderateoverrides a props file withfalseandcritical: auditing is on, atModerate.audit_settings_are_read_from_the_props_chainstill passes, along with all 94nuget::tests.cargo clippy --all-targetsis clean.