Skip to content
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

[FEATURE] - Add support to Profile for Projects #281

Closed
muuvmuuv opened this issue Jun 6, 2019 · 31 comments
Closed

[FEATURE] - Add support to Profile for Projects #281

muuvmuuv opened this issue Jun 6, 2019 · 31 comments
Labels
depends on Depends on issues from VS Code enhancement
Milestone

Comments

@muuvmuuv
Copy link

muuvmuuv commented Jun 6, 2019

Some time ago I tried reach out to VS Code team to allow projects to have an extensions file (in .vscode folder) where I can say which extensions I want to have enabled or disabled, sadly it got rejected.

I work with different type of projects, some requires PHP extensions, some have only NodeJS/JavaScript, TypeScript, Go and so on. My idea was to have a file or a config section somewhere where I can say in which projects/folder I want to have extensions enabled or even disabled in some cases. This would reduce the startup time heavily in my case.

I thought about ways how this could be done and now my idea is to have my projects managed together with my extensions I want to have enabled for my projects. So the best solution is to combine them in the project manager where a new object extensions would allow extension to be enabled/disabled. I don't know if this is possible but I think this is something that belongs here.

@muuvmuuv
Copy link
Author

muuvmuuv commented Jun 6, 2019

@muuvmuuv
Copy link
Author

muuvmuuv commented Jun 6, 2019

Something like this I guess.

const projects = [
  {
    enabled: true,
    name: 'Test',
    rootPath: '$home/Test',
    group: 'testings',
    extensions: {
      'ms-vscode.vscode-typescript-tslint-plugin': true,
      'rebornix.ruby': false
    }
  }
]

projects.forEach(({ extensions }) => {
  Object.keys(extensions).forEach((extName, active) => {
    const ext = vscode.extensions.getExtension(extName)
    if (!ext) {
      // not a known extension
      return
    }
    if (active) {
      ext.activate()
    } else {
      // deactivate extension here
    }
  })
})

@alefragnani
Copy link
Owner

Hi @muuvmuuv ,

Well, this is not the extension's original idea, which is simply to give you easy access of your favorite projects, but I agree this is a great addition to the workflow.

But I'm wondering, why VS Code does not support it natively (using a local file), just like it does for Extension Recommendations (.vscode\extensions.json file). I mean, it already supports Enabling / Disabling extensions per workspace, so you already have that. The only difference is that it does not use a local file to store the enabled/disabled extensions, but probably uses the VS Code internal storage (workspace based).

I don't know when you reach out VS Code team asking for this, but maybe it was prior this Enable/Disable extension per workspace feature being implemented (I guess it happened last year). If that is the case, I think if you ask them again, it could be natively supported using .vscode\extensions.json file.

My main concern about adding this to the extension (besides not being it's original idea) is because some extensions requires reloading the workspace when you enable/disable it. I'm not sure why it does happen, and what could be done to detect, in order to avoid/warn the user. Without this issue, as you already commented, it's doable :-).

Hope this helps

@alefragnani alefragnani added depends on Depends on issues from VS Code enhancement need more info labels Jun 28, 2019
@muuvmuuv
Copy link
Author

Ah I see some people already asked that again in VSCode, haven't checked that before. So hopefully they will add this soon ^^ And yes it was before the Extension Recommendations, don't get it why they implemented this, never have used this because it's so uncomfortable to use.

I just thought it would be a great combination with projects/workspaces in one destination. Anyway I still think this extension should be natively supported 😆 Code is on a good way to get a nice IDE but Project Management is missing and I really don't know why they don't want it.

microsoft/vscode#40239

@oshliaer
Copy link

I can't understand how does this feature would binding to the current project?

I think it would be great to add parameters for exec the code to the project manager settings file. For an example:

[
  {
    "name": "google_spreadsheets_chat_bot",
    "rootPath": "/raid/user/gitlab.com/blah-blah ",
    "paths": [],
    "group": "",
    "enabled": true,
    "args": "--extensions-dir /home/user/yada-yada"
  }
]

It would let us to use more flexible options. Using exported variables would be great too. "before runs triggers" are appreciated too.

@alefragnani
Copy link
Owner

Hi @oshliaer ,

Thank you for your suggestion, but to switch between projects, the extension does not use code command line but the openFolder command (VS Code API) and it does not provide args to add.

I'm not sure such extensibility is possible, because some of the command args may define how VS Code will open, so I guess to accomplish such feature, it would indeed need to use code command line args. It's not something that I would like to bring back (at the early days of the extension, it worked this way), but I wouldn't say it won't happen 😄 . I'll move it to its own issue.

Hope this helps

@alefragnani
Copy link
Owner

@muuvmuuv ,

It appears my concerns about enabling/disabling extensions were real. A new extension called Profile Switcher already has a few open issues about it:

https://github.com/aaronpowell/vscode-profile-switcher/issues/

I'll keep watching its evolution, but if these errors didn't get fixed, I'll cancel the issue.

Hope this helps

@muuvmuuv
Copy link
Author

Sounds reasonable for me. The extension looks good but I don't want to have this separated if it's possible 😄

@alefragnani
Copy link
Owner

Hi @muuvmuuv ,

I did take a look at Profile Switcher extension to see it evolution and just noted that it does not really _ disable/enable_ extensions but uninstall/install instead. That's not something that I would like to do, because installation is not a workspace feature.

For now, there is no API to deactivate extensions, just activate. For some reason the VS Code team decided to store this info in internal storage, not settings.json/extensions.json.

I'll keep looking

@alefragnani
Copy link
Owner

Depends on microsoft/vscode#84997

@alefragnani
Copy link
Owner

Just recently (microsoft/vscode#84997 (comment)) the dependency issue has been moved to “Backlog Candidate” by the VS Code team, which means it has 60 days to receive enough attention (upvotes), otherwise it will be closed.

So, for those of you interested in this issue to be possible, go to the VS Code repo and upvote.

@oshliaer
Copy link

There are 12 👍 now.

@rlnt
Copy link

rlnt commented Mar 8, 2021

Such a feature would be extremely nice to have to improve the overall performance of VSCode as well.

I am working on many different projects with different languages and some extensions I don't use for specific languages simply drain performance. The profile switcher extension is a good idea. There is also an extension disabler extension but they are all not working with WSL and are unmaintained.

@alefragnani
Copy link
Owner

Hi @DAmNRelentless ,

The VS Code team is working on a new feature, temporarily called Profiles, and according to its issue (microsoft/vscode#116740), it would allow enable/disable extensions per profile, via config file (microsoft/vscode#40239).

It's great news 🎉

@rlnt
Copy link

rlnt commented Mar 8, 2021

That's really awesome to hear!
Would you implement the profiles feature into the project manager then?
Like load a specific profile with each project automatically?

@alefragnani
Copy link
Owner

Maybe. It depends on how it will end up being developed by the VS Code team.

If it only loads from the .vscode/settings.json file, I'll probably do nothing about it. You just have to add that setting to your project, and when you switch between projects, it will load the proper Profile

If they provide a Load Profile command/API that applies a Profile, then each project could have a profile attribute.

Let's see 😬

@depascalis
Copy link

depascalis commented Sep 27, 2021

There's also this extension that came out in April vscode-profiles. I haven't tested it yet but I'm installing it now. It is somewhat of a hack with symlinks etc, but that's what's needed when there's no API to work with.

Edit: This extension looks to be more trouble than it's worth. You can't have different profiles in different windows. My impression is that it installs/uninstalls extensions when activating profiles. There are too many hacks. I wonder how it works with the settings for the web version of vscode.

@rlnt
Copy link

rlnt commented Sep 27, 2021

There's also this extension that came out in April vscode-profiles. I haven't tested it yet but I'm installing it now. It is somewhat of a hack with symlinks etc, but that's what's needed when there's no API to work with.

Edit: This extension looks to be more trouble than it's worth. You can't have different profiles in different windows. My impression is that it installs/uninstalls extensions when activating profiles. There are too many hacks. I wonder how it works with the settings for the web version of vscode.

I've also used this. I literally tested all available profile and extension disabler extensions there are. None of them is really good.
I stick to this extension for now although it has way more features than I need.

@alefragnani
Copy link
Owner

Personally, I hope that the native User Profile feature the VS Code team is planning (microsoft/vscode#116740) would work on all scenarios.

At least based on the description, it seems they are aware of the per profile extension enablement.

Let’s see how it goes

@GHOSTS15
Copy link

GHOSTS15 commented Oct 2, 2021

@muuvmuuv after 4 years they realized that maybe they had to implement it

@miguelsmuller
Copy link

leaving a comment here just to follow the debate.
I have this need to control plugins on a daily basis and I also never found anything that could help me.

@alefragnani
Copy link
Owner

Hi @miguelsmuller ,

I suggest you to keep track on microsoft/vscode#116740 as well, because I hope this feature will be added natively in VS Code.

Hope this helps

@hongwen000
Copy link

Any news here?

@alefragnani
Copy link
Owner

I’m waiting to see how the new Profiles feature will work. But it seems (based on a few tests) that VS Code remembers the previous profile you were using for an specific project.

So, if you open a project and select/activate a profile, the next time you open that project, it will load that same profile.

But, it is not a stable experience, yet, as it did not recovered the previous profile in some testes.

Let’s see.

@alefragnani
Copy link
Owner

Just forgot to comment here about the Feature Request that the VS Code team asked me to create - microsoft/vscode#156173. With this new API, I would be able to open a project with a pre-defined Profile.

I think this is good news, and with that, this feature could be finally released.

Stay tuned

@ekarious
Copy link

ekarious commented Feb 3, 2023

Opening a folder with a specific profile should be happening very soon now !
Thanks for all the work @alefragnani

@alefragnani
Copy link
Owner

For sure 😬

@alefragnani alefragnani added this to the Backlog milestone Feb 4, 2023
@alefragnani alefragnani changed the title Enable/Disable extensions for projects [FEATURE] - Add support to Profile for Projects Feb 4, 2023
@gongyuan303
Copy link

@alefragnani 【Add support to Profile for Projects 】 When can I publish it?

@alefragnani alefragnani modified the milestones: Backlog, April 2023 May 10, 2023
@alefragnani
Copy link
Owner

Playing with it and it seems to be working just fine, and should be available in the next release.

Then, I wonder if add the possibility to assign profiles to Tags as well would be a good improvement to the next update 😬

@macintacos
Copy link

@alefragnani just checking in - is there any ETA for releasing this feature?

@zhuoqun-chen
Copy link

Playing with it and it seems to be working just fine, and should be available in the next release.

Then, I wonder if add the possibility to assign profiles to Tags as well would be a good improvement to the next update 😬

yeah, really expecting this new feature! That's gonna be amazing, thx @alefragnani !

@alefragnani alefragnani modified the milestones: February 2024, Backlog Mar 22, 2024
@alefragnani alefragnani modified the milestones: Backlog, Next Release Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
depends on Depends on issues from VS Code enhancement
Projects
None yet
Development

No branches or pull requests