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

Search for function definition redirects to signature file (.fsi) instead of implementation #1966

Open
64J0 opened this issue Dec 5, 2023 · 3 comments

Comments

@64J0
Copy link

64J0 commented Dec 5, 2023

Describe the bug

In VSCode, when I have both the signature and implementation files for the same functions and I want to go for the function implementation, it redirects me to the signature instead. It would be very nice if this behavior could be customized to redirect to the implementation instead (maybe some switch on the extension configurations).

Steps to reproduce

  1. Create both signature (.fsi) and implementation (.fs) files for some function;
  2. Call the function in another implementation file. Hover over the function name and hit Ctrl + Mouse left click (to redirect to the function implementation);
  3. Notice that you'll be redirected to the signature file instead of the implementation.

Link to sample reproduction

Expected behaviour

Redirect to the implementation instead of the signature.

If you're going to keep the redirect to the signature by default, it would be nice to have some configuration in the extension settings to allow it to redirect to the implementation instead of signature.

Screenshots

Machine info

  • OS: Linux
  • .NET SDK version: 7.0.401
  • Ionide version: 7.16.1

Additional context

Add any other context about the problem here.

@MangelMaxime
Copy link
Contributor

Some languages like TypeScript are able to provide a choice when there are several candidates:

CleanShot 2023-12-05 at 20 22 08@2x

I wonder if we should do something similar, it could also make it easier to navigate between signature and implementation files in general.

@baronfel
Copy link
Contributor

baronfel commented Dec 5, 2023

Yeah - we have several gaps in navigation/references/etc with regards to separating implementation, declaration, and definition. A lot of this should come down to locating and returning different locations for

  • textdocument/declaration
  • textdocument/definition
  • textdocument/implementation

but we'd need to do that and see how far that gets us in covering the UX gaps.

@TheAngryByrd
Copy link
Member

I started some of that work in ionide/FsAutoComplete#1111

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

No branches or pull requests

4 participants