From 53bb46fa853bee99f673a0ed0a53798c46847d99 Mon Sep 17 00:00:00 2001 From: Josh Mcguigan Date: Sat, 6 Mar 2021 16:56:07 -0800 Subject: show function params in completion detail --- crates/hir/src/lib.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'crates/hir') diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs index 58adc8fd3..8d082994a 100644 --- a/crates/hir/src/lib.rs +++ b/crates/hir/src/lib.rs @@ -921,6 +921,14 @@ impl SelfParam { }) .unwrap_or(Access::Owned) } + + pub fn display(self, db: &dyn HirDatabase) -> &'static str { + match self.access(db) { + Access::Shared => "&self", + Access::Exclusive => "&mut self", + Access::Owned => "self", + } + } } impl HasVisibility for Function { -- cgit v1.2.3