Vscode-powershell: CodeLens References link only jumps to definition

Created on 18 Dec 2019  路  11Comments  路  Source: PowerShell/vscode-powershell

System Details


System Details Output

### VSCode version: 1.42.0-insider 26f5dfcd76c9a02f116a706844611aeb09ae8c0b x64

### VSCode extensions:
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]

### PSES version:

### PowerShell version:

Name                           Value
----                           -----
PSVersion                      5.1.18362.145
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.18362.145
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Issue Description

CodeLens References link is shown but does not respond to mouse clicks:

references

Expected Behaviour

When clicking on references link the overlay window with references should be shown

Actual Behaviour

When clicking on references link nothing happens.

Attached Logs

Follow the instructions in the troubleshooting docs
about capturing and sending logs.

1576678486-6dd3db75-6cd7-4cba-9919-dbb47d81c4031576678485019.zip

Area-Symbols & References Issue-Bug

All 11 comments

@kborowinski thanks for opening this issue and providing detailed information! I am having some trouble reproducing this behavior...do you have any PowerShell specific settings enabled?

I'm having the same issue.

### VSCode version: 1.41.0 9579eda04fdb3a9bba2750f15193e5fafe16b959 x64

### VSCode extensions:
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]        
[email protected]
[email protected]


### PSES version: 2.0.0.0

### PowerShell version:

Name                           Value
----                           -----
PSVersion                      7.0.0-rc.1
PSEdition                      Core
GitCommitId                    7.0.0-rc.1
OS                             Microsoft Windows 10.0.18363
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0鈥       
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

### Experimental Settings:

Name                                                       Enabled
----                                                       -------
PSCommandNotFoundSuggestion                                   True
PSImplicitRemotingBatching                                    True
PSNullConditionalOperators                                    True
Microsoft.PowerShell.Utility.PSGetError                       True
Microsoft.PowerShell.Utility.PSManageBreakpointsInRunspace    True
PSDesiredStateConfiguration.InvokeDscResource                 True

### $Profile.CurrentUserAllHosts:
# https://github.com/dahlbyk/posh-git
Import-Module posh-git

# If you would like to make your prompt span two lines, with a
# newline after the Git status summary, use this setting:
$GitPromptSettings.DefaultPromptBeforeSuffix.Text = '`n'

#Add-WindowsPSModulePath
$env:PSModulePath = $env:PSModulePath + ';C:\Data\PowerShell\Modules'

Set-Alias -Name 'ge' -Value 'Get-Error'

Import-Module HelperFunctions

I've attached my settings.json file.
settings.zip

@SydneyhSmith : Yep, a bunch actually:

    "powershell.powerShellAdditionalExePaths": [
        {
            "exePath": "C:\\Program Files\\PowerShell\\Nightly\\pwsh.exe",
            "versionName": "PowerShell Core Nightly (x64)"
        }
    ],
    "powershell.developer.featureFlags": [
        "PSReadLine"
    ],
    "powershell.scriptAnalysis.enable": true,
    "powershell.codeFormatting.preset": "OTBS",
    "powershell.integratedConsole.focusConsoleOnExecute": false,
    "powershell.integratedConsole.showOnStartup": false,
    "powershell.sideBar.CommandExplorerVisibility": false,
    "powershell.promptToUpdatePowerShell": false

I did some digging right now and found that not only the references link does not work but shows wrong number of references. In fact I went through my code to find that it always shows 2 references regardless of factual reference number. Have a look:

references

As per @kborowinski, I get both issues:

  1. Clicking on references flashes function name, but does not bring up a list of references.
  2. Functions show 2 References.

Here are my steps to reproduce the issues:

  1. Started Windows Sandbox
  2. Installed PowerShell-7.0.0-rc.1-win-x64.msi
  3. Installed VSCodeUserSetup-x64-1.41.0
  4. Installed PowerShell Preview 2019.12.0 extension
  5. Add the following to settings.json
           "powershell.developer.featureFlags": [
           "PSReadLine"
       ],
       "editor.fontSize": 11,
       "terminal.integrated.fontSize": 11
  1. Closed VS Code
  2. Unzipped test project (CodeLens-Issue.zip) to a folder on the desktop
  3. Right clicked on folder and selected Open with Code

There are two functions in the test project. Neither has a reference to it. However, for both, I get the following after doing Find All References (Shift+Alt+F12):

image

EDIT:
The following is a file from one of my projects.

image

Note that, above the function, it says 2 References. However, the References tab shows 21. Also, I think the two within the Add-WalkTrackIssue should not be there.

@kborowinski @mrboring thanks for all the additional information and re-pro steps! We are still investigating this issue and will follow up with any other questions!

Can you both please provide the language server logs?

@TylerLeonhardt : Here you go: plsp.txt

@TylerLeonhardt As requested: PES Output.txt

Yep saw this on Twitter as well. It's fixed in the PR above ^

Silly boolean logic - I had it backwards!

Was this page helpful?
0 / 5 - 0 ratings