Vscode-powershell: Better intellisense for .NET?

Created on 10 Jun 2018  路  10Comments  路  Source: PowerShell/vscode-powershell

Issue Type: Feature Request

It would be very helpful to show popup documentation for .NET objects and members while coding in PowerShell, similar to what is already present for cmdlets. Is it possible with this extension or some other extension? The code completion for .NET objects works great but it would be nice to show the doc comments in the drowdowns and tooltips too.

Extension version: 1.7.0
VS Code version: Code 1.24.0 (6a6e02cef0f2122ee1469765b704faf5d0e0d859, 2018-06-06T17:30:30.113Z)
OS version: Darwin x64 16.7.0

Area-IntelliSense Issue-Enhancement

All 10 comments

I like this idea - It would be nice to have something like this similar to what PSReadLine offers:

image

This should be possible by using PowerShell's API for getting PSMethod overload definitions.

e.g.

[string]::Combine.OverloadDefinitions

This should be possible by using PowerShell's API for getting PSMethod overload definitions.
e.g.

[string]::Combine.OverloadDefinitions

We do already show that. The harder part is showing hints for the current parameter. Without type inference it's hard to tell what overload to show. Also the OverloadDefinitions property is just an array of strings, so we'd have to do some string manipulation to get specific parameters out of it (not saying that's impossible, just unfortunate)

In ESCS I ripped the type/member inference code from PowerShell, replacing internal API's with public ones. I'm testing it out there, if it goes well then porting it into PSES would make this a lot easier.

Also the OverloadDefinitions property is just an array of strings

Wow

"[System." is not recognized by Visual Studio Code Intellisence, nevertheless in PowerShell ISE is well recognized. In general, all the .net code in brackets [],is not detected in VSC.

intellisencenetexample

@Castillu84 Can you double check that the language mode on the document is set to PowerShell?

Here's the results I get

image

Hi Patrick,

I began to use Visual Studio Code few days ago. I didn't know about language mode in the document, but there's something strange anyway.The powerShell language intellisence don't work when the console is closed. In my case, this happend me. I show'll you with some screen shots:

  1. I configure PowerShell as default language:

screenshoot1

  1. I check that powershell language is configured in the right below editor, then I close the powerShell console and try to write some code when the console is off and after when console is on. This is the result.

screenshoot2
screenshoot3
screenshoot4
screnshoot5

Anyway It has easy solution. Don't close the console. First time it can be confused, but when it's known it isn't a problem. :)

Hi again,

I found it behaivor is by design. The PowerShell module need to have the integrated console run.

screenshot1

Best Regards,

Closing this issue as resolved

@SydneyhSmith going to reopen this one. Essentially, PSReadLine does parameter intellisense pretty well but it does something beyond PowerShell. This means it's possible, but we need to do extra work. It's not planned for us to work on, but is on the list of enhancements to make if anyone wants to give it a go.

Was this page helpful?
0 / 5 - 0 ratings