提交 a1c33c6c 编写于 作者: M Matt Bierner

Don't try creating untitled files in a refactoring

Fixes #75132
上级 69940c95
......@@ -14,6 +14,7 @@ import { VersionDependentRegistration } from '../utils/dependentRegistration';
import TelemetryReporter from '../utils/telemetry';
import * as typeConverters from '../utils/typeConverters';
import FormattingOptionsManager from './fileConfigurationManager';
import { file } from '../utils/fileSchemes';
const localize = nls.loadMessageBundle();
......@@ -79,7 +80,10 @@ class ApplyRefactoringCommand implements Command {
private async toWorkspaceEdit(body: Proto.RefactorEditInfo) {
const workspaceEdit = new vscode.WorkspaceEdit();
for (const edit of body.edits) {
workspaceEdit.createFile(this.client.toResource(edit.fileName), { ignoreIfExists: true });
const resource = this.client.toResource(edit.fileName);
if (resource.scheme === file) {
workspaceEdit.createFile(resource, { ignoreIfExists: true });
}
}
typeConverters.WorkspaceEdit.withFileCodeEdits(workspaceEdit, this.client, body.edits);
return workspaceEdit;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册