From 946b5789d1ea6385a345fcb4aa0658392ec44a51 Mon Sep 17 00:00:00 2001 From: Ville Penttinen Date: Mon, 8 Apr 2019 11:44:23 +0300 Subject: Move completion label functions to display --- crates/ra_ide_api/src/completion.rs | 28 ---------------------------- 1 file changed, 28 deletions(-) (limited to 'crates/ra_ide_api/src/completion.rs') diff --git a/crates/ra_ide_api/src/completion.rs b/crates/ra_ide_api/src/completion.rs index 71a35c689..deff59cd3 100644 --- a/crates/ra_ide_api/src/completion.rs +++ b/crates/ra_ide_api/src/completion.rs @@ -13,12 +13,10 @@ mod complete_scope; mod complete_postfix; use ra_db::SourceDatabase; -use ra_syntax::{ast::{self, AstNode}, SyntaxKind::{ATTR, COMMENT}}; use crate::{ db, FilePosition, - FunctionSignature, completion::{ completion_item::{Completions, CompletionKind}, completion_context::CompletionContext, @@ -71,29 +69,3 @@ pub(crate) fn completions(db: &db::RootDatabase, position: FilePosition) -> Opti complete_postfix::complete_postfix(&mut acc, &ctx); Some(acc) } - -pub fn function_label(node: &ast::FnDef) -> Option { - Some(FunctionSignature::from(node).to_string()) -} - -pub fn const_label(node: &ast::ConstDef) -> String { - let label: String = node - .syntax() - .children_with_tokens() - .filter(|child| !(child.kind() == COMMENT || child.kind() == ATTR)) - .map(|node| node.to_string()) - .collect(); - - label.trim().to_owned() -} - -pub fn type_label(node: &ast::TypeAliasDef) -> String { - let label: String = node - .syntax() - .children_with_tokens() - .filter(|child| !(child.kind() == COMMENT || child.kind() == ATTR)) - .map(|node| node.to_string()) - .collect(); - - label.trim().to_owned() -} -- cgit v1.2.3