Skip to content

Extension commands loaded in PowerShell profile are not being registered #396

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

Closed
gerane opened this issue Dec 17, 2016 · 18 comments
Closed
Labels
Issue-Bug A bug to squash.
Milestone

Comments

@gerane
Copy link

gerane commented Dec 17, 2016

System Details

  • Operating system name and version: Windows 10
  • VS Code version: 1.9.0 Insiders
  • PowerShell extension version: 8.0
  • Output from $PSVersionTable:

Name                           Value                                                               
----                           -----                                                               
PSVersion                      5.1.14393.187                                                       
PSEdition                      Desktop                                                             
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                             
BuildVersion                   10.0.14393.187                                                      
CLRVersion                     4.0.30319.42000                                                     
WSManStackVersion              3.0                                                                 
PSRemotingProtocolVersion      2.3                                                                 
SerializationVersion           1.1.0.1                                                             

Issue Description

When trying to load the Editor Command menu, v8.0 throws the following error

No extension commands have been loaded into the current session.

The logs show that my Editor Commands were successfully registered. They are in my VSCode profile.

Attached Logs

Here are the logs Gist

@daviwil daviwil added the Issue-Bug A bug to squash. label Dec 18, 2016
@daviwil
Copy link
Contributor

daviwil commented Dec 18, 2016

I might have broken something here, will investigate for 0.8.1

@daviwil daviwil added this to the 0.8.1 milestone Dec 18, 2016
@nightroman
Copy link

Same issue here. I think it happened on upgrading VSCode-PowerShell from 0.7.2 to 0.8.0. Upgrading VSCode itself to 1.8.0 did not cause this problem.

@gerane
Copy link
Author

gerane commented Dec 19, 2016

@daviwil same on my work desktop. Let me know if I can help with anything else or could help test any changes.

@daviwil
Copy link
Contributor

daviwil commented Dec 19, 2016

I just checked it, looks like I broke profile loading in general. Looking into it now

@daviwil
Copy link
Contributor

daviwil commented Dec 19, 2016

Profile loading is fine, was just testing with the wrong profile path :/ This looks like it's caused by an event sequence I hadn't accounted for when I totally redesigned the extension code. Fixed it, PR incoming! I'll be shipping an update in the next couple of days so this fix will go out with it.

@daviwil daviwil changed the title Error: No extension commands have been loaded into the current session. Extension commands loaded in PowerShell profile are not being registered Dec 19, 2016
@gerane
Copy link
Author

gerane commented Dec 19, 2016

@daviwil yeah, was going to say that this also doesn't work when using f8 or running the register command either. Profile is running and commands output as being registered, but not showing up as having any registered.

Anyway I can get the fix for my local build for the time being? I may have to revert to previous version if not. Totally kills my workflow without them lol.

@daviwil
Copy link
Contributor

daviwil commented Dec 19, 2016

@gerane It should be working when you use F8 on an editor command registration after the profile has been loaded. Are you saying it isn't working in that case?

Here's a preview drop, I didn't bump the version number so you might need to uninstall the existing 0.8.0:

PowerShell-0.8.0.zip

Rename .zip to .vsix and use the VSIX installation command in VS Code.

@gerane
Copy link
Author

gerane commented Dec 19, 2016

@daviwil ok, that is working now actually. It wasn't working on my laptop though.

@gerane
Copy link
Author

gerane commented Dec 19, 2016

@daviwil is there a cli for installing a vsix, or only the one in the GUI?

@daviwil
Copy link
Contributor

daviwil commented Dec 19, 2016

I've only seen the one in the GUI, not sure if they give a CLI path.

@gerane
Copy link
Author

gerane commented Dec 19, 2016

@daviwil I may see if just highlighting and running one works out. When I registered one, they all were visible. I couldn't get that to work on my laptop, but this is likely ok for me until you get that fix out.

I can test that one if you need me to though.

@daviwil
Copy link
Contributor

daviwil commented Dec 19, 2016

I'm pretty sure highlighting and running will work. The only problem I saw in the code was when the commands are registered in your profile, the registration events happen too early for the extension command code in the extension to catch them.

@gerane
Copy link
Author

gerane commented Dec 19, 2016

@daviwil hmm, let me retest. Just noticed the window I was in still had 7.2 loaded and hadn't been reloaded since the update

@gerane
Copy link
Author

gerane commented Dec 19, 2016

@daviwil yeah, running f8 still doesn't register the commands.

@gerane
Copy link
Author

gerane commented Dec 19, 2016

@daviwil let me grab that zip and try that out.

@daviwil
Copy link
Contributor

daviwil commented Dec 19, 2016

If it doesn't work, grab logs and send them to me?

@gerane
Copy link
Author

gerane commented Dec 19, 2016

@daviwil Yup, that worked. However, highlight + f8 didn't work prior to the fix. I tested f8 as well just to make sure, and it works with the changes.

@gerane
Copy link
Author

gerane commented Dec 19, 2016

@daviwil Now to test out multi select =)

EDIT: multi select is awesome!

daviwil added a commit that referenced this issue Dec 19, 2016
Fix #396: Extension commands loaded in profile are not being registered
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug A bug to squash.
Projects
None yet
Development

No branches or pull requests

3 participants