Skip to content
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

Add GetSymbolUsesAtLocation API. #15285

Merged
merged 3 commits into from
Jun 5, 2023
Merged

Conversation

nojaf
Copy link
Contributor

@nojaf nojaf commented Jun 1, 2023

As discussed on the F# Foundation Slack, there are instances when the GetSymbolUseAtLocation function may return multiple correct symbols for a given line and end column. However, it currently only returns the first symbol in a somewhat arbitrary manner.

To address this limitation, I believe it would be beneficial to introduce an API that allows developers to filter out the symbol they specifically require, based on custom logic tailored to their use case.

In order to demonstrate the scenarios where this issue can arise, I have included two tests that highlight such situations. At present, the only available alternative is to retrieve all symbols, which can be quite inconvenient, particularly for larger files.

@nojaf nojaf requested a review from a team as a code owner June 1, 2023 07:58
@T-Gro
Copy link
Member

T-Gro commented Jun 1, 2023

Now you can also change the single-case GetSymbolUseAtLocation to call into your new method and then convert via List.tryHead, or?

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

Successfully merging this pull request may close these issues.

4 participants