Never edit files under node_modules on update paths

Workaround for #52977
This commit is contained in:
Matt Bierner
2018-06-26 11:07:37 -07:00
parent 90b1beeb5b
commit 50cc3d6121

View File

@@ -226,11 +226,15 @@ export class UpdateImportsOnFileRenameHandler {
const edits: Proto.FileCodeEdits[] = [];
for (const edit of response.body) {
// Workaround for https://github.com/Microsoft/vscode/issues/52675
if ((edit as Proto.FileCodeEdits).fileName.match(/[\/\\]node_modules[\/\\]/gi)) {
continue;
}
for (const change of (edit as Proto.FileCodeEdits).textChanges) {
if (change.newText.match(/\/node_modules\//gi)) {
continue;
}
}
edits.push(await this.fixEdit(edit, isDirectoryRename, oldFile, newFile));
}
return typeConverters.WorkspaceEdit.fromFileCodeEdits(this.client, edits);