Skip to content

Provide a way to check if FSharpSymbolUse is resolved from id #3933

Open

Description

@auduchinok

When getting symbol uses via GetAllUsesOfAllSymbolsInFile() there're plenty of uses that were added implicitly or were resolved from syntax construction other than name use.
Examples:

  • definition of optional parameter adds uses of OptionalParameterAttribute and its namespaces
  • use of indexer property with .[ ... ]

May ItemOccurence type be extended with these cases?

module ClassLibrary32

type T() =
    member x.Opt(?p: int) = ()

screen shot 2017-11-12 at 15 22 46

Activity

  1. vasily-kirichenko commented on Nov 12, 2017

    @vasily-kirichenko
    Contributor

    The attribute is generated here https://github.com/Microsoft/visualfsharp/blob/c0b044c6c578fe281b689bcd93cffb9def24e967/src/fsharp/TypeChecker.fs#L989-L998 and at that point the information that it's synthesized is lost. So, we need to add a field to SynAttribute and a field to ItemOccurenece.Use. Let me try.

  2. vasily-kirichenko commented on Nov 12, 2017

    @vasily-kirichenko
    Contributor

    Huh. It's a complex task. @dsyme any tips how to better implement it?

  3. dsyme commented on Nov 13, 2017

    @dsyme
    Contributor

    May ItemOccurence type be extended with these cases?

    It's certainly OK to add this information. These might also come in handy:

        /// Synthetic marks ranges which are produced by intermediate compilation phases. This
        /// bit signifies that the range covers something that should not be visible to language
        /// service operations like dot-completion.
        member IsSynthetic : bool 
        member MakeSynthetic : unit -> range
    
  4. auduchinok commented on Nov 13, 2017

    @auduchinok
    MemberAuthor

    Another example is shown in #3939 where one of the uses came from the range of a literal in code.

  5. added this to the Unknown milestone on Aug 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions