Skip to content

Provide actual name ranges for FSharpSymbolUse #3920

Closed

Description

@auduchinok

Consider a use of FromString below:

let lexbuf = Lexing.LexBuffer<_>.FromString(str)
//           |----------------------------|
// current range is bigger than actual name usage

We could keep start pos of symbol use as well.

Activity

  1. dsyme commented on Nov 10, 2017

    @dsyme
    Contributor

    @auduchinok I suppose providing just the range FromString would be simpler and provide for overall accuracy. I don't really know why we provided the long names historically. Do you have any use for them?

    My guess is that a fair bit of client FCS code is sensitive to this however.

  2. auduchinok commented on Nov 10, 2017

    @auduchinok
    MemberAuthor

    @dsyme No, there's no uses of the full resolved ranges in our code, we trim them.
    Talking about client code I've seen (and as we do), there're usually methods that trim these ranges and look error-prone (e.g. looking for dot separator that may be a part of operator).

  3. dsyme commented on Nov 10, 2017

    @dsyme
    Contributor

    Talking about client code I've seen, there're usually methods that trim these ranges and look error-prone (e.g. looking for dot separator that may be a part of operator).

    Yeah, I've seen that code too.

    I suppose we can do a major version upgrade and put out some info to major consumers that the ranges have changed

  4. vasily-kirichenko commented on Nov 10, 2017

    @vasily-kirichenko
    Contributor

    I confirm that we don’t rely on long range and trimm them. If we need full long ident, we use QuickParse. I think we should add LongIdent into FSharpSymbolUse (however, we cannot remove QP entirely because we need to parse partially typed symbols in complition).

  5. dsyme commented on Nov 10, 2017

    @dsyme
    Contributor

    @vasily-kirichenko Thanks for checking!

  6. vasily-kirichenko commented on Nov 10, 2017

    @vasily-kirichenko
    Contributor

    Implemented in #3922. I think there will be a storm of failing tests :)

  7. vasily-kirichenko commented on Nov 14, 2017

    @vasily-kirichenko
    Contributor
  8. auduchinok commented on Nov 14, 2017

    @auduchinok
    MemberAuthor

    @vasily-kirichenko This is great!
    Looking at how LexBuffer is highlighted it looks like <_> is still in its range.

  9. vasily-kirichenko commented on Nov 14, 2017

    @vasily-kirichenko
    Contributor

    Yes.

  10. added this to the Unknown milestone on Aug 25, 2018
  11. dsyme commented on Apr 5, 2022

    @dsyme
    Contributor

    There is a duplicate of this error where "<_>" is still included. I will close this.

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

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions