Fix checking $traceid for empty args

This commit is contained in:
Matt Bierner
2025-10-06 10:10:49 -07:00
parent a3114ecbfa
commit 4d32398e42
2 changed files with 6 additions and 6 deletions

View File

@@ -86,7 +86,7 @@ export class RequestQueue {
return false;
}
public createRequest(command: string, args: any): Proto.Request {
public createRequest(command: string, args: unknown): Proto.Request {
return {
seq: this.sequenceNumber++,
type: 'request',

View File

@@ -49,7 +49,7 @@ export interface ITypeScriptServer {
* @return A list of all execute requests. If there are multiple entries, the first item is the primary
* request while the rest are secondary ones.
*/
executeImpl(command: keyof TypeScriptRequests, args: any, executeInfo: { isAsync: boolean; token?: vscode.CancellationToken; expectsResult: boolean; lowPriority?: boolean; executionTarget?: ExecutionTarget }): Array<Promise<ServerResponse.Response<Proto.Response>> | undefined>;
executeImpl(command: keyof TypeScriptRequests, args: unknown, executeInfo: { isAsync: boolean; token?: vscode.CancellationToken; expectsResult: boolean; lowPriority?: boolean; executionTarget?: ExecutionTarget }): Array<Promise<ServerResponse.Response<Proto.Response>> | undefined>;
dispose(): void;
}
@@ -284,7 +284,7 @@ export class SingleTsServer extends Disposable implements ITypeScriptServer {
}
this._requestQueue.enqueue(requestInfo);
const traceId = (args as RequestArgs).$traceId;
const traceId = (args as RequestArgs | undefined)?.$traceId;
if (args && typeof traceId === 'string') {
const queueLength = this._requestQueue.length - 1;
const pendingResponses = this._pendingResponses.size;
@@ -406,7 +406,7 @@ class RequestRouter {
public execute(
command: keyof TypeScriptRequests,
args: any,
args: unknown,
executeInfo: ExecuteInfo,
): Array<Promise<ServerResponse.Response<Proto.Response>> | undefined> {
if (RequestRouter.sharedCommands.has(command) && typeof executeInfo.executionTarget === 'undefined') {
@@ -538,7 +538,7 @@ export class GetErrRoutingTsServer extends Disposable implements ITypeScriptServ
this.mainServer.kill();
}
public executeImpl(command: keyof TypeScriptRequests, args: any, executeInfo: { isAsync: boolean; token?: vscode.CancellationToken; expectsResult: boolean; lowPriority?: boolean; executionTarget?: ExecutionTarget }): Array<Promise<ServerResponse.Response<Proto.Response>> | undefined> {
public executeImpl(command: keyof TypeScriptRequests, args: unknown, executeInfo: { isAsync: boolean; token?: vscode.CancellationToken; expectsResult: boolean; lowPriority?: boolean; executionTarget?: ExecutionTarget }): Array<Promise<ServerResponse.Response<Proto.Response>> | undefined> {
return this.router.execute(command, args, executeInfo);
}
}
@@ -679,7 +679,7 @@ export class SyntaxRoutingTsServer extends Disposable implements ITypeScriptServ
this.semanticServer.kill();
}
public executeImpl(command: keyof TypeScriptRequests, args: any, executeInfo: { isAsync: boolean; token?: vscode.CancellationToken; expectsResult: boolean; lowPriority?: boolean; executionTarget?: ExecutionTarget }): Array<Promise<ServerResponse.Response<Proto.Response>> | undefined> {
public executeImpl(command: keyof TypeScriptRequests, args: unknown, executeInfo: { isAsync: boolean; token?: vscode.CancellationToken; expectsResult: boolean; lowPriority?: boolean; executionTarget?: ExecutionTarget }): Array<Promise<ServerResponse.Response<Proto.Response>> | undefined> {
return this.router.execute(command, args, executeInfo);
}
}