-
Notifications
You must be signed in to change notification settings - Fork 512
CodeLens References not working if function is in another file #2421
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
CodeLens References not working if function is in another file #2421
Comments
Nice find! I've fixed this and it will be available in the next version. |
Does this change cover the whole workspace? I have modules separated within multiple layers of folders and just got the same issue but with a bit diffferent thing. It shows 0 references Find References shows only 1 find in 1 file (the file the function is defined in) but clearly I have it in other files. |
@TylerLeonhardt I'm also having problems with Go to Definition not working.zip In the attached zip there is a small test project. Expected behaviourGo to Definition should work for all functions. Actual behaviourPowerShell-Preview-2019.12.0.vsixGo to Definition works for all functions. PowerShell-Preview-2020.1.0.vsixGo to Definition does work for:
Go to Definition does not work for:
|
Would you like to give it a try and see if it works for you? @PrzemyslawKlys, this also includes PowerShell/PowerShellEditorServices#1162 so I'm curious how the PSIC looks for you. Let me know if you have trouble installing. This is an unsigned build and has 0 official support so keep that in mind. |
Installing :-) |
@TylerLeonhardt I've installed the new VSIX and done a quick test. Both |
That's so weird that it works for you 👱♂️ |
@PrzemyslawKlys you've had trouble with dev build vsix's in the past IIRC |
oh wait - that's because I built on a mac and it has to be built on Windows. gah. give me a sec. Or just see if it works in PS Core - I don't have a Windows machine available right this second and Rob is on vacation. |
@PrzemyslawKlys Don't know if it helps, but this is my current configuration:
|
@TylerLeonhardt I'm on Windows 10 and it's working for me! |
PowerShell 7, i tried on 5.1. |
You also have both extensions enabled.... disable the primary one. |
I can't build the part that's needed to get the extension working on 5.1 cause I use a mac. Only the part for PS6+. - for context. |
On PowerShell 7 seems to work. Thanx |
@PrzemyslawKlys It was disabled. I've now removed it and it still works. As you've summised it works because I'm using PowerShell 7. |
Yes, but I mean it only shows enabled extensions so it must have been "within the session". |
@PrzemyslawKlys OK. I see. Thanks for the info. |
Glad to here this issue is fixed :) |
@TylerLeonhardt I've done a bit more testing of the new VSIX and found a little issue. The above is a screenshot of the project I attached above (#2421 (comment)). Note that for the file: I also have a question. Would you expect |
I'll look into this but please open a new issue so we don't lose this thread. And also attach the logs please :)
I believe there is some expectation that this should work. Right now, we are focused on closing gaps between the PowerShell Preview extension and PowerShell Stable extension. Can you try the |
Well I've opened this issue a while ago: #2112 It wasn't supported for multiple workspaces in the "old version'. But that would be cool if it would be possible. During development, I am often separating some code into different modules and it makes it much harder to debug things if only 1 workspace shows references. |
I hear ya. There are a ton of opportunities for rich feature experiences for PowerShell in VS Code. Unfortunately/fortunately, we had to focus on stability and performance for the past 2 years, peppering in small features as we go. Plus there's really only 1 dev working on this at any given time so the resources are slim. We're trying though. I hope that's visible. |
You don't have to tell me that :-) While I code only in PowerShell over my modules I get how hard some things are and that resources are slim. I have 40 PS modules that I manage mostly alone with some help from the community. I appreciate all the work you and your team do. I'll keep opening bugs/feature requests to make sure everything runs great. Even my F5 debug issue is no big deal now after you taught me how to "workaround" it - since I see what is happening now. So take your time :-) I just wish there was a much faster process for preview between fix and release date so those small bugs like this one would go away faster than once per month. But as you explained, it's not an automated process so until that is done I'm fine :-) I automated my PowerShell modules building just so I don't have to spend time doing manual releases because I release modules daily, even multiple times per day. |
@TylerLeonhardt With regard to Looking at the comments on the issue created by @PrzemyslawKlys, it looks like this functionality has not yet been added. |
System Details
System Details Output
Issue Description
CodeLens References does not work if the function is in another file. Both files shown below are in the same folder.
Note the
1 reference
above theY
function definition. This is in the same file as the reference.Note the
0 reference
above theX
function definition. This is in a different file to the referenc.I wonder if this is related to: CodeLens References link only jumps to definition #2374.
Expected Behaviour
In
TestModule.psm1
I expected to see1 references
above theX
function definition.Actual Behaviour
In
TestModule.psm1
I see0 references
above theX
function definitionAlso
Find All References
for functionX
shows:Find All References
for functionY
shows:Attached Logs
PowerShell Extension Logs.txt
PowerShell Editor Services Log.txt
The text was updated successfully, but these errors were encountered: