zzarchive-VisualFSharpPowerTools
zzarchive-VisualFSharpPowerTools copied to clipboard
[Go to definition] Should work on signature files nicely
- 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
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:
F12 should always jump to implementation (currently it jumps to function implementation and to type signature (fsi))
Could you elaborate on this?
- 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
Don't the two requirement conflict with each other? Do you have an example to illustrate them?
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
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.
I think "F12 for everything" approach is more straightforward and easier to use.
OK, I found a bug in FCS, so cannot proceed with the feature until it's fixed.
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.
@dungpa I've made similar changes here https://github.com/fsprojects/VisualFSharpPowerTools/pull/1352 :)