Skip to content

CodeLens References link only jumps to definition #2374

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

Closed
kborowinski opened this issue Dec 18, 2019 · 11 comments · Fixed by PowerShell/PowerShellEditorServices#1139
Closed

Comments

@kborowinski
Copy link

kborowinski commented Dec 18, 2019

System Details

System Details Output

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

### VSCode extensions:
alexcvzz.vscode-sqlite@0.8.1
christian-kohler.path-intellisense@1.4.2
CoenraadS.bracket-pair-colorizer-2@0.0.29
DavidAnson.vscode-markdownlint@0.33.0
DotJoshJohnson.xml@2.5.0
eamodio.gitlens@10.2.0
mechatroner.rainbow-csv@1.3.1
ms-python.python@2019.11.50794
ms-vscode.powershell-preview@2019.12.1-CI.41180
streetsidesoftware.code-spell-checker@1.7.20
vscode-icons-team.vscode-icons@9.6.0

### 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

@ghost ghost added the Needs: Triage Maintainer attention needed! label Dec 18, 2019
@SydneyhSmith
Copy link
Collaborator

@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?

@SydneyhSmith SydneyhSmith added Needs-Repro-Info and removed Needs: Triage Maintainer attention needed! labels Dec 18, 2019
@mrboring
Copy link

I'm having the same issue.

### VSCode version: 1.41.0 9579eda04fdb3a9bba2750f15193e5fafe16b959 x64

### VSCode extensions:
alefragnani.Bookmarks@10.6.0
eamodio.gitlens@10.2.0
Ionide.Ionide-FAKE@1.2.3
Ionide.Ionide-fsharp@4.4.1
Ionide.Ionide-Paket@1.12.0
ms-vscode.csharp@1.21.9
ms-vscode.powershell@2019.12.0        
ms-vscode.powershell-preview@2019.12.0
streetsidesoftware.code-spell-checker@1.7.20


### 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

@ghost ghost added the Needs: Maintainer Attention Maintainer attention needed! label Dec 18, 2019
@kborowinski
Copy link
Author

@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

@kborowinski
Copy link
Author

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

@mrboring
Copy link

mrboring commented Dec 19, 2019

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.

@SydneyhSmith
Copy link
Collaborator

@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!

@TylerLeonhardt
Copy link
Member

Can you both please provide the language server logs?

@kborowinski
Copy link
Author

@TylerLeonhardt : Here you go: plsp.txt

@ghost ghost added the Needs: Maintainer Attention Maintainer attention needed! label Dec 20, 2019
@mrboring
Copy link

@TylerLeonhardt As requested: PES Output.txt

@PrzemyslawKlys
Copy link
Contributor

Same issue on my end: #2388

@TylerLeonhardt TylerLeonhardt changed the title CodeLens References link is shown but does not respond to mouse clicks CodeLens References link only jumps to definition Dec 23, 2019
@TylerLeonhardt
Copy link
Member

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

Silly boolean logic - I had it backwards!

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

Successfully merging a pull request may close this issue.

5 participants