🌐 AI搜索 & 代理 主页
Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/lsp-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -849,8 +849,8 @@ export class LspServer {
}

protected async getRefactors(fileRangeArgs: ts.server.protocol.FileRangeRequestArgs, context: lsp.CodeActionContext, features: SupportedFeatures, token?: lsp.CancellationToken): Promise<ts.server.protocol.ApplicableRefactorInfo[]> {
// Make separate request for each "kind" that was specified or a single request otherwise.
const kinds = context.only || [undefined];
// Make separate request for each refactor "kind" that was specified or a single request otherwise.
const kinds = (context.only || [undefined]).filter(kind => kind === undefined || CodeActionKind.Refactor.contains(new CodeActionKind(kind)));

const responses = await Promise.all(kinds.map(async (kind) => {
const args: ts.server.protocol.GetApplicableRefactorsRequestArgs = {
Expand Down