-
Hi! For pyright, it seems the client in vscode supports file based cancellation for fast request cancelling. I'm checking lsp-mode but I did not manage to find anything related. It seems only json-rpc is supported? for file based cancellation, the pyright process needs another argument as discussed. and vscode extension code is here. Maybe need to mimic the behavior as
cancellationStrategy = new FileBasedCancellationStrategy();
export class FileBasedCancellationStrategy implements CancellationStrategy, Disposable {
constructor() {
const folderName = randomBytes(21).toString('hex');
this._sender = new FileCancellationSenderStrategy(folderName);
}
getCommandLineArguments(): string[] {
return [`--cancellationReceive=file:${this._sender.folderName}`];
} and this sender sends cancellation by simply writing empty string to this file with name from class FileCancellationSenderStrategy implements CancellationSenderStrategy {
sendCancellation(_: MessageConnection, id: CancellationId): void {
const file = getCancellationFilePath(this.folderName, id);
tryRun(() => fs.writeFileSync(file, '', { flag: 'w' }));
} related discusstion |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
We don't support it, it is not part of the spec (at least I am not aware of it). |
Beta Was this translation helpful? Give feedback.
We don't support it, it is not part of the spec (at least I am not aware of it).