mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 13:00:58 +00:00
Require more explicit strict null typing for executeCommand
Fixes #136906 Some commands never return undefined, so the current typings are incorrect. Instead we should require the caller to pass in `| undefined` if undefined can be returned
This commit is contained in:
parent
c8a321ae17
commit
bb764173a3
4
src/vscode-dts/vscode.d.ts
vendored
4
src/vscode-dts/vscode.d.ts
vendored
|
@ -8598,10 +8598,10 @@ declare module 'vscode' {
|
|||
*
|
||||
* @param command Identifier of the command to execute.
|
||||
* @param rest Parameters passed to the command function.
|
||||
* @return A thenable that resolves to the returned value of the given command. `undefined` when
|
||||
* @return A thenable that resolves to the returned value of the given command. Returns `undefined` when
|
||||
* the command handler function doesn't return anything.
|
||||
*/
|
||||
export function executeCommand<T>(command: string, ...rest: any[]): Thenable<T | undefined>;
|
||||
export function executeCommand<T = unknown>(command: string, ...rest: any[]): Thenable<T>;
|
||||
|
||||
/**
|
||||
* Retrieve the list of all available commands. Commands starting with an underscore are
|
||||
|
|
Loading…
Reference in a new issue