diff options
author | Chetan Khilosiya <[email protected]> | 2021-03-30 21:16:01 +0100 |
---|---|---|
committer | Chetan Khilosiya <[email protected]> | 2021-03-30 21:16:01 +0100 |
commit | 518c9c75481d4dcf6b1e7768fb48990dc74b7bf5 (patch) | |
tree | b3a1210a9981af1fbb814d0ccd217148cf544784 /crates/ide/src/syntax_highlighting | |
parent | d0fcd5c5e054efd64585fc3f3eff55fe7bfa1ce2 (diff) |
Revert "8024: Added test case for highlighting trait items."
This reverts commit d7dcd41801b319f64f3ca2ed22735ab70092e491.
Diffstat (limited to 'crates/ide/src/syntax_highlighting')
-rw-r--r-- | crates/ide/src/syntax_highlighting/test_data/highlight_trait_items.html | 67 | ||||
-rw-r--r-- | crates/ide/src/syntax_highlighting/tests.rs | 37 |
2 files changed, 0 insertions, 104 deletions
diff --git a/crates/ide/src/syntax_highlighting/test_data/highlight_trait_items.html b/crates/ide/src/syntax_highlighting/test_data/highlight_trait_items.html deleted file mode 100644 index 85274a61f..000000000 --- a/crates/ide/src/syntax_highlighting/test_data/highlight_trait_items.html +++ /dev/null | |||
@@ -1,67 +0,0 @@ | |||
1 | |||
2 | <style> | ||
3 | body { margin: 0; } | ||
4 | pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padding: 0.4em; } | ||
5 | |||
6 | .lifetime { color: #DFAF8F; font-style: italic; } | ||
7 | .label { color: #DFAF8F; font-style: italic; } | ||
8 | .comment { color: #7F9F7F; } | ||
9 | .documentation { color: #629755; } | ||
10 | .intra_doc_link { font-style: italic; } | ||
11 | .injected { opacity: 0.65 ; } | ||
12 | .struct, .enum { color: #7CB8BB; } | ||
13 | .enum_variant { color: #BDE0F3; } | ||
14 | .string_literal { color: #CC9393; } | ||
15 | .field { color: #94BFF3; } | ||
16 | .function { color: #93E0E3; } | ||
17 | .function.unsafe { color: #BC8383; } | ||
18 | .operator.unsafe { color: #BC8383; } | ||
19 | .parameter { color: #94BFF3; } | ||
20 | .text { color: #DCDCCC; } | ||
21 | .type { color: #7CB8BB; } | ||
22 | .builtin_type { color: #8CD0D3; } | ||
23 | .type_param { color: #DFAF8F; } | ||
24 | .attribute { color: #94BFF3; } | ||
25 | .numeric_literal { color: #BFEBBF; } | ||
26 | .bool_literal { color: #BFE6EB; } | ||
27 | .macro { color: #94BFF3; } | ||
28 | .module { color: #AFD8AF; } | ||
29 | .value_param { color: #DCDCCC; } | ||
30 | .variable { color: #DCDCCC; } | ||
31 | .format_specifier { color: #CC696B; } | ||
32 | .mutable { text-decoration: underline; } | ||
33 | .escape_sequence { color: #94BFF3; } | ||
34 | .keyword { color: #F0DFAF; font-weight: bold; } | ||
35 | .keyword.unsafe { color: #BC8383; font-weight: bold; } | ||
36 | .control { font-style: italic; } | ||
37 | |||
38 | .unresolved_reference { color: #FC5555; text-decoration: wavy underline; } | ||
39 | </style> | ||
40 | <pre><code><span class="keyword">struct</span> <span class="struct declaration">Cat</span><span class="semicolon">;</span> | ||
41 | |||
42 | <span class="keyword">trait</span> <span class="trait declaration">Animal</span> <span class="brace">{</span> | ||
43 | <span class="keyword">const</span> <span class="constant declaration associated trait">SOUND</span><span class="colon">:</span> <span class="operator">&</span><span class="lifetime">'static</span> <span class="builtin_type">str</span><span class="semicolon">;</span> | ||
44 | |||
45 | <span class="keyword">fn</span> <span class="function declaration associated trait">make_sound</span><span class="parenthesis">(</span><span class="operator">&</span><span class="self_keyword declaration">self</span><span class="parenthesis">)</span> <span class="brace">{</span> | ||
46 | <span class="macro">println!</span><span class="parenthesis">(</span><span class="string_literal">"{}"</span><span class="comma">,</span> Self<span class="colon">:</span><span class="colon">:</span>SOUND<span class="parenthesis">)</span><span class="semicolon">;</span> | ||
47 | <span class="brace">}</span> | ||
48 | <span class="brace">}</span> | ||
49 | |||
50 | <span class="keyword">impl</span> <span class="trait">Animal</span> <span class="keyword">for</span> <span class="struct">Cat</span> <span class="brace">{</span> | ||
51 | <span class="keyword">const</span> <span class="constant declaration associated trait">SOUND</span><span class="colon">:</span> <span class="operator">&</span><span class="lifetime">'static</span> <span class="builtin_type">str</span> <span class="operator">=</span> <span class="string_literal">"Meow!"</span><span class="semicolon">;</span> | ||
52 | <span class="brace">}</span> | ||
53 | |||
54 | <span class="keyword">impl</span> <span class="struct">Cat</span> <span class="brace">{</span> | ||
55 | <span class="keyword">const</span> <span class="constant declaration associated">SPEED</span><span class="colon">:</span> <span class="builtin_type">u32</span> <span class="operator">=</span> <span class="numeric_literal">2</span><span class="semicolon">;</span> | ||
56 | |||
57 | <span class="keyword">fn</span> <span class="function declaration static associated">run</span><span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="brace">{</span><span class="brace">}</span> | ||
58 | <span class="brace">}</span> | ||
59 | |||
60 | <span class="keyword">fn</span> <span class="function declaration">main</span><span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="brace">{</span> | ||
61 | <span class="keyword">let</span> <span class="variable declaration">cat</span> <span class="operator">=</span> <span class="struct">Cat</span><span class="semicolon">;</span> | ||
62 | <span class="variable">cat</span><span class="operator">.</span><span class="function associated trait">make_sound</span><span class="parenthesis">(</span><span class="parenthesis">)</span><span class="semicolon">;</span> | ||
63 | <span class="keyword">let</span> <span class="variable declaration">_sound</span> <span class="operator">=</span> <span class="struct">Cat</span><span class="operator">::</span><span class="constant associated trait">SOUND</span><span class="semicolon">;</span> | ||
64 | <span class="keyword">let</span> <span class="variable declaration">_speed</span> <span class="operator">=</span> <span class="struct">Cat</span><span class="operator">::</span><span class="constant associated">SPEED</span><span class="semicolon">;</span> | ||
65 | <span class="struct">Cat</span><span class="operator">::</span><span class="function static associated">run</span><span class="parenthesis">(</span><span class="parenthesis">)</span><span class="semicolon">;</span> | ||
66 | <span class="brace">}</span> | ||
67 | </code></pre> \ No newline at end of file | ||
diff --git a/crates/ide/src/syntax_highlighting/tests.rs b/crates/ide/src/syntax_highlighting/tests.rs index 7b3b5caf9..369ae0972 100644 --- a/crates/ide/src/syntax_highlighting/tests.rs +++ b/crates/ide/src/syntax_highlighting/tests.rs | |||
@@ -659,43 +659,6 @@ fn foo() { | |||
659 | ); | 659 | ); |
660 | } | 660 | } |
661 | 661 | ||
662 | #[test] | ||
663 | fn test_highlight_trait_items() { | ||
664 | check_highlighting( | ||
665 | r#" | ||
666 | struct Cat; | ||
667 | |||
668 | trait Animal { | ||
669 | const SOUND: &'static str; | ||
670 | |||
671 | fn make_sound(&self) { | ||
672 | println!("{}", Self::SOUND); | ||
673 | } | ||
674 | } | ||
675 | |||
676 | impl Animal for Cat { | ||
677 | const SOUND: &'static str = "Meow!"; | ||
678 | } | ||
679 | |||
680 | impl Cat { | ||
681 | const SPEED: u32 = 2; | ||
682 | |||
683 | fn run() {} | ||
684 | } | ||
685 | |||
686 | fn main() { | ||
687 | let cat = Cat; | ||
688 | cat.make_sound(); | ||
689 | let _sound = Cat::SOUND; | ||
690 | let _speed = Cat::SPEED; | ||
691 | Cat::run(); | ||
692 | } | ||
693 | "#, | ||
694 | expect_file!["./test_data/highlight_trait_items.html"], | ||
695 | false, | ||
696 | ); | ||
697 | } | ||
698 | |||
699 | /// Highlights the code given by the `ra_fixture` argument, renders the | 662 | /// Highlights the code given by the `ra_fixture` argument, renders the |
700 | /// result as HTML, and compares it with the HTML file given as `snapshot`. | 663 | /// result as HTML, and compares it with the HTML file given as `snapshot`. |
701 | /// Note that the `snapshot` file is overwritten by the rendered HTML. | 664 | /// Note that the `snapshot` file is overwritten by the rendered HTML. |