Skip to content

Find References doesn't work if #line directives are used  #9928

@cartermp

Description

@cartermp

Take this code (presumably generated):

module File1

#nowarn "25"
#line 1 "foo.fs"
let Thing 1 = 2 

Expected: FindAllReferences on "Thing" reports one usage at the correct location in the given generated file (this is what C# does)

Actual: FindAllRefererences on "Thing" reports one usage on line 1 of File1.fs


  • Use latest master of the F# codebase
  • Navigate to the definition of Option in the FSharp.Core projects
  • run Find All References on None

Once it finishes, you'll note that there are many results. However, the first set of results in FSharp.Compiler.Private are the generated pars.fs and lex.fs files are not accurate.

Clicking the first item:
image

Navigates here:
image

Maybe this is just a problem for us, but it could mean that any generated files are also giving false positives.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-LangService-FindAllReferencesFind all references across projects and solutionsBugImpact-Medium(Internal MS Team use only) Describes an issue with moderate impact on existing code.

    Type

    Projects

    Status

    New

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions