mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-13 21:54:42 +00:00
Add workaround for rename error reporting
This commit is contained in:
parent
c45792ae8f
commit
8522b4aece
1 changed files with 6 additions and 3 deletions
|
@ -124,9 +124,12 @@ export async function download(opts: DownloadOpts) {
|
||||||
log.info(`Renamed old server binary ${opts.dest.fsPath} to ${oldServerPath.fsPath}`);
|
log.info(`Renamed old server binary ${opts.dest.fsPath} to ${oldServerPath.fsPath}`);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
const fsErr = err as vscode.FileSystemError;
|
const fsErr = err as vscode.FileSystemError;
|
||||||
// This is supposed to return `FileNotFound`, alas...
|
|
||||||
if (!fsErr.code || fsErr.code !== "FileNotFound" && fsErr.code !== "EntryNotFound") {
|
// This is supposed to return `FileNotFound` (spelled as `EntryNotFound`)
|
||||||
log.error(`Cannot rename existing server instance: ${err}`);
|
// but instead `code` is `Unknown` and `name` is `EntryNotFound (FileSystemError) (FileSystemError)`.
|
||||||
|
// https://github.com/rust-analyzer/rust-analyzer/pull/10222
|
||||||
|
if (!fsErr.code || fsErr.code !== "EntryNotFound" && fsErr.name.indexOf("EntryNotFound") === -1) {
|
||||||
|
log.error(`Cannot rename existing server instance: ${err}"`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in a new issue