From 61580f3cb82821c65dc93627d9b3ec9390cce281 Mon Sep 17 00:00:00 2001 From: "Jeremy A. Kolb" Date: Wed, 31 Oct 2018 17:38:18 -0400 Subject: Remove DOC_COMMENT Closes #166 --- crates/ra_editor/src/lib.rs | 2 +- crates/ra_syntax/src/grammar.ron | 1 - crates/ra_syntax/src/reparsing.rs | 2 +- crates/ra_syntax/src/syntax_kinds/generated.rs | 2 -- crates/ra_syntax/src/syntax_kinds/mod.rs | 2 +- 5 files changed, 3 insertions(+), 6 deletions(-) diff --git a/crates/ra_editor/src/lib.rs b/crates/ra_editor/src/lib.rs index 481f4c9fc..3186eaf1a 100644 --- a/crates/ra_editor/src/lib.rs +++ b/crates/ra_editor/src/lib.rs @@ -81,7 +81,7 @@ pub fn highlight(file: &File) -> Vec { let mut res = Vec::new(); for node in file.syntax().descendants() { let tag = match node.kind() { - COMMENT | DOC_COMMENT => "comment", + COMMENT => "comment", STRING | RAW_STRING | RAW_BYTE_STRING | BYTE_STRING => "string", ATTR => "attribute", NAME_REF => "text", diff --git a/crates/ra_syntax/src/grammar.ron b/crates/ra_syntax/src/grammar.ron index 6951db010..0454fd8e4 100644 --- a/crates/ra_syntax/src/grammar.ron +++ b/crates/ra_syntax/src/grammar.ron @@ -113,7 +113,6 @@ Grammar( "BYTE_STRING", "RAW_BYTE_STRING", "COMMENT", - "DOC_COMMENT", "SHEBANG", ], nodes: [ diff --git a/crates/ra_syntax/src/reparsing.rs b/crates/ra_syntax/src/reparsing.rs index eae01b1d5..d3b9a30d6 100644 --- a/crates/ra_syntax/src/reparsing.rs +++ b/crates/ra_syntax/src/reparsing.rs @@ -48,7 +48,7 @@ fn reparse_leaf<'node>( ) -> Option<(SyntaxNodeRef<'node>, GreenNode, Vec)> { let node = algo::find_covering_node(node, edit.delete); match node.kind() { - WHITESPACE | COMMENT | DOC_COMMENT | IDENT | STRING | RAW_STRING => { + WHITESPACE | COMMENT | IDENT | STRING | RAW_STRING => { let text = get_text_after_edit(node, &edit); let tokens = tokenize(&text); let token = match tokens[..] { diff --git a/crates/ra_syntax/src/syntax_kinds/generated.rs b/crates/ra_syntax/src/syntax_kinds/generated.rs index 58e2e9e9c..6568f1a37 100644 --- a/crates/ra_syntax/src/syntax_kinds/generated.rs +++ b/crates/ra_syntax/src/syntax_kinds/generated.rs @@ -116,7 +116,6 @@ pub enum SyntaxKind { BYTE_STRING, RAW_BYTE_STRING, COMMENT, - DOC_COMMENT, SHEBANG, ROOT, STRUCT_DEF, @@ -378,7 +377,6 @@ impl SyntaxKind { BYTE_STRING => &SyntaxInfo { name: "BYTE_STRING" }, RAW_BYTE_STRING => &SyntaxInfo { name: "RAW_BYTE_STRING" }, COMMENT => &SyntaxInfo { name: "COMMENT" }, - DOC_COMMENT => &SyntaxInfo { name: "DOC_COMMENT" }, SHEBANG => &SyntaxInfo { name: "SHEBANG" }, ROOT => &SyntaxInfo { name: "ROOT" }, STRUCT_DEF => &SyntaxInfo { name: "STRUCT_DEF" }, diff --git a/crates/ra_syntax/src/syntax_kinds/mod.rs b/crates/ra_syntax/src/syntax_kinds/mod.rs index 0fcd07cbf..d53886676 100644 --- a/crates/ra_syntax/src/syntax_kinds/mod.rs +++ b/crates/ra_syntax/src/syntax_kinds/mod.rs @@ -19,7 +19,7 @@ pub(crate) struct SyntaxInfo { impl SyntaxKind { pub fn is_trivia(self) -> bool { match self { - WHITESPACE | COMMENT | DOC_COMMENT => true, + WHITESPACE | COMMENT => true, _ => false, } } -- cgit v1.2.3