Skip to content

GetAllUsesOfAllSymbolsInFile returns wrong FSharpSymbolUse for extension properties #178

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

Closed
vasily-kirichenko opened this issue Jul 12, 2014 · 5 comments · Fixed by #216
Closed
Labels

Comments

@vasily-kirichenko
Copy link
Contributor

For code

module Module =
    type System.String with
        member __.ExtensionProperty = ()
open Module
let _ = "a long string".ExtensionProperty

CheckFileResults.GetAllUsesOfAllSymbolsInFile returns the following FSharpSymbolUse for ExtensionProperty in the last line:

image

The wrong things are:

  • FullName is "System.String.ExtensionProperty" (instead of "SourceCodeClassifierTests.Module.ExtensionProperty" as it is for line 4, when it's defined)
  • RangeAlternate covers the property itself and "a long string" value altogether (instead of 6, 24; 6, 41 it's 6, 8; 6, 41).

All these blocks me to finish "Gray out unused open declaration" VFPT feature fsprojects-archive/zzarchive-VisualFSharpPowerTools#574 because I cannot determine that open Module is actually used by line let _ = "a long string".ExtensionProperty.

@dungpa
Copy link
Contributor

dungpa commented Jul 13, 2014

FCS returns correct results for extension members. This issue only occurs on extension properties. It might be an oversight due to FCS' recent changes in property handling. Please help us to fix this.

@vasily-kirichenko vasily-kirichenko changed the title GetAllUsesOfAllSymbolsInFile returns wrong FSharpSymbolUse for extension members GetAllUsesOfAllSymbolsInFile returns wrong FSharpSymbolUse for extension properties Jul 14, 2014
@vasily-kirichenko
Copy link
Contributor Author

Please tell us this can be fixed in theory. If not, we continue hacking our really ugly workaround.

//cc @dsyme

@quasilord quasilord added the bug label Jul 15, 2014
@dungpa
Copy link
Contributor

dungpa commented Jul 17, 2014

EnclosingEntity of ExtensionProperty symbol mistakenly points to System.String type. I think it should point to Module module in the same way that the symbol at the definition of ExtensionProperty does.

@dsyme
Copy link
Contributor

dsyme commented Jul 17, 2014

All this looks fixable, at least in theory :)

@dungpa
Copy link
Contributor

dungpa commented Aug 7, 2014

If we are able to retrieve getter methods and setter methods from properties i.e. #191, it will make the weirdness of property symbols more tolerable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants