aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src/references.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-10-10 12:59:25 +0100
committerGitHub <[email protected]>2020-10-10 12:59:25 +0100
commitb7596d248382aa88b81da4dd6c7598993bc4b787 (patch)
tree0ef92bcd580446c4ea44902f0f959d547a698943 /crates/ide/src/references.rs
parent05261f5aeb1dcf01c5dfcf3e01826e57b1249ca9 (diff)
parente90931a2047e6e38f173e2e2f2a24ad648e92e9d (diff)
Merge #5858
5858: Draft: Show reason for failed rename refactoring r=rherrmann a=rherrmann Return an error with a meaningful message for requests to `textDocument/rename` if the operation cannot be performed. Pass errors, raised by rename handling code to the LSP runtime. As a consequence, the VS Code client shows and logs the request as if a server-side programming error occured. Screenshot of a rename error showing in VS Code ![invalid-rename-ui](https://user-images.githubusercontent.com/607182/91059560-2c08a380-e62a-11ea-9297-f092db935a3b.png) I would kindly ask to get feedback from the maintainers if they can spare the time: * Is the general direction of the proposed changes acceptable? * I'm new to Rust. The code feels clumsy and redundant, please suggest improvements if you find the time for. E.g. is there a simple replacement for `RenameError`? * Should presenting the error with proper severity (i.e. not as a programming error) be part of this change or in a followup change? See https://github.com/rust-analyzer/rust-analyzer/issues/3981 Co-authored-by: RĂ¼diger Herrmann <[email protected]>
Diffstat (limited to 'crates/ide/src/references.rs')
-rw-r--r--crates/ide/src/references.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/crates/ide/src/references.rs b/crates/ide/src/references.rs
index 9315f7354..f65a05ea3 100644
--- a/crates/ide/src/references.rs
+++ b/crates/ide/src/references.rs
@@ -26,6 +26,7 @@ use syntax::{
26use crate::{display::TryToNav, FilePosition, FileRange, NavigationTarget, RangeInfo}; 26use crate::{display::TryToNav, FilePosition, FileRange, NavigationTarget, RangeInfo};
27 27
28pub(crate) use self::rename::rename; 28pub(crate) use self::rename::rename;
29pub use self::rename::RenameError;
29 30
30pub use ide_db::search::{Reference, ReferenceAccess, ReferenceKind}; 31pub use ide_db::search::{Reference, ReferenceAccess, ReferenceKind};
31 32