Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide/src/inlay_hints/closure_captures.rs')
| -rw-r--r-- | crates/ide/src/inlay_hints/closure_captures.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/ide/src/inlay_hints/closure_captures.rs b/crates/ide/src/inlay_hints/closure_captures.rs index 07a86b2c9d..3186a566d2 100644 --- a/crates/ide/src/inlay_hints/closure_captures.rs +++ b/crates/ide/src/inlay_hints/closure_captures.rs @@ -3,7 +3,6 @@ //! Tests live in [`bind_pat`][super::bind_pat] module. use ide_db::famous_defs::FamousDefs; use ide_db::text_edit::{TextRange, TextSize}; -use span::EditionedFileId; use stdx::{TupleExt, never}; use syntax::ast::{self, AstNode}; @@ -15,7 +14,6 @@ pub(super) fn hints( acc: &mut Vec<InlayHint>, FamousDefs(sema, _): &FamousDefs<'_, '_>, config: &InlayHintsConfig, - _file_id: EditionedFileId, closure: ast::ClosureExpr, ) -> Option<()> { if !config.closure_capture_hints { @@ -75,10 +73,12 @@ pub(super) fn hints( // force cache the source file, otherwise sema lookup will potentially panic _ = sema.parse_or_expand(source.file()); source.name().and_then(|name| { - name.syntax() - .original_file_range_opt(sema.db) - .map(TupleExt::head) - .map(Into::into) + name.syntax().original_file_range_opt(sema.db).map(TupleExt::head).map( + |frange| ide_db::FileRange { + file_id: frange.file_id.file_id(sema.db), + range: frange.range, + }, + ) }) }), tooltip: None, |