mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-08 17:19:48 +01:00
Try allowing custom commands to be sent to tsserver by extensions (#232663)
For #218275 Limit this to commands that start with `_` which should indicate that it's a private command and prevent clashes with normal TS commands
This commit is contained in:
@@ -16,7 +16,7 @@ export class TSServerRequestCommand implements Command {
|
||||
private readonly lazyClientHost: Lazy<TypeScriptServiceClientHost>
|
||||
) { }
|
||||
|
||||
public execute(requestID: keyof TypeScriptRequests, args?: any, config?: any) {
|
||||
public execute(command: keyof TypeScriptRequests, args?: any, config?: any) {
|
||||
// A cancellation token cannot be passed through the command infrastructure
|
||||
const token = nulToken;
|
||||
|
||||
@@ -36,8 +36,11 @@ export class TSServerRequestCommand implements Command {
|
||||
'completionInfo'
|
||||
];
|
||||
|
||||
if (!allowList.includes(requestID)) { return; }
|
||||
return this.lazyClientHost.value.serviceClient.execute(requestID, args, token, config);
|
||||
if (!allowList.includes(command) || command.startsWith('_')) {
|
||||
return;
|
||||
}
|
||||
|
||||
return this.lazyClientHost.value.serviceClient.execute(command, args, token, config);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user