PowerShellEditorServices icon indicating copy to clipboard operation
PowerShellEditorServices copied to clipboard

Enable IntelliSense based purely on version-specific PowerShell metadata

Open daviwil opened this issue 9 years ago • 6 comments

A fairly common request is for the editor to give IntelliSense for a particular version of PowerShell. For instance, a user on a Windows 10 machine with PowerShell 5.1 might want to emulate IntelliSense for a Windows 7 machine running PowerShell 2.0. It'd be nice if we could switch to a compatibility mode which provides cmdlet and .NET IntelliSense based on what's available on the target platform. This would also be helpful for those writing scripts using PSES on Linux and macOS since PowerShell v6 has a different cmdlet/featureset than any of the Windows PowerShell versions.

One other benefit of this feature is that it could allow us to do IntelliSense without an active runspace. This would be helpful in cloud based-editing scenarios because a hosted PSES service could give IntelliSense without the need for a running PowerShell session.

We should figure out how to integrate this into PSES before 1.0 just in case it requires any design changes. If we can implement this without changing any APIs then we could potentially push the implementation past 1.0.

/cc @kapilmb

daviwil avatar Dec 05 '16 15:12 daviwil

This might not be needed if we plan on deprecating 3/4. That said... It might be nice to do this between 5.1 and 6.

TylerLeonhardt avatar Jan 13 '18 00:01 TylerLeonhardt

I think it'd be even more necessary if we dropped PS3/4 because we would need a way to allow the user to write scripts for PS3/4 without that version of PS being available on the machine. Not really an easy problem to solve though!

daviwil avatar Jan 13 '18 00:01 daviwil

As I've said before on a different issue, I believe this functionality belongs in PSSA and as such would still be surfaced through the PSES.

rkeithhill avatar Jan 13 '18 00:01 rkeithhill

PSSA already has the PSUseCompatibleCmdlets rule for that and ships with files for PowerShell Core (alpha) on Windows/Linux/Max and for Windows PowerShell 5.1. I am currently updating the PSCore files to 6.0.2 but we could also add files for PS v3 and PS v4. you can simply generate those files by running this script and the submitting a PR into PSSA. I personally only have machines with v4 but not v3 so I hope you can help out here.

bergmeister avatar Mar 30 '18 22:03 bergmeister

Here you go, @bergmeister! 😄 desktop-3.0-windows.json.zip

TylerLeonhardt avatar Mar 31 '18 01:03 TylerLeonhardt

@tylerl0706 Thanks, I added it to this PR and made sure I gave you kudos for it in the summary.

bergmeister avatar Mar 31 '18 06:03 bergmeister