diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-10-11 07:01:58 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2019-10-11 07:01:58 +0100 |
commit | ef6ccd75e0961956cb8bd07c59382f85da1dadd3 (patch) | |
tree | c51b9acd97d0f3a336a8473b743e468cd570224c /crates/ra_ide_api/src/display | |
parent | 3b4c506f338d03a633419459bb32daf331153d5e (diff) | |
parent | 0d0a444d4380d9d1eb580d862b2376b9693d77f3 (diff) |
Merge #1991
1991: Use `original_file` instead of `as_original_file` r=matklad a=sinkuu
I saw ra_lsp_server panics originating from `as_original_file`, though I have not been able to reproduce.
Co-authored-by: Shotaro Yamada <[email protected]>
Diffstat (limited to 'crates/ra_ide_api/src/display')
-rw-r--r-- | crates/ra_ide_api/src/display/navigation_target.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_ide_api/src/display/navigation_target.rs b/crates/ra_ide_api/src/display/navigation_target.rs index d0b1a8a2a..5cb67fb95 100644 --- a/crates/ra_ide_api/src/display/navigation_target.rs +++ b/crates/ra_ide_api/src/display/navigation_target.rs | |||
@@ -119,7 +119,7 @@ impl NavigationTarget { | |||
119 | 119 | ||
120 | pub(crate) fn from_module(db: &RootDatabase, module: hir::Module) -> NavigationTarget { | 120 | pub(crate) fn from_module(db: &RootDatabase, module: hir::Module) -> NavigationTarget { |
121 | let src = module.definition_source(db); | 121 | let src = module.definition_source(db); |
122 | let file_id = src.file_id.as_original_file(); | 122 | let file_id = src.file_id.original_file(db); |
123 | let name = module.name(db).map(|it| it.to_string().into()).unwrap_or_default(); | 123 | let name = module.name(db).map(|it| it.to_string().into()).unwrap_or_default(); |
124 | match src.ast { | 124 | match src.ast { |
125 | ModuleSource::SourceFile(node) => { | 125 | ModuleSource::SourceFile(node) => { |
@@ -139,7 +139,7 @@ impl NavigationTarget { | |||
139 | pub(crate) fn from_module_to_decl(db: &RootDatabase, module: hir::Module) -> NavigationTarget { | 139 | pub(crate) fn from_module_to_decl(db: &RootDatabase, module: hir::Module) -> NavigationTarget { |
140 | let name = module.name(db).map(|it| it.to_string().into()).unwrap_or_default(); | 140 | let name = module.name(db).map(|it| it.to_string().into()).unwrap_or_default(); |
141 | if let Some(src) = module.declaration_source(db) { | 141 | if let Some(src) = module.declaration_source(db) { |
142 | let file_id = src.file_id.as_original_file(); | 142 | let file_id = src.file_id.original_file(db); |
143 | return NavigationTarget::from_syntax( | 143 | return NavigationTarget::from_syntax( |
144 | file_id, | 144 | file_id, |
145 | name, | 145 | name, |
@@ -213,7 +213,7 @@ impl NavigationTarget { | |||
213 | ) -> NavigationTarget { | 213 | ) -> NavigationTarget { |
214 | let src = impl_block.source(db); | 214 | let src = impl_block.source(db); |
215 | NavigationTarget::from_syntax( | 215 | NavigationTarget::from_syntax( |
216 | src.file_id.as_original_file(), | 216 | src.file_id.original_file(db), |
217 | "impl".into(), | 217 | "impl".into(), |
218 | None, | 218 | None, |
219 | src.ast.syntax(), | 219 | src.ast.syntax(), |