avoid unload new document on rename

This commit is contained in:
Qiming Zhao 2022-07-31 18:34:26 +08:00
parent 8234e83f92
commit 4571c863ad
No known key found for this signature in database
GPG key ID: 9722CD0E8D4DCB8C

View file

@ -61,11 +61,11 @@ export default class UpdateImportsOnFileRenameHandler {
await workspace.nvim.command(`silent ${oldDocument.bufnr}bwipeout!`) await workspace.nvim.command(`silent ${oldDocument.bufnr}bwipeout!`)
} }
let document = workspace.getDocument(newUri) let document = workspace.getDocument(newUri)
if (document) { if (!document) {
await workspace.nvim.command(`silent ${document.bufnr}bwipeout!`) document = await workspace.loadFile(newUri)
await wait(30) } else {
workspace.nvim.command('checktime', true)
} }
document = await workspace.loadFile(newUri)
if (!document) return if (!document) return
await wait(50) await wait(50)
const edits = await this.getEditsForFileRename( const edits = await this.getEditsForFileRename(