Skip to content
This repository has been archived by the owner on Oct 31, 2021. It is now read-only.

[Go to definition] Should work on signature files nicely #1351

Open
vasily-kirichenko opened this issue Mar 22, 2016 · 8 comments
Open

[Go to definition] Should work on signature files nicely #1351

vasily-kirichenko opened this issue Mar 22, 2016 · 8 comments
Labels

Comments

@vasily-kirichenko
Copy link
Contributor

  • F12 should always jump to implementation (currently it jumps to function implementation and to type signature (fsi))
  • If we are in FSI file, than F12 should not jump to any FS file if corresponding FSI file presents (in other words, if we are in "signature kingdom", don't leave it if possible)
  • F12 on a definition should switch between FS and FSI files circularly
@vasily-kirichenko
Copy link
Contributor Author

I think it's easy to implement because FCS seems to return all symbol uses and FSharpSymbolUse.IsFromDeclaration is properly set to true for declaration in both fsi and fs files:

image

@dungpa
Copy link
Contributor

dungpa commented Mar 23, 2016

F12 should always jump to implementation (currently it jumps to function implementation and to type signature (fsi))

Could you elaborate on this?

  1. If we are in FSI file, than F12 should not jump to any FS file if corresponding FSI file presents (in other words, if we are in "signature kingdom", don't leave it if possible)
  2. F12 on a definition should switch between FS and FSI files circularly

Don't the two requirement conflict with each other? Do you have an example to illustrate them?

@vasily-kirichenko
Copy link
Contributor Author

You are right :)

OK, what about this:

  • If we are in an FSI file, we always jump to FSI file (if available)
  • If we are in an FS file, we always jump to FS file
  • If we are on a definition, then we jump FSI <-> FS recursively

@dungpa
Copy link
Contributor

dungpa commented Mar 23, 2016

Sounds reasonable.

Implementing this means overriding Visual F# tool's F12 completely.
Are you fine with that? An alternative is to have a new command (e.g. Alt Shift F12) to switch between declarations on implementation and signature files.

@vasily-kirichenko
Copy link
Contributor Author

I think "F12 for everything" approach is more straightforward and easier to use.

@vasily-kirichenko
Copy link
Contributor Author

OK, I found a bug in FCS, so cannot proceed with the feature until it's fixed.

@dungpa
Copy link
Contributor

dungpa commented Mar 23, 2016

You're right. I made an attempt here https://github.com/dungpa/PowerTools/tree/f12, but it obviously doesn't work since ImplementationLocation and SignatureLocation often point the same location.

@vasily-kirichenko
Copy link
Contributor Author

@dungpa I've made similar changes here #1352 :)

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

No branches or pull requests

2 participants