Skip to content

[test-only-change] Record existing ref modifier parsing behavior - #84992

Merged
jjonescz merged 9 commits into
dotnet:mainfrom
CyrusNajmabadi:test-ref-modifier-parsing-baselines
Aug 21, 2026
Merged

jjonescz merged 9 commits into
dotnet:mainfrom
CyrusNajmabadi:test-ref-modifier-parsing-baselines

Conversation

@CyrusNajmabadi

@CyrusNajmabadi CyrusNajmabadi commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Record current syntax trees for ref-modifier and contextual declaration ambiguities before parser recovery changes.
  • Verify exact compilation diagnostics for invalid inputs so improved parsing cannot accidentally make them compile.
  • Capture that partial ref struct does not currently offer the modifier-order code fix.

This is test-only and establishes the baseline for #84935, so that PR can show its behavior changes as expectation diffs rather than newly added tests.

Test plan

  • Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (net10.0): 10,649 passed, 25 skipped
  • OrderModifiersCompilerErrorTests.PartialBeforeRefStruct (net10.0): passed
Microsoft Reviewers: Open in CodeFlow

Capture current syntax and binding outcomes before ref modifier recovery changes so the follow-up diff shows only intentional behavior changes.
@CyrusNajmabadi
CyrusNajmabadi requested review from a team as code owners August 21, 2026 13:25
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

Keep method ordering and split tests consistent with the follow-up so its diff focuses on changed parser and binding expectations.
Include the exact harness-generated diagnostic and source comments so every expected parser and binding error is reviewable in place.
Restore blank lines between adjacent test declarations for consistency with the surrounding test style.
Remove accidental blank-line runs and restore consistent separators and final newlines across the extracted tests.
Share each test source between syntax assertions and CreateCompilation so binding outcomes are visible and consistent with the other extracted tests.
@CyrusNajmabadi

Copy link
Copy Markdown
Contributor Author

@jjonescz this is ready for review.

Keep the split ClosedModifier_03 cases on their original UsingNode binding-verification path.
@jjonescz
jjonescz enabled auto-merge (squash) August 21, 2026 14:15
Validate the LSP sort prefix against the item's actual list position so unrelated completion additions do not break the obsolete-symbol test.
Include the independent order-agnostic completion assertion so the test-only PR can validate cleanly.
auto-merge was automatically disabled August 21, 2026 16:00

Head branch was pushed to by a user without write access

var resolvedItem = await testLspServer.ExecuteRequestAsync<LSP.CompletionItem, LSP.CompletionItem>(LSP.Methods.TextDocumentCompletionResolveName, actualItem, CancellationToken.None).ConfigureAwait(false);
Assert.Null(resolvedItem.LabelDetails);
Assert.Equal("0000", actualItem.SortText);
Assert.Equal(expectedSortText, resolvedItem.SortText);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merging #84993 in to unblock this pr.

@jjonescz
jjonescz enabled auto-merge (squash) August 21, 2026 16:02
@jjonescz
jjonescz merged commit 14c78a5 into dotnet:main Aug 21, 2026
24 of 25 checks passed
@CyrusNajmabadi
CyrusNajmabadi deleted the test-ref-modifier-parsing-baselines branch August 21, 2026 18:34
@CyrusNajmabadi

Copy link
Copy Markdown
Contributor Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants