Skip to content

Fix completion inconsistently filtering obsolete fields and events (#13512)#19506

Draft
Copilot wants to merge 19 commits intomainfrom
copilot/fix-9141961-29048891-8f02666a-f3c0-4c69-bf82-fde45e879f9c
Draft

Fix completion inconsistently filtering obsolete fields and events (#13512)#19506
Copilot wants to merge 19 commits intomainfrom
copilot/fix-9141961-29048891-8f02666a-f3c0-4c69-bf82-fde45e879f9c

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 26, 2026

Fix an inconsistency where FCS code completion shows some obsolete members (IL fields and events) but hides others (methods and properties). All obsolete members are now consistently hidden from completion by default, respecting the SuggestObsoleteSymbols option.

Root Cause

ResolveCompletionsInType in NameResolution.fs filtered obsolete methods (via MethInfoIsUnseen) and properties (via PropInfoIsUnseen) but had no equivalent filtering for IL fields or events. This caused obsolete fields and events from C# assemblies to appear in completion while obsolete methods and properties were hidden.

Changes Made

  • AttributeChecking.fs / .fsi: Added ILFieldInfoIsUnseen and EventInfoIsUnseen functions, following the same pattern as existing PropInfoIsUnseen and MethInfoIsUnseen. Both handle IL, F#, and type provider cases.
  • NameResolution.fs: Applied the new filtering functions in ResolveCompletionsInType for events and IL fields. Also updated ItemIsUnseen to handle Item.ILField and Item.Event for defense-in-depth on other completion paths.
  • CSharpClass.cs: Added ObsoleteMembersClass with obsolete and non-obsolete static fields, methods, properties, and events for C# interop testing.
  • Checker.fs: Added getCompletionInfoWithCompilerAndCompletionOptions helper to support completion tests with external assembly references.
  • CompletionTests.fs: Added 8 new tests:
    • 2 F# event tests (instance + static with [<Obsolete; CLIEvent>])
    • 5 C# interop tests verifying all 4 member types from the original issue are consistently hidden
    • 1 test verifying non-obsolete members remain visible regardless of the option
  • Release notes: Added entry in 11.0.100.md.

Testing

  • All 37 obsolete completion tests pass (29 existing + 8 new)
  • All 71+ total completion tests pass with no regressions
  • Code review and CodeQL clean

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@T-Gro
Copy link
Copy Markdown
Member

T-Gro commented Mar 27, 2026

@copilot : Try again

@T-Gro
Copy link
Copy Markdown
Member

T-Gro commented Mar 27, 2026

@copilot : Try again.

@abonie
Copy link
Copy Markdown
Member

abonie commented Mar 31, 2026

@copilot Try again

Copilot AI and others added 14 commits March 31, 2026 14:24
… element (#19464)

Co-authored-by: abonie <20281641+abonie@users.noreply.github.com>
#19341)

Co-authored-by: abonie <20281641+abonie@users.noreply.github.com>
Co-authored-by: abonie <20281641+abonie@users.noreply.github.com>
* Add Regression PR Shepherd agentic workflow

Shepherds open AI-Issue-Regression-PR pull requests to completion:
- Fixes CI failures and addresses review feedback
- Detects when a test proves the bug still exists (removes label, tags maintainers)
- Runs 6x/day, only touches tests/ files

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add min-integrity: none

* Add min-integrity: none

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: abonie <20281641+abonie@users.noreply.github.com>
…it, stricter labeling (#19499)

- Enable create-pull-request and push-to-pull-request-branch for regression test PRs
- Enable remove-labels for AI-thinks-issue-fixed and AI-thinks-windows-only
- Add Task 2: Regression Test Verification with adversarial dispute step
- Add Task 3: Systematic revisit of AI-thinks-windows-only claims
- Reorder tasks: Task 1 → Task 3 → Task 2 → FINAL (Task 3 feeds into Task 2)
- Strict windows-only rules with explicit FCS-testable feature list
- Fix memory section to match actual state.json schema
- Remove close-issue actions (closure happens via PR merge with Fixes link)
- Fix stale references, contradictory instructions, date cutoff to 2024
- Clarify anti-spam rules for multi-task commenting

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: abonie <20281641+abonie@users.noreply.github.com>
…327.7 (#19512)

On relative base path root
Microsoft.DotNet.Arcade.Sdk From Version 10.0.0-beta.26168.1 -> To Version 10.0.0-beta.26177.7

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: abonie <20281641+abonie@users.noreply.github.com>
* Update dependencies from https://github.com/dotnet/msbuild build 20260324.4
On relative base path root
Microsoft.Build , Microsoft.Build.Framework , Microsoft.Build.Tasks.Core , Microsoft.Build.Utilities.Core From Version 18.6.0-preview-26173-02 -> To Version 18.6.0-preview-26174-04

* Update dependencies from https://github.com/dotnet/msbuild build 20260325.1
On relative base path root
Microsoft.Build , Microsoft.Build.Framework , Microsoft.Build.Tasks.Core , Microsoft.Build.Utilities.Core From Version 18.6.0-preview-26173-02 -> To Version 18.6.0-preview-26175-01

* Update dependencies from https://github.com/dotnet/msbuild build 20260326.1
On relative base path root
Microsoft.Build , Microsoft.Build.Framework , Microsoft.Build.Tasks.Core , Microsoft.Build.Utilities.Core From Version 18.6.0-preview-26173-02 -> To Version 18.6.0-preview-26176-01

* Update dependencies from https://github.com/dotnet/msbuild build 20260327.2
On relative base path root
Microsoft.Build , Microsoft.Build.Framework , Microsoft.Build.Tasks.Core , Microsoft.Build.Utilities.Core From Version 18.6.0-preview-26173-02 -> To Version 18.6.0-preview-26177-02

---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: abonie <20281641+abonie@users.noreply.github.com>
…f`1 (#19485)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: abonie <20281641+abonie@users.noreply.github.com>
…#19480)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: abonie <20281641+abonie@users.noreply.github.com>
* Add regression test for #13519: C# optional parameters from F#

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add ParamArray + optional params regression test for #13519

Addresses reviewer feedback: the original issue was specifically about
the intersection of omitted optional arguments and ParamArray arguments,
as identified by Don Syme. This adds a test covering that exact scenario.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: abonie <20281641+abonie@users.noreply.github.com>
)

* Add regression test for #6648: DU of DUs with inline static members

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix unclosed triple-quoted string in Issue 6648 regression test

Add missing closing triple-quote and assertion pipeline to the
DU of DUs with inline static members test.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: abonie <20281641+abonie@users.noreply.github.com>
)

* Initial plan

* Fix repo-assist: add safe output discipline, iteration limits, and noop fallback

Root cause: Agent spent ~37 minutes creating ~25 test files across 5+ issues
without calling any safe output MCP tools, resulting in empty agent_output.json.

- Add "Safe Output Discipline" section with incremental output, noop fallback,
  3-attempt iteration limit per issue, and time awareness rules
- Task 1: call safe output tools immediately after each issue
- Task 2: limit build-and-test cycles to 3 per issue, create PRs immediately,
  do not create multiple test file variants

Agent-Logs-Url: https://github.com/dotnet/fsharp/sessions/cf589816-f234-44e2-9245-742907ee5d27

Co-authored-by: T-Gro <46543583+T-Gro@users.noreply.github.com>

* Run gh aw upgrade and gh aw compile to regenerate lock files

Updates gh-aw from v0.64.2 to v0.64.4:
- Regenerate repo-assist.lock.yml with new frontmatter hash
- Regenerate regression-pr-shepherd.lock.yml
- Update actions-lock.json with new action SHAs
- Update agentic-workflows.agent.md version references

Agent-Logs-Url: https://github.com/dotnet/fsharp/sessions/0f6b9ce7-da31-403c-b633-6bb5f004484e

Co-authored-by: T-Gro <46543583+T-Gro@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: T-Gro <46543583+T-Gro@users.noreply.github.com>
Co-authored-by: Tomas Grosup <Tomas.Grosup@gmail.com>
Co-authored-by: Adam Boniecki <20281641+abonie@users.noreply.github.com>
Co-authored-by: abonie <20281641+abonie@users.noreply.github.com>
…0330.8 (#19525)

On relative base path root
Microsoft.Build , Microsoft.Build.Framework , Microsoft.Build.Tasks.Core , Microsoft.Build.Utilities.Core From Version 18.6.0-preview-26177-02 -> To Version 18.6.0-preview-26180-08

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: abonie <20281641+abonie@users.noreply.github.com>
…otnet-optimization build 20260330.1 (#19523)

On relative base path root
optimization.linux-arm64.MIBC.Runtime , optimization.linux-x64.MIBC.Runtime , optimization.windows_nt-arm64.MIBC.Runtime , optimization.windows_nt-x64.MIBC.Runtime , optimization.windows_nt-x86.MIBC.Runtime From Version 1.0.0-prerelease.26153.1 -> To Version 1.0.0-prerelease.26180.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: abonie <20281641+abonie@users.noreply.github.com>
T-Gro and others added 4 commits March 31, 2026 14:24
* Add aw-auto-update workflow for daily gh aw upgrade/compile

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Update agentic workflows via gh aw upgrade (v0.64.2 → v0.64.4)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: abonie <20281641+abonie@users.noreply.github.com>
Verifies that land, lor, lxor, lsl, lsr, and asr can be used as valid
identifiers after the ML compatibility removal in PR #19143.

Fixes #6715

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: abonie <20281641+abonie@users.noreply.github.com>
Add ILFieldInfoIsUnseen and EventInfoIsUnseen functions to filter obsolete
IL fields and events from completion, matching existing behavior for methods
and properties. Also update ItemIsUnseen to handle ILField and Event items.

Fixes #13693

Agent-Logs-Url: https://github.com/dotnet/fsharp/sessions/1d21d452-3f55-4d56-898c-0b50980050b5

Co-authored-by: abonie <20281641+abonie@users.noreply.github.com>
Fix issue number to #13512. Add ObsoleteMembersClass to CSharp_Analysis
with obsolete and non-obsolete members. Add 6 C# interop completion tests
verifying all obsolete member types are consistently hidden.

Agent-Logs-Url: https://github.com/dotnet/fsharp/sessions/1d21d452-3f55-4d56-898c-0b50980050b5

Co-authored-by: abonie <20281641+abonie@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 31, 2026

@copilot Try again

Reimplemented from scratch on latest main in commits a371209 and 6f6cf86.

Root cause: ResolveCompletionsInType in NameResolution.fs filtered obsolete methods (via MethInfoIsUnseen) and properties (via PropInfoIsUnseen) but had no filtering for IL fields or events.

Fix: Added ILFieldInfoIsUnseen and EventInfoIsUnseen functions in AttributeChecking.fs, then applied them in both ResolveCompletionsInType and ItemIsUnseen. All 37 obsolete completion tests pass, including 6 new C# interop tests that verify all four member types (field, method, property, event) from the original issue are consistently hidden.

Copilot AI changed the title [WIP] Copilot Request Fix completion inconsistently filtering obsolete fields and events (#13512) Mar 31, 2026
Copilot AI requested a review from abonie March 31, 2026 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: New

Development

Successfully merging this pull request may close these issues.

3 participants