-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
Hurried Command not found
error because the extensions are not loaded yet
#34913
Comments
I also have this problem primarily with this extension https://marketplace.visualstudio.com/items?itemName=felipecaputo.git-project-manager Where I would:
|
That we don't do and that's on purpose. Editor commands, esp. typing, is being dispatched the same way and we don't want to block typing by slow extension activations. Unlikely, that we are changing this in the near future |
@jrieken If the issue with my original proposal is performance what about this:
So that when a command is triggered:
Performance-wise the parsing step should be pretty fast, and most importantly it can be cached, a re-parse is only really needed if an extension is updated/installed. This still won't fix the problem for dynamically registered commands, but I don't see much that can be done about them. |
There was a gap (the time the workbench comes up until the time extension's We changed the heuristic during this time to be:
|
@alexandrudima I'm still getting this issue using the Insiders build (89b158e 2017-11-24T06:03:48.383Z), am I doing something wrong? |
@fabiospampinato We need to ask the author of that extension to enrich the activation events of the extension from When pressing |
@alexandrudima Thanks for the explanation. I don't think this is a good enough solution though. By using Why is VSC looking for commands inside I'm actually the author of that extension, and 19 others, and it bothers me that I have to update them because of this issue. There's no way those thousands of other extensions are going to get updated. |
I agree with you. The root problem is that there are two kinds of commands getting invoked via the command service: built-in core commands and contributed extensions commands. There is a third, more rare case, where a built-in command is overwritten by a contributed command (e.g. the vim extension overwrites the built-in Now, the problem is that when dispatching a command, the command service has an We need to bring in more knowledge about the two distinct kinds of commands to the command service. |
I think an easy (maybe temporary) fix for this might be to add the following logic to the bit of code that extracts activation events from an extension: if one of the activation events is |
To verify:
{
"publisher": "alex",
"name": "34913",
"version": "0.0.0",
"engines": {
"vscode": "^1.0.0"
},
"activationEvents": [
"*"
],
"main": "index.js"
}
const vscode = require('vscode');
exports.activate = function () {
vscode.commands.registerCommand(`hello`, () => {
console.log(`hello!`);
});
} * {
"key": "cmd+1",
"command": "hello"
} Open VSCode and press |
I often switch between different projects and execute a shortcut right away, for instance for spawning a terminal via Terminals.
The problem is that I often get some quite annoying
Command "whatever" not found
, just because the extensions providing those commands have not been loaded yet.I believe Code should behave like this:
Or always wait until the extensions are loaded, in order to avoid executing the wrong command, for instance if an extension overrides a default shortcut.
What do you think?
The text was updated successfully, but these errors were encountered: