@@ -4,7 +4,7 @@ import { LanguageClientConnection } from "../main";
4
4
export type CommandCustomCallbackFunction = ( command : ExecuteCommandParams ) => Promise < any | void > ;
5
5
6
6
export default class CommandExecutionAdapter {
7
- private static commandsCustomCallbacks : Map < string , CommandCustomCallbackFunction > = new Map < string , CommandCustomCallbackFunction > ( ) ;
7
+ private static commandsCustomCallbacks = new Map < string , CommandCustomCallbackFunction > ( ) ;
8
8
9
9
public static canAdapt ( serverCapabilities : ServerCapabilities ) : boolean {
10
10
return serverCapabilities . executeCommandProvider != null ;
@@ -14,14 +14,14 @@ export default class CommandExecutionAdapter {
14
14
this . commandsCustomCallbacks . set ( command , callback ) ;
15
15
}
16
16
17
- public static async executeCommand ( connection : LanguageClientConnection , command : string , commandArgs ?: any [ ] | undefined ) : Promise < any | void > {
17
+ public static async executeCommand ( connection : LanguageClientConnection , command : string , commandArgs ?: any [ ] ) : Promise < any | void > {
18
18
const executeCommandParams = CommandExecutionAdapter . createExecuteCommandParams ( command , commandArgs ) ;
19
19
const commandCustomCallback = this . commandsCustomCallbacks . get ( command ) ;
20
20
21
21
return commandCustomCallback != null ? await commandCustomCallback ( executeCommandParams ) : await connection . executeCommand ( executeCommandParams ) ;
22
22
}
23
23
24
- private static createExecuteCommandParams ( command : string , commandArgs ?: any [ ] | undefined ) : ExecuteCommandParams {
24
+ private static createExecuteCommandParams ( command : string , commandArgs ?: any [ ] ) : ExecuteCommandParams {
25
25
return {
26
26
command : command ,
27
27
arguments : commandArgs
0 commit comments