Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FindReferencesInFile misses references to type when a module with the same name exists #14411

Closed
0101 opened this issue Nov 30, 2022 · 0 comments · Fixed by #16081
Closed

FindReferencesInFile misses references to type when a module with the same name exists #14411

0101 opened this issue Nov 30, 2022 · 0 comments · Fixed by #16081
Assignees
Labels
Area-LangService-FindAllReferences Find all references across projects and solutions Bug Impact-Medium (Internal MS Team use only) Describes an issue with moderate impact on existing code.
Milestone

Comments

@0101
Copy link
Contributor

0101 commented Nov 30, 2022

Repro steps

Code sample 1

module Foo

type MyType =
    static member Two = 1

let x = MyType.Two

let y = MyType.Two

Code sample 2

module Foo

type MyType =
    static member Two = 1

let x = MyType.Two

module MyType = do () // <-- Extra module with the same name as the type

let y = MyType.Two
  1. Find All References on type MyType

Expected behavior

In both code samples we get the same results - 2 references to MyType type.

Actual behavior

In code sample 2 the second reference (y) is missing.

Known workarounds

None

Related information

The second occurrence is incorrectly stored in ItemKeyStore as Item.ModuleOrNamespaces instead of Item.Types. This happens probably because in name resolution we find the identifier in modules, which are searched first.

moduleSearch ad () +++ tyconSearch ad +++ envSearch

@0101 0101 added Bug Area-LangService-FindAllReferences Find all references across projects and solutions Needs-Triage labels Nov 30, 2022
@vzarytovskii vzarytovskii moved this to Not Planned in F# Compiler and Tooling Nov 30, 2022
@github-actions github-actions bot added this to the Backlog milestone Nov 30, 2022
@0101 0101 added Impact-Medium (Internal MS Team use only) Describes an issue with moderate impact on existing code. and removed Needs-Triage labels Dec 5, 2022
@0101 0101 self-assigned this Oct 4, 2023
@0101 0101 modified the milestones: Backlog, October-2023 Oct 4, 2023
@github-project-automation github-project-automation bot moved this from Future to Done in F# Compiler and Tooling Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-LangService-FindAllReferences Find all references across projects and solutions Bug Impact-Medium (Internal MS Team use only) Describes an issue with moderate impact on existing code.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant