intellij-powershell icon indicating copy to clipboard operation
intellij-powershell copied to clipboard

Request: completion for .net objects

Open fluffynuts opened this issue 2 years ago • 3 comments

Regular powershell completion works fine with the plugin (eg Write-H<tab>), but even namespace-cast .net objects don't provide completion for properties and methods. Consider:

[Void][Reflection.Assembly]::LoadWithPartialName("Microsoft.Web.Administration")
$serverManager = [Microsoft.Web.Administration.ServerManager]::OpenRemote("127.0.0.1")

at this point, I'd expect to be able to do $serverManager. to list properties and methods, like I can in pwsh, or via get-member

image

Or should this be working, and I have a problem locally?

fluffynuts avatar Jan 10 '23 12:01 fluffynuts

For me, the completion works (even on an older plugin version that was available at the time, v2.0.10): image

Could you please clarify if this is the right kind of completion?

And if it still doesn't work for you on a modern plugin version, could you please upload the IDE logs to uploads.jetbrains.com and share the upload id?

Thanks!

ForNeVeR avatar Oct 01 '23 20:10 ForNeVeR

pwsh-autocompletion

In the above image, there are a few occasions where I would have really appreciated some auto-completion - and you can see the "No suggestions" popup that comes when I try to; in particular:

  • [Void] completes, but there was no help for Reflection.Assembly
  • methods off of that assembly complete, but when I get back the $serverManager, no completion - this is the initial cause of the issue I raised: not knowing the ServerManager api well, I really wanted completion here to solve the issue at hand. Members on an object can be listed with Get-Member, so, whilst I'm not sure how difficult it would be to provide completions for other parts, it seems like a call to completion after a . on an object should be solvable with a call to Get-Member on the provided object. Though, please bear in mind, I don't know what kind of model is followed in language plugins for intellij, so this may seem really simple to me, and yet, really difficult to implement irl.

It also would have been amazing if I could have gotten completions on assembly names when attempting to load by reflection, but again, this is probably a big task.

fluffynuts avatar Oct 03 '23 12:10 fluffynuts

I'll leave a note to check this issue after updating PSES (#51).

After that, it'll either be closed, or I'll file a feature request to PSES.

ForNeVeR avatar Oct 04 '23 20:10 ForNeVeR