From 5ddfde3038749a06b0fae3a4d96d002148f9126a Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 9 Feb 2021 17:23:35 +0300 Subject: [PATCH 1/3] Modernize tests --- crates/ide/src/syntax_tree.rs | 366 ++++++++++++++++------------------ 1 file changed, 169 insertions(+), 197 deletions(-) diff --git a/crates/ide/src/syntax_tree.rs b/crates/ide/src/syntax_tree.rs index 4c63d30236..f979ba4346 100644 --- a/crates/ide/src/syntax_tree.rs +++ b/crates/ide/src/syntax_tree.rs @@ -100,147 +100,137 @@ fn syntax_tree_for_token(node: &SyntaxToken, text_range: TextRange) -> Option Date: Tue, 9 Feb 2021 17:41:12 +0300 Subject: [PATCH 2/3] Fix highlighting of injected attributes --- editors/code/package.json | 44 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/editors/code/package.json b/editors/code/package.json index 66af94186f..e5d4390504 100644 --- a/editors/code/package.json +++ b/editors/code/package.json @@ -950,6 +950,50 @@ { "id": "formatSpecifier", "description": "Style for {} placeholders in format strings" + }, + { + "id": "punctuation", + "description": "generic punctuation" + }, + { + "id": "parenthesis", + "description": "( or )", + "superType": "punctuation" + }, + { + "id": "bracket", + "description": "[ or ]", + "superType": "punctuation" + }, + { + "id": "brace", + "description": "{ or }", + "superType": "punctuation" + }, + { + "id": "angle", + "description": "< or >", + "superType": "punctuation" + }, + { + "id": "comma", + "description": ",", + "superType": "punctuation" + }, + { + "id": "colon", + "description": ":", + "superType": "punctuation" + }, + { + "id": "semicolon", + "description": ";", + "superType": "punctuation" + }, + { + "id": "dot", + "description": ".", + "superType": "punctuation" } ], "semanticTokenModifiers": [ From 2dc67c85b94a8e858706568c4116b3123348941b Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 9 Feb 2021 17:48:25 +0300 Subject: [PATCH 3/3] Cleanup test --- crates/ide/src/join_lines.rs | 41 ++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/crates/ide/src/join_lines.rs b/crates/ide/src/join_lines.rs index 631bde0f19..e3f3985d14 100644 --- a/crates/ide/src/join_lines.rs +++ b/crates/ide/src/join_lines.rs @@ -270,27 +270,28 @@ fn foo() { #[test] fn test_join_lines_diverging_block() { - let before = r" - fn foo() { - loop { - match x { - 92 => $0{ - continue; - } - } - } + check_join_lines( + r" +fn foo() { + loop { + match x { + 92 => $0{ + continue; } - "; - let after = r" - fn foo() { - loop { - match x { - 92 => $0continue, - } - } - } - "; - check_join_lines(before, after); + } + } +} + ", + r" +fn foo() { + loop { + match x { + 92 => $0continue, + } + } +} + ", + ); } #[test]