Skip to content

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

Merged
merged 5 commits into from
Sep 2, 2014
Merged

Add method GetDeclarationSymbols method to CheckFileResults/TypeCheckInfo #182

merged 5 commits into from
Sep 2, 2014

Conversation

7sharp9
Copy link
Member

@7sharp9 7sharp9 commented Jul 17, 2014

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

7sharp9 added 2 commits July 17, 2014 18:48
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.
@7sharp9
Copy link
Member Author

7sharp9 commented Jul 18, 2014

I have another change to add to this to pre-sort and group the returned symbols in the same way that declarations are.

@dsyme
Copy link
Contributor

dsyme commented Aug 6, 2014

Can you add some tests for this?

@7sharp9
Copy link
Member Author

7sharp9 commented Aug 27, 2014

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>
Copy link
Contributor

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?

@dsyme
Copy link
Contributor

dsyme commented Sep 1, 2014

Tests? :)

@7sharp9
Copy link
Member Author

7sharp9 commented Sep 1, 2014

@dsyme Working on it!

7sharp9 added 3 commits September 1, 2014 18:30
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.
@7sharp9
Copy link
Member Author

7sharp9 commented Sep 1, 2014

@dsyme Ok tests now added.

fsgit added a commit that referenced this pull request Sep 2, 2014
Add method GetDeclarationSymbols method to CheckFileResults/TypeCheckInfo
@fsgit fsgit merged commit 04fcad6 into fsharp:master Sep 2, 2014
@7sharp9
Copy link
Member Author

7sharp9 commented Dec 2, 2014

@dsyme Would you be ok with a PR to change the signature for this to also return the display context for the symbol?

member GetDeclarationSymbols : ParsedFileResultsOpt:ParseFileResults option * line: int * colAtEndOfPartialName: int * lineText:string * qualifyingNames: string list * partialName: string * ?hasTextChangedSinceLastTypecheck: (obj * range -> bool) -> Async<DisplayContext * FSharpSymbol list list>

Adding the display context means the symbols have correct names with regard to 'open' context so tooltips and completion list are nice and short.

@dsyme
Copy link
Contributor

dsyme commented Dec 2, 2014

Why "FSharpSymbol list list"? And could we return FSharpSymbolUse (which includes a DisplayContext)?

@7sharp9
Copy link
Member Author

7sharp9 commented Dec 2, 2014

If there's enough information to construct one then we could, yes.

On 2 Dec 2014, at 18:30, Don Syme notifications@github.com wrote:

Why "FSharpSymbol list list"? And could we return FSharpSymbolUse (which includes a DisplayContext)?


Reply to this email directly or view it on GitHub.

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

Successfully merging this pull request may close these issues.

3 participants