How to implement my QuickAccess Service? #476
-
Hello! I would like to know what is the correct way to override services so that I can filter which commands will be available in the Command Palette. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
I'm not sure just hiding the command from the command palette would be enough to ensure that the user can install remote extensions. Maybe you can put the extension directory as readonly on the server side? If you still want to just hide some command, there is no built-in way, but you can probably hack it with something like that: import { CommandsQuickAccessProvider } from '@codingame/monaco-vscode-quickaccess-service-override/vscode/vs/workbench/contrib/quickaccess/browser/commandsQuickAccess'
const original = CommandsQuickAccessProvider.prototype['getCommandPicks']
CommandsQuickAccessProvider.prototype['getCommandPicks'] = async function (this: CommandsQuickAccessProvider, token: CancellationToken) {
let result = await original.call(this, token)
return result.filter(commandPick => <whatever you want>)
} |
Beta Was this translation helpful? Give feedback.
I'm not sure just hiding the command from the command palette would be enough to ensure that the user can install remote extensions.
Maybe you can put the extension directory as readonly on the server side?
If you still want to just hide some command, there is no built-in way, but you can probably hack it with something like that: