Skip to content

Extensions startup loading order #57481

Closed as not planned
Closed as not planned

Description

There has been an issue here without a potential solution: #13292

I don't want to give extensions the power to set their priority of loading in my VSCode I rather want myself setting a priority to some extensions I want to have loaded before the others.

For example, I have an extension that shows me saved projects (Project Manager) and I want this to be loaded at first to fast select a project before the rest is loaded because when I have selected a project the viewport will be reloaded anyway.

My solution, having a option like this:

"workbench.extensions.loadingOrder": {
    "alefragnani.project-manager": {
      "priority": 10000
    }
  },

all other extensions would be loaded as before after these prioritised extensions.

Activity

  1. added
    extensions
    on Aug 29, 2018
  2. added
    feature-request
    on Aug 29, 2018
  3. keelzebub commented on Oct 23, 2018

    @keelzebub

    This feature would be amazing. My use case is the exact same - I'd love the ability to set Project Manager as the first extension loaded, so I can get to work right away while other extensions are still processing.

  4. ackphill commented on Mar 2, 2019

    @ackphill

    I need same feature with different reason. I'm using vim extension and whenever I run vscode, I have to wait until vim extension being loaded before I start editing. It's quite annoying.

  5. Taoquitok commented on Mar 26, 2019

    @Taoquitok

    Commenting on this for the same reason as others, Being able to bump Project Manager to load ahead of other extensions would be a lovely way of getting to pick a project quicker.
    Even with disabling most extensions within the default load, there's enough of a slow down ahead of seeing project manager load to make me sigh each time.

  6. alefragnani commented on Mar 30, 2019

    @alefragnani

    I‘ll take a look if there is something that can be changed to make VS Code prioritize the extension.

    I didn’t look at VS Code source code yet, but maybe the excess of activationEvents may be moving it to the end. Maybe the kind of activationEvents. Maybe alphabetic reasons 😆

    Let’s see what I can find.

  7. ashkitten commented on Jul 29, 2019

    @ashkitten

    my issue is slightly different - i use direnv's nix integration to import project-specific dependencies into the shell environment when i cd into the project dir. however, even though i can create an extension to load the direnv environment in vscode, other extensions such as rls-vscode may still load before the environment is loaded, causing them to not work since the binary is not in the path yet. simply put, i need a way to delay the startup of other extensions until mine is loaded.

  8. miloslavnosek commented on Oct 25, 2019

    @miloslavnosek

    My use case would be to be able to specify which extensions take precedence over others when multiple extensions change same features.

    For instance if I install IntelliJ keybinds and Vim, IntelliJ keybinds will override some of Vim's hotkeys and I'd prefer it to be the other way around so that Vim overrides the keybinds extension hotkeys.

  9. rizary commented on Aug 25, 2020

    @rizary

    ash lea (@ashkitten) did you manage to solved your use case? I've been looking for the solution and come to this thread. And by looking at your comment, I have same case when I want to load direnv extension before other extensions.

  10. ashkitten commented on Aug 25, 2020

    @ashkitten

    no. i haven't been able to use vscode for my workflow because of this issue so i just use neovim still. bit of a shame.

  11. anka-213 commented on Nov 10, 2020

    @anka-213

    rizary (@rizary) I've been using the extension nix environment selector with some success. It does however force you to reload VS code whenever the environment changes.

  12. rizary commented on Nov 10, 2020

    @rizary

    rizary (@rizary) I've been using the extension nix environment selector with some success. It does however force you to reload VS code whenever the environment changes.

    I'm using flake and I've try that extension without success. I'm in WSL2 too, and using rust-analyzer. I've tried with Haskell-language-server extension, it works after several retry. So maybe rust-analyzer didn't do retry as haskell-language server did

  13. 3 remaining items

  14. PellegattaSimone commented on Apr 23, 2021

    @PellegattaSimone

    Has anybody found a solution?

  15. Dimfred commented on Jul 19, 2021

    @Dimfred

    This is why I am thinking of switching to neovim. That really bugs me. Would be great to have a fix for that.

  16. impl commented on Sep 1, 2021

    @impl

    ash lea (@ashkitten), rizary (@rizary),

    I had the same issue as you. If you're comfortable with defining all of your extensions in Nix, e.g. using Home Manager, you can hack around this like so:

    {
      programs.vscode = {
        enable = true;
        package = pkgs.vscode.overrideAttrs (old: {
          buildInputs = old.buildInputs or [] ++ [ pkgs.makeWrapper ];
          postInstall = old.postInstall or [] ++ [ ''
            wrapProgram $out/bin/code --add-flags '--force-disable-user-env'
          '' ];
        });
        extensions = let
          loadAfter = deps: pkg: pkg.overrideAttrs (old: {
            nativeBuildInputs = old.nativeBuildInputs or [] ++ [ pkgs.jq pkgs.moreutils ];
    
            preInstall = old.preInstall or [] ++ [ ''
              jq '.extensionDependencies |= . + $deps' \
                --argjson deps ${escapeShellArg (builtins.toJSON deps)} \
                package.json | sponge package.json
            '' ];
          });
        in
          pkgs.vscode-utils.extensionsFromVscodeMarketplace [
            {
              publisher = "cab404";
              name = "vscode-direnv";
              version = "1.0.0";
              sha256 = "sha256-+nLH+T9v6TQCqKZw6HPN/ZevQ65FVm2SAo2V9RecM3Y=";
            }
          ] ++ map (loadAfter [ "cab404.vscode-direnv" ]) (
            with pkgs.vscode-extensions; [
              bbenoist.nix
              editorconfig.editorconfig
              golang.go
            ] ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [
              {
                publisher = "mrded";
                name = "railscasts";
                version = "0.0.4";
                sha256 = "sha256-vjfoeRW+rmYlzSuEbYJqg41r03zSfbfuNCfAhHYyjDc=";
              }
            ]
          );
      };
    }

    This modifies all the extension packages to depend on the direnv extension using extensionDependencies. (Not sure if the force-disable-user-env wrapper is required or not. Feel free to try without.) All in all, not great, but it gets the job done...

  17. muuvmuuv commented on Sep 3, 2021

    @muuvmuuv
    ContributorAuthor

    I do still believe this can get things up quicker and also reduce flickering for highlighting in code like with lately released typescript features but I am on a Apple Silicon now and its just that fast I do not need to disable and extension anymore its just up and running in a second. Still in a future with more and more fratures coming into code and more plugins beeing heavy lifters it will be required to have something like a loading order or manual delay

  18. sisrfeng commented on Nov 4, 2021

    @sisrfeng

    I need same feature with different reason. I'm using vim extension and whenever I run vscode, I have to wait until vim extension being loaded before I start editing. It's quite annoying.

    Sometimes I make my code dirty by accident because of this

  19. offlinehacker commented on Aug 30, 2022

    @offlinehacker

    I have implemented a workaround for vscode remote containers, where dependencies (on specific other extension) are injected on the fly while extensions are being installed. It's ugly, but it works https://github.com/xtruder/nix-devcontainer/tree/main/src/ext-preloader. Having extension priorities or at least a way how to make extension to load before other extensions, would make life so much easier.

  20. milahu commented on Oct 15, 2022

    @milahu

    nix workaround with nix-env

    useful for unprivileged users (if you have no root access to the remote machine)

    # pkgs.nix
    /*
    based on
    https://discourse.nixos.org/t/how-can-i-set-up-my-rust-programming-environment/4501/9
    */
    let
      rust_overlay = import (builtins.fetchTarball "https://github.com/oxalica/rust-overlay/archive/master.tar.gz");
      pkgs = import <nixpkgs> { overlays = [ rust_overlay ]; };
      rustVersion = "latest";
      #rustVersion = "1.64.0";
      rust = pkgs.rust-bin.stable.${rustVersion}.default.override {
        extensions = [
          "rust-src" # for rust-analyzer
        ];
      };
    in
    {
      inherit rust;
      inherit (pkgs) rust-analyzer cargo-watch;
    }
    nix-env -q # list installed packagaes
    nix-env -e '.*' # uninstall all packages from nix-env
    
    # install rust toolchain
    nix-env -f ./pkgs.nix -i -A rust
    nix-env -f ./pkgs.nix -i -A rust-analyzer
    nix-env -f ./pkgs.nix -i -A cargo-watch
    cargo --version; rustc --version # check versions
    nix-env -q # list installed packagaes
    
    # install more tools ...
    nix-env -f '<nixpkgs>' -i -A jq
    nix-env -f '<nixpkgs>' -i -A screen
    nix-env -f '<nixpkgs>' -i -A gcc
    nix-env -f '<nixpkgs>' -i -A gnumake
    nix-env -f '<nixpkgs>' -i -A python3
    nix-env -f '<nixpkgs>' -i -A nodejs-16_x # for vscode-server
    
    nix-env -e screen # uninstall some package

    im sure there are prettier ways to do this, but this works ...

  21. added
    *out-of-scope
    on Dec 6, 2022
  22. vscodenpa commented on Dec 6, 2022

    @vscodenpa

    We closed this issue because we don't plan to address it in the foreseeable future. If you disagree and feel that this issue is crucial: we are happy to listen and to reconsider.

    If you wonder what we are up to, please see our roadmap and issue reporting guidelines.

    Thanks for your understanding, and happy coding!

  23. anka-213 commented on Dec 6, 2022

    @anka-213

    Isidor Nikolic (@isidorn) This indeed a crucial feature for several use cases as many people have already expressed in this thread. Several of the cases have no known workaround

  24. milahu commented on Dec 6, 2022

    @milahu
  25. The-Compiler commented on Dec 6, 2022

    @The-Compiler

    I'm also a bit confused by the guidelines linked above - they say (emphasis mine):

    Here are the criteria we use to make the decision about closing a feature request:

    1. [...]
    2. Has the community at large expressed interest in this functionality? I.e. has it gathered more than 20 up-votes or more than 20 comments? This criterion alone covers more than 650 of the 2850 open feature requests as of right now, October 9th, 2019.
    3. [...]

    If the answer to any of the three questions is yes then we ask about affordability:

    1. Can our team afford to implement the feature? I.e. are the costs to implement the functionality reasonable compared to the size of our team?

    In summary, a feature needs to pass one of 1-3 and 4. Otherwise, we'll close it as out of scope. We'll unsubscribe from these issues to reduce the overall number of issue notifications we receive every day.

    Clearly 2. is true (49 upvotes, 20 comments at the time this was closed). Thus, this would imply that the costs of implementing this are unreasonable compared to the size of the VS Code team?

    I find this hard to believe. I'm well aware of the trap of saying something "must be easy" without actually putting in the work (or knowing the codebase). However, even a simple solution (like having a list of extension names in the config being loaded before the rest) seems like it would help with a lot of use-cases people have mentioned here - including mine, using extensions like Vim or VSpaceCode and wanting them to be responsible as early as possible after starting VS Code.

  26. crxyz0 commented on Jun 10, 2023

    @crxyz0

    Any updates? I have the same VSCodeVim issue and would really like this feature. My computer isn't that fast and it takes ~5 seconds before Vim loads and I can actually edit the file.

  27. zimbatm commented on Jun 17, 2023

    @zimbatm

    I believe this issue impacts many users, but they don't know that the root cause is the extension loading order issue. From their perspective, VSCode is just unstable. Sometimes it works, sometimes they have to restart the editor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    *out-of-scopeextensionsfeature-request

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions