-
Notifications
You must be signed in to change notification settings - Fork 123
Add method GetDeclarationSymbols method to CheckFileResults/TypeCheckInfo #182
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
Conversation
This property returns all the overloads of the current MethodInfos defined apart from the defining MethodInfo from FSharpMemberFunctionOrValue. e.g for DateTime.Now.ToString() would have a symbol of FSharpMemberFunctionOrValue with an initial signature defined of: unit -> string with Overloads of IFormatProvider -> string string -> string string * IFormatProvider -> string
This allows FSharpSymbols to be returned from the current location rather than a textual DeclarationSet. This means that each symbol can be queried and interpreted by the editor as it sees fit.
I have another change to add to this to pre-sort and group the returned symbols in the same way that declarations are. |
Can you add some tests for this? |
I will do, bit pushed for time due to deadlines for Evolve ... |
@@ -175,6 +175,9 @@ type CheckFileResults = | |||
|
|||
member GetDeclarationsAlternate : ParsedFileResultsOpt:ParseFileResults option * line: int * colAtEndOfPartialName: int * lineText:string * qualifyingNames: string list * partialName: string * ?hasTextChangedSinceLastTypecheck: (obj * range -> bool) -> Async<DeclarationSet> | |||
|
|||
member GetDeclarationSymbols : ParsedFileResultsOpt:ParseFileResults option * line: int * colAtEndOfPartialName: int * lineText:string * qualifyingNames: string list * partialName: string * ?hasTextChangedSinceLastTypecheck: (obj * range -> bool) -> Async<FSharpSymbol list> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add XML documentation for this please?
Tests? :) |
@dsyme Working on it! |
We might want to change this in the future to allow retrieval of only certain symbol types at a declaration point, so Ive chased not to refactor the common filtering in ServiceDeclarations. We want to provide an option to show operators for instance etc.
These tests are the symbol version of the GetDeclarations tests.
@dsyme Ok tests now added. |
Add method GetDeclarationSymbols method to CheckFileResults/TypeCheckInfo
@dsyme Would you be ok with a PR to change the signature for this to also return the display context for the symbol?
Adding the display context means the symbols have correct names with regard to 'open' context so tooltips and completion list are nice and short. |
Why "FSharpSymbol list list"? And could we return FSharpSymbolUse (which includes a DisplayContext)? |
If there's enough information to construct one then we could, yes.
|
This allows FSharpSymbols to be returned from the current location
rather than a textual DeclarationSet. This means that each symbol can
be queried and interpreted by the editor as it sees fit.
This solves #181