Update caller side of CommandService to use unknown instead of any for args#270084
Merged
mjbvz merged 1 commit intomicrosoft:mainfrom Oct 6, 2025
Merged
Update caller side of CommandService to use unknown instead of any for args#270084mjbvz merged 1 commit intomicrosoft:mainfrom
unknown instead of any for args#270084mjbvz merged 1 commit intomicrosoft:mainfrom
Conversation
…y` for args Part of microsoft#269213 Updates the command service to use `unknown` for args. Does not yet update `ICommandHandler` as this will require many more changes
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR updates the command service and related components to use unknown instead of any for command arguments, improving type safety without affecting runtime behavior. This change is part of a larger effort to reduce the use of any types throughout the codebase.
Key Changes
- Updated command argument types from
any[]tounknown[]in the command service interface and implementations - Modified command handlers and test mocks to use the new typing
- Updated protocol definitions for extension host communication
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/services/commands/common/commandService.ts | Updated main command service implementation to use unknown[] for arguments |
| src/vs/workbench/contrib/scm/browser/scmViewPane.ts | Updated SCM action button command execution to use unknown[] |
| src/vs/workbench/contrib/notebook/test/browser/notebookExecutionService.test.ts | Updated test mock command service to use unknown[] |
| src/vs/workbench/api/common/extHostCommands.ts | Updated extension host command execution methods to use unknown[] |
| src/vs/workbench/api/common/extHost.protocol.ts | Updated protocol interface for command execution to use unknown[] |
| src/vs/workbench/api/browser/mainThreadCommands.ts | Updated main thread command execution to use unknown[] |
| src/vs/platform/keybinding/test/common/abstractKeybindingService.test.ts | Updated keybinding service tests to use unknown[] |
| src/vs/platform/commands/common/commands.ts | Updated core command interface and event definitions to use unknown[] |
| src/vs/editor/test/browser/services/openerService.test.ts | Updated opener service test mock to use unknown[] |
| src/vs/editor/test/browser/editorTestServices.ts | Updated test command service to use unknown[] |
| src/vs/editor/standalone/browser/standaloneServices.ts | Updated standalone command service to use unknown[] |
connor4312
approved these changes
Oct 6, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #269213
Updates the command service to use
unknownfor args internally. Does not yet updateICommandHandleras this will require many more changesTyping only change. Shouldn't have any runtime impact