Skip to content
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

Go to Definition of function parameter jumps into first function having that parameter #348

Open
kuulemart opened this issue Nov 28, 2016 · 2 comments

Comments

@kuulemart
Copy link

kuulemart commented Nov 28, 2016

System Details

  • Operating system name and version: Win10 Anniversary Update
  • VS Code version: 1.7.2
  • PowerShell extension version: 0.7.2
  • Output from $PSVersionTable:
    Name Value

PSVersion 5.1.14393.206
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14393.206
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

Evaluate $PSVersionTable in PowerShell and paste the output here

Issue Description

I am experiencing a problem with "Go to Definition" feature. When file has multiple function having parameter with same name, "Go to Definition" jumps to first function declaration, regardless from which function parameter we examined. Testfile:

function f1($a) {
    $a + 1;
}

function f2 {
    param($a)
    $a + 2;
}

function f3 {
    param($a)
    $a + 3;
}

Action: Right click on $a inside f3 and select "Go to Definition"
Expected result: editor caret is planced before param $a in function f3 declaration
Actual result: editor caret is planced before param $a in function f1 declaration

The result does not depend on how params are defined (param keyword vs inline declaration)

@daviwil
Copy link
Contributor

daviwil commented Nov 28, 2016

Thanks for the report! I'll take a look.

@daviwil daviwil added the Issue-Bug A bug to squash. label Nov 28, 2016
@carlocardella
Copy link

This is still happening on the latest build

Version: 1.41.1 (user setup)
Commit: 26076a4de974ead31f97692a0d32f90d735645c0
Date: 2019-12-18T14:58:56.166Z
Electron: 6.1.5
Chrome: 76.0.3809.146
Node.js: 12.4.0
V8: 7.6.303.31-electron.0
OS: Windows_NT x64 10.0.18363

In this sample the $serviceid definition is in GetStatus but the cursor jumps to the same variable in GetService (the first variable in the list)

Z19QxD3bxh

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

No branches or pull requests

4 participants