From c8b4c36f8161d34c8145a49965efee4514275989 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 10 Apr 2020 10:11:05 +0200 Subject: Semicolon token --- crates/ra_ide/src/typing.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_ide') diff --git a/crates/ra_ide/src/typing.rs b/crates/ra_ide/src/typing.rs index 71d2bcb04..f55cd3bf5 100644 --- a/crates/ra_ide/src/typing.rs +++ b/crates/ra_ide/src/typing.rs @@ -63,7 +63,7 @@ fn on_char_typed_inner( fn on_eq_typed(file: &SourceFile, offset: TextUnit) -> Option { assert_eq!(file.syntax().text().char_at(offset), Some('=')); let let_stmt: ast::LetStmt = find_node_at_offset(file.syntax(), offset)?; - if let_stmt.semi_token().is_some() { + if let_stmt.semicolon_token().is_some() { return None; } if let Some(expr) = let_stmt.initializer() { -- cgit v1.2.3 From 5c5bde47fb759440d007c90fd83021de538120b8 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 10 Apr 2020 17:06:57 +0200 Subject: Rename some tokens --- crates/ra_ide/src/completion/complete_trait_impl.rs | 4 ++-- crates/ra_ide/src/syntax_tree.rs | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'crates/ra_ide') diff --git a/crates/ra_ide/src/completion/complete_trait_impl.rs b/crates/ra_ide/src/completion/complete_trait_impl.rs index ded1ff3bc..fab02945c 100644 --- a/crates/ra_ide/src/completion/complete_trait_impl.rs +++ b/crates/ra_ide/src/completion/complete_trait_impl.rs @@ -35,7 +35,7 @@ use hir::{self, Docs, HasSource}; use ra_assists::utils::get_missing_impl_items; use ra_syntax::{ ast::{self, edit, ImplDef}, - AstNode, SyntaxKind, SyntaxNode, TextRange, + AstNode, SyntaxKind, SyntaxNode, TextRange, T, }; use ra_text_edit::TextEdit; @@ -204,7 +204,7 @@ fn make_const_compl_syntax(const_: &ast::ConstDef) -> String { let end = const_ .syntax() .children_with_tokens() - .find(|s| s.kind() == SyntaxKind::SEMI || s.kind() == SyntaxKind::EQ) + .find(|s| s.kind() == T![;] || s.kind() == T![=]) .map_or(const_end, |f| f.text_range().start()); let len = end - start; diff --git a/crates/ra_ide/src/syntax_tree.rs b/crates/ra_ide/src/syntax_tree.rs index f58e436d1..5842ae2e8 100644 --- a/crates/ra_ide/src/syntax_tree.rs +++ b/crates/ra_ide/src/syntax_tree.rs @@ -165,7 +165,7 @@ SOURCE_FILE@[0; 60) PATH_SEGMENT@[16; 22) NAME_REF@[16; 22) IDENT@[16; 22) "assert" - EXCL@[22; 23) "!" + BANG@[22; 23) "!" TOKEN_TREE@[23; 57) L_PAREN@[23; 24) "(" STRING@[24; 52) "\"\n fn foo() {\n ..." @@ -173,7 +173,7 @@ SOURCE_FILE@[0; 60) WHITESPACE@[53; 54) " " STRING@[54; 56) "\"\"" R_PAREN@[56; 57) ")" - SEMI@[57; 58) ";" + SEMICOLON@[57; 58) ";" WHITESPACE@[58; 59) "\n" R_CURLY@[59; 60) "}" "# @@ -226,7 +226,7 @@ EXPR_STMT@[16; 58) PATH_SEGMENT@[16; 22) NAME_REF@[16; 22) IDENT@[16; 22) "assert" - EXCL@[22; 23) "!" + BANG@[22; 23) "!" TOKEN_TREE@[23; 57) L_PAREN@[23; 24) "(" STRING@[24; 52) "\"\n fn foo() {\n ..." @@ -234,7 +234,7 @@ EXPR_STMT@[16; 58) WHITESPACE@[53; 54) " " STRING@[54; 56) "\"\"" R_PAREN@[56; 57) ")" - SEMI@[57; 58) ";" + SEMICOLON@[57; 58) ";" "# .trim() ); -- cgit v1.2.3