vscode-powershell icon indicating copy to clipboard operation
vscode-powershell copied to clipboard

Feature request: "Go to Definition" works across all files in a workspace

Open adbertram opened this issue 9 years ago • 8 comments

It'd be super-convenient for me if I could right-click on a function call click "Go to Definition" and it would find the module (if exists) that's in my current workspace, open up that file and then go to the function declaration.

adbertram avatar Feb 10 '17 14:02 adbertram

Yep, we have a lot of work to do on the symbol features in PowerShell Editor Services. We need to start working on module-level analysis to enable this.

daviwil avatar Feb 10 '17 14:02 daviwil

This sounds close to #420. There should be some overlap but I'm not certain if/what unique changes there are to these two issues.

TylerLeonhardt avatar Dec 06 '17 18:12 TylerLeonhardt

Hi, any updates on this? I stumbled across this issue when figuring out if CodeLens was supposed to look for function names across multiple modules in the workspace. I think this is related?

rfoust avatar Dec 15 '18 19:12 rfoust

There's been some work to improve this. Probably not in the space you're hoping. I don't think I quite understand your comment - can you give an example, @rfoust?

TylerLeonhardt avatar Dec 17 '18 05:12 TylerLeonhardt

@TylerLeonhardt oops it's been a year, guess I'll reply now lol. :) I mean if I have multiple module folders open in the workspace and I'm looking at a function definition "function Get-Something" then right above it, it says "0 references" but there are really all kinds of references to it in other modules that I'm editing in my workspace, it just isn't seeing them.

Screen Shot 2019-11-05 at 12 28 19 PM

rfoust avatar Nov 05 '19 17:11 rfoust

What's the scope of this issue? Initial post reads like definitions in same workspace. That should work in general now. Multi-root workspaces (introduced later I believe) will still need some work.

Be aware that the lookup is not module-aware, so conflicting function names might cause multiple returned definitions and wrong reference count.

Tracking definitions across Import-Module (and PSIC-imported modules outside workspace?) sounds like a separate issue.

fflaten avatar Feb 20 '23 19:02 fflaten

@fflaten actually I just made multi-root workspaces work in the last preview! I believe this is finished, besides what you point out with imported modules. So let's close this and leave #420 open I think.

andyleejordan avatar Feb 21 '23 19:02 andyleejordan

This issue has been marked as fixed. It has been automatically closed for housekeeping purposes.

ghost avatar Feb 21 '23 22:02 ghost