cyberbiont / vscode-profiles

vscode plugin to easily manage multiple extensions / settings configurations
ISC License
26 stars 2 forks source link

Profile creation does not work #1

Closed rlnt closed 3 years ago

rlnt commented 3 years ago

First of all, I am glad I found your extension! I was searching for something like this for quite a while now.

After installing and adjusting the settings, I realized that the extension is currently not usable for me. No matter which command I run, I always get an error and nothing happens.

I tried to create a test profile. After using the create command, the extension still shows the prompt for the profile name but after hitting enter again, I get: Cannot read property 'name' of undefined Here is the log: https://pastebin.com/H6VtY4Ts

Nothing has changed in my .vscode folder as well.

Information: OS: Windows 10 Pro Version 20h2 VSCode: 1.55.1 Extension: 1.0.1

I didn't look at the code of the extension yet but is this extension compatible with Windows? Symlinks are a Linux thing but Windows has a similar thing called mklink. I also have WSL2 running Ubuntu 20.02 but the VSCode instance I tried this extension with is on Windows.

cyberbiont commented 3 years ago

Hi, thanks for reporting this! The extension is compatible with Windows (I am on Windows 10 Pro 1909). Symlinks are supported on Windows since Vista I know what the problem is, will fix it today

cyberbiont commented 3 years ago

I have uploaded fixed version 1.0.2, please try it

rlnt commented 3 years ago

same error log: https://pastebin.com/8Us9NTwY

This time, at least a profiles folder was created in .vscode but nothing is in there.

cyberbiont commented 3 years ago

OK, now I nailed it, it is caused by permissions problem. I updated README on this matter https://github.com/cyberbiont/vscode-profiles/blob/main/README.md#installation Please try again v.1.0.3

rlnt commented 3 years ago

After unlocking the folder with lock-hunter, the symlink creation worked but I still can't create new profiles and all other commands also throw errors. Log: https://pastebin.com/8PjT9ha2

cyberbiont commented 3 years ago

Do you run VS Code as Administrator? Also, what permissions do you have set on .vscode folder (check them on Security tab in folder context menu)

rlnt commented 3 years ago

If it's not automatically run in admin mode, then no. they have full access.

cyberbiont commented 3 years ago

I believe SYSTEM permissions that are shown do not apply, because NodeJs is running from under VSCode, which in turn runs under User profile (the one that you had painted over). Try to run VS Code as administrator and see if it fixes the problem. Also check permissions under your. ... web.de user profile

rlnt commented 3 years ago

My user profile has the same permissions as system. When running VSCode as admin, the extension creates the profiles\Default profile with all extension symlinks in there. When I create a new profile, it works now but the folder which is created for the profile is completely empty and when trying to switch to it, nothing happens and the status bar shows this:

cyberbiont commented 3 years ago

Cannot reproduce it on my system, sorry... It works as expected for me here. The status like this is likely to happen if "switch profiles" command didn't work for some reason and you try to execute it again (if it failed, the profile directory will be empty because "switch profiles" action is what triggers "common" extensions auto-installation).

You can locally clone this repository and run "Run extension" debug configuration to debug switchProfileCommand method in actions.ts (set some breakpoints or go step-by-step, run command from the newly opened VSCode window and see where it fails). I will appreciate more information of this, cause right now I'm out of time and ideas what could possibly going wrong....

P.S. Set ./.vscode/settings.json "profiles.developmentMode": to false so that any created profile will get vscode-profiles automatically installed from Marketplace.

cyberbiont commented 3 years ago

I have checked installation from the scratch on the fresh Windows 10 inside the virtual machine and everything seems to works fine (even without un-locking etc.)

BTW, I forgot to mention that when you create profile, only the empty folder is created; extension is auto-installed there only when you switch to it. So this is normal.

rlnt commented 3 years ago

Yeah but switching doesn't do anything and the maintenance command also errors.

cyberbiont commented 3 years ago

@DAmNRelentless See if the latest release resolves your problem. I found out that 'remote' SSH/WSL/Containers extensions may cause problems if your have them installed so I excluded them from management.

rlnt commented 3 years ago

I have those three extensions because I am mostly working on WSL but even with the newest version, it does not seem to work. I created my test profiles without any issues but switching to them does not work. I tried switching from my default profile to my all profile which just has all extensions activated. This didn't work so I tried switching to my rust profile and the same thing happens so I have this again:

I ran VSCode as admin and even tried uninstalling the remove development extensions first.

cyberbiont commented 3 years ago

Do you see any errors in Debug Console or Output -> Profiles when trying to switch?

rlnt commented 3 years ago

Oh sorry, I forgot to attach the link. Yes, it seems like there are permission errors with renaming the folders. Although I ran VSCode as admin. https://pastebin.com/PqqtNm0R

In case you need my settings too: Auto Switch: Initial true Extensions: Common coenraads.bracket-pair-colorizer-2 Extensions: Symlinkify true the rest is default

cyberbiont commented 3 years ago

It seems like the problem is with 'vscode-icons' extension in your case. I think in the next version I will expose an option to exclude extensions from management to fight such problems. Meanwhile, you can try to disable / uninstall it.

rlnt commented 3 years ago

Maybe it's not possible to manage design extension when they are in use. Seems like the folders for these extensions are locked so your extension can't modify them. I guess things like color schemes and icon packs are affected as well.

cyberbiont commented 3 years ago

Personally I don't have any troubles with those... All themes and icons packs that I have are treated like everything else, and I cannot reproduce your situation with 'vscode-icons'. Maybe it also depends on how permissions are set on one's system...

I think the better solution may be to just ignore EPERM errors so the process will handle those extensions that may be replaced with symlinks and leave others as they are to try the next time. If they seem hopeless, they may be added to extensions.excuded to ignore them altogether.

I will do some testing and implement this in the next release.

rlnt commented 3 years ago

Thanks a lot! Sorry for giving you such a headache haha. Hope this will be less of a trouble when MS comes up with their own profile system in the future.

Funny thing is that I also tried it on my laptop which also runs on Windows 10 with WSL and I get the same issue there. I don't know what could be so different with my permission system that I run into these errors.

cyberbiont commented 3 years ago

No problem, at least I get a free QA assistance, heh))

Ok, here we go again) Release 1.1.1 will hopefully work for you at last

rlnt commented 3 years ago

Okay, it's actually the first time that it does something when switching profiles. I guess there is no way of blocking the annoying install pop-up for each extension when switching to a new profile for the first time, right? It installs the extensions I defined in the always install list just fine when clicking through all the pop-ups and it's only when switching to the profile for the first time.

But it works. Finally! We had some serious headaches here but it looks like it was worth it. :D

And as my first little feature request, it would be nice to be able to clone the default profile so you can have all your currently installed extensions and uninstall those you don't want for the profile. In my default profile, I have extensions for TypeScript and Rust development and I would like to clone this to a TypeScript profile and then just delete all the rust stuff. Would that be possible?

And also, the settings are not profile specific, right? Since they are stored in the settings.json anways.

cyberbiont commented 3 years ago

Glad to here that!

I guess there is no way of blocking the annoying install pop-up for each extension when switching to a new profile for the first time, right?

Hmm, I never have any popups when installing extensions (no matter, with vscode-profiles or manually). Probably there's some VS Code option that controls it, but I have set it too long ago to remember what it is.

And as my first little feature request, it would be nice to be able to clone the default profile so you can have all your currently installed extensions and uninstall those you don't want for the profile.

You can do this. Use the dedicated clone command, start from cloning any profile, then just delete the stuff that you don't need.

And also, the settings are not profile specific, right? Since they are stored in the settings.json anways.

You can have profile-specific settings by using Vscode-profiles with SettingsCycler. The corresponding settings will be automatically applied each time when switch to another profile. Read more in a dedicated section in documentation.

rlnt commented 3 years ago

Hmm, I never have any popups when installing extensions (no matter, with vscode-profiles or manually). Probably there's some VS Code option that controls it, but I have set it too long ago to remember what it is.

When installing extensions via the extension browser, I don't have a pop-up either. I will dig a bit through the settings to find out whether this is configurable and report back results.

You can do this. Use the dedicated clone command, start from cloning any profile, then just delete the stuff that you don't need.

That's what I tried but you aren't able to clone the default profile. Only if you already have existing custom profiles.

You can have profile-specific settings by using Vscode-profiles with SettingsCycler.

No, it's fine. I just wanted to make sure my global config is still applied. :)

cyberbiont commented 3 years ago

Didn't have much time lately, but here I am.

That's what I tried but you aren't able to clone the default profile. Only if you already have existing custom profiles.

Default profile is just like any other profile, so surely you should be able to clone it.

The original issue was resolved, so I think I will close this for clarity. Feel free to open new issues if you still experience other problems.

And thanks for the nice review, by the way)