Add initial prototype for JS/TS move to file refactoring (#178535)

Add initial support for move to file

Fixes #176705
For https://github.com/microsoft/TypeScript/pull/53542
This commit is contained in:
Matt Bierner
2023-03-28 16:49:50 -07:00
committed by GitHub
parent 71ca89d179
commit ce00cd7812
6 changed files with 314 additions and 105 deletions
@@ -352,8 +352,15 @@ export class MainThreadLanguageFeatures extends Disposable implements MainThread
if (supportsResolve) {
provider.resolveCodeAction = async (codeAction: languages.CodeAction, token: CancellationToken): Promise<languages.CodeAction> => {
const data = await this._proxy.$resolveCodeAction(handle, (<ICodeActionDto>codeAction).cacheId!, token);
codeAction.edit = reviveWorkspaceEditDto(data, this._uriIdentService);
const resolved = await this._proxy.$resolveCodeAction(handle, (<ICodeActionDto>codeAction).cacheId!, token);
if (resolved.edit) {
codeAction.edit = reviveWorkspaceEditDto(resolved.edit, this._uriIdentService);
}
if (resolved.command) {
codeAction.command = resolved.command;
}
return codeAction;
};
}