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
Fix Find All References for Active Pattern Cases (#1436)
* Initial plan
* Fix Find All References for Active Pattern Cases by filtering to specific case
Co-authored-by: TheAngryByrd <[email protected]>
* Add comprehensive tests for Active Pattern Find All References
Tests verify that:
- Finding references for 'Even' returns only 'Even', not 'Odd'
- Finding references for 'Odd' returns only 'Odd', not 'Even'
- Partial Active Patterns work correctly
- Multi-case patterns (3+ cases) correctly filter each case independently
Co-authored-by: TheAngryByrd <[email protected]>
* Format code with fantomas
Co-authored-by: TheAngryByrd <[email protected]>
* Add tests for finding references from active pattern declarations
- Added test for full active pattern from declaration
- Added test for partial active pattern from definition
- Updated comment to clarify filtering behavior
- All 18 tests now pass (9 for BackgroundCompiler + 9 for TransparentCompiler)
Co-authored-by: TheAngryByrd <[email protected]>
* Add logic to find case usages when querying from active pattern declaration
- Updated test expectations to include case usages (ParseInt)
- Added code to extract pattern name and find matching cases
- When querying from (|ParseInt|_|), now searches for ParseInt case usages
- Handles both partial and full active patterns
Co-authored-by: TheAngryByrd <[email protected]>
* Fix finding case usages from active pattern declaration
- Use case.Group.DeclaringEntity to match cases to their pattern
- Compare declaring entities and pattern names
- Properly handle Option types in comparisons
- This enables finding ParseInt usages when querying from (|ParseInt|_|)
Co-authored-by: TheAngryByrd <[email protected]>
* Attempt to fix case usage finding with simpler pattern matching
- Changed approach to match case names within pattern DisplayName
- Check if case name appears between pipes in pattern name
- Handle both full patterns (|Even|Odd|) and partial patterns (|ParseInt|_|)
- Test still failing - needs further debugging of FCS symbol behavior
Co-authored-by: TheAngryByrd <[email protected]>
* Refactor active pattern tests for consistent formatting and readability
* Add tests for finding references in nested and complex patterns
* Implement case usage detection for partial active patterns and add tests for cross-file references
* Enhance active pattern case usage detection for partial patterns in match expressions
* Refactor range tests to improve reference checking and add script support
* Clean up whitespace in checkRangesScript function for improved readability
* Add support for extracting case names from partial active patterns and enhance related tests
* formatting
* Add functions to extract case names from active patterns and refactor related logic
* Enhance documentation for findPartialActivePatternCaseUsages and optimize case name extraction in AdaptiveServerState
---------
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: TheAngryByrd <[email protected]>
Co-authored-by: Jimmy Byrd <[email protected]>
0 commit comments