Skip to content

Go-to-definition fails for a use of a provided constructor #5538

Closed

Description

@cartermp
  1. Install FSharp.Data (3.0.0-beta4 is what I tested with)
  2. Add the following code:
open FSharp.Data

type MyCSV = CsvProvider<"1, 2, 3, 4, 5">

// Go to definition on 'MyCSV' works here.
let sample = MyCSV.GetSample()

// Go to definition on 'MyCSV' does not work here.
let noWorky = MyCSV()

Note that in the first case, Go to Definition succeeds. In fact, it seems to succeed in all cases aside from the noWorky sample. Note that semantic highlighting does not pick up the declaration of MyCSV in the latter case, probably indicating that something is not getting resolved correctly in name resolution.

image

This is not a regression as far as we can tell, at least not with any previous VS 2017 release.

Activity

  1. added this to the 16.0 milestone on Aug 20, 2018
  2. changed the title [-]Go to definition fails on Type Provider name declaration if it is used like a constructor[/-] [+]Type Provider name isn't resolved correctly if it is used like a constructor[/+] on Aug 20, 2018
  3. jackfoxy commented on Aug 21, 2018

    @jackfoxy

    @cartermp my actual example:

    type InjectionPressure =
        CsvProvider< @"T:\PAE_Files_Proxy\DropZone\ZI_Z6S Presiones inyección de agua.txt", Separators = "\t", HasHeaders = true, Schema = "string, string, string, float"> 
    
    let injectionPressures = new InjectionPressure()
    

    I think the semantic highlighting you are experiencing is lack of the "new" keyword. With that keyword I see no semantic hints.

  4. cartermp commented on Aug 21, 2018

    @cartermp
    ContributorAuthor

    @jackfoxy I'm a bit confused. Regardless of it new is used, there is not semantic highlighting for the name declared for the type provider.

    noname

    Note that in the last line, if MyCSV is clicked, no semantic highlighting is applied. This means that somehow it is somehow treated as a different symbol than the actual declaration.

  5. jackfoxy commented on Aug 21, 2018

    @jackfoxy

    Everything else about the TP works for me, just not Go To Definition.

  6. cartermp commented on Aug 21, 2018

    @cartermp
    ContributorAuthor

    @jackfoxy, sorry, I think we're talking past each other here. When you say Go to Definition doesn't work for you, are you referring to the special case listed in the original issue text, or Go to Definition under any circumstance?

  7. jackfoxy commented on Aug 21, 2018

    @jackfoxy

    @cartermp just the special case in the original report.

  8. modified the milestones: 16.0, 16.1 on Feb 21, 2019
  9. modified the milestones: 16.1, 16.2 on Apr 23, 2019
  10. modified the milestones: 16.2, Backlog on Apr 30, 2019
  11. added
    Impact-Low
    on Aug 26, 2020
  12. changed the title [-]Type Provider name isn't resolved correctly if it is used like a constructor[/-] [+]Go-to-definition fails for a use of a provided constructor[/+] on Apr 5, 2022
  13. added
    Area-LangService-Navigation
    and removed on Apr 5, 2022
  14. added a commit that references this issue on Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-LangService-NavigationBugImpact-Low

    Type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions