From 3f3ff2f0f4c188c606a96506325d96726c842239 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 2 Apr 2019 10:48:59 +0300 Subject: fix comment naming --- .../completion_item__enum_variant_with_details.snap | 9 ++++++--- crates/ra_syntax/src/ast/tokens.rs | 19 +++++++++---------- 2 files changed, 15 insertions(+), 13 deletions(-) (limited to 'crates') diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__enum_variant_with_details.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__enum_variant_with_details.snap index 70ea96e1b..daccd9fba 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__enum_variant_with_details.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__enum_variant_with_details.snap @@ -1,6 +1,6 @@ --- -created: "2019-02-18T09:22:24.062138085Z" -creator: insta@0.6.2 +created: "2019-04-02T07:43:12.954637543Z" +creator: insta@0.7.4 source: crates/ra_ide_api/src/completion/completion_item.rs expression: kind_completions --- @@ -33,6 +33,9 @@ expression: kind_completions delete: [180; 180), insert: "S", kind: EnumVariant, - detail: "(S)" + detail: "(S)", + documentation: Documentation( + "" + ) } ] diff --git a/crates/ra_syntax/src/ast/tokens.rs b/crates/ra_syntax/src/ast/tokens.rs index c830cdccf..76a12cd64 100644 --- a/crates/ra_syntax/src/ast/tokens.rs +++ b/crates/ra_syntax/src/ast/tokens.rs @@ -24,9 +24,9 @@ impl<'a> Comment<'a> { pub fn flavor(&self) -> CommentFlavor { let text = self.text(); if text.starts_with("///") { - CommentFlavor::Doc + CommentFlavor::OuterDoc } else if text.starts_with("//!") { - CommentFlavor::ModuleDoc + CommentFlavor::InnerDoc } else if text.starts_with("//") { CommentFlavor::Line } else { @@ -46,25 +46,24 @@ impl<'a> Comment<'a> { #[derive(Debug, PartialEq, Eq)] pub enum CommentFlavor { Line, - Doc, - ModuleDoc, + OuterDoc, + InnerDoc, Multiline, } impl CommentFlavor { pub fn prefix(&self) -> &'static str { - use self::CommentFlavor::*; match *self { - Line => "//", - Doc => "///", - ModuleDoc => "//!", - Multiline => "/*", + CommentFlavor::Line => "//", + CommentFlavor::OuterDoc => "///", + CommentFlavor::InnerDoc => "//!", + CommentFlavor::Multiline => "/*", } } pub fn is_doc_comment(&self) -> bool { match self { - CommentFlavor::Doc | CommentFlavor::ModuleDoc => true, + CommentFlavor::OuterDoc | CommentFlavor::InnerDoc => true, _ => false, } } -- cgit v1.2.3