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
Warning when invoking explorer.newFile (fix #100604) #109905
Conversation
@bpasero I would prefer if we use a precondition to disable the command completely in that case. |
@isidorn ah ok, my understanding was that the user explicitly binds this command to a certain key? In that case, |
@bpasero I think it would help even in that case. |
@isidorn I think it is the other way around. The Do you already have a context key for the explorer being available or not? |
Try this
|
@isidorn actually you already do this here: vscode/src/vs/workbench/contrib/files/browser/fileActions.contribution.ts Lines 224 to 225 in c1031ce
via Problem is that you cannot do this on the level of commands: vscode/src/vs/workbench/contrib/files/browser/fileActions.ts Lines 926 to 938 in 744f2ab
Once you register a command, it needs to be executable always. An alternative is to simply return early from the command if the explorer is not visible instead of showing this warning... |
Then it seems like there is nothing smarter to do here. |
This PR fixes #100604