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

Many standard 'Visual Studio Code' features not working when developing PowerShell 'class'es #1094

Closed
Pantharian opened this issue Nov 8, 2017 · 2 comments

Comments

@Pantharian
Copy link

System Details

  • Operating system name and version: Windows 7 Pro Version 6.1 (Build 7601 Service Pack 1)
  • VS Code version: 1.17.2
  • PowerShell extension version: 1.5.0
  • Output from $PSVersionTable:
Name                           Value
PSVersion                      5.1.14409.1012
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.14409.1012
CLRVersion                     4.0.30319.36392
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
Copy / paste the following commands into the PowerShell Integrated Console, and paste the output here:

code -v
1.17.2
b813d12980308015bcd2b3a2f6efa5c810c33ba5

$pseditor.EditorServicesVersion
Major  Minor  Build  Revision
-----  -----  -----  --------
1      5      0      0

code --list-extensions --show-versions
[email protected]

$PSVersionTable
Name                           Value
----                           -----
PSVersion                      5.1.14409.1012
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.14409.1012
CLRVersion                     4.0.30319.36392
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Issue Description

Many of the standard features in 'Visual Studio Code' do not work with files containing PowerShell classes. e.g. syntax highlighting, Peek Definition, Rename (F2) etc. IntelliSense and PSScriptAnalyzer are working.

An example of Peek Definition not working when the method is part of a class:
peek-definition-not-working

An example of the same code working when converted to functions:
peek-definition-working

Not sure if this is a bug (i.e. the extension should already support classes) or an enhancement (it doesn't currently but could in a later version)!

@andrewducker
Copy link

Same here. I try to "go to definition" for a class and it doesn't find anything, and it also doesn't find constructors.

@TylerLeonhardt
Copy link
Member

Ah this is a dupe of #3

The problem here is that it's difficult to support classes AND PowerShell v3. @powercode has been working on adding this but I'm not quite sure on his status. Once we move to V2 of the extension which comes with PSReadLine, we will be able to support this with a smaller barrier.

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

No branches or pull requests

3 participants