diff options
author | Anatol Liu <[email protected]> | 2020-11-05 04:08:46 +0000 |
---|---|---|
committer | Anatol Liu <[email protected]> | 2020-11-05 04:08:46 +0000 |
commit | 3baa526fb07184ce9804a06c8e0251971eea3b49 (patch) | |
tree | f895bdab50f6a839b30da4a4acb7d11a79e83ac3 /crates/ide/src/syntax_highlighting/tests.rs | |
parent | 678a29e938f5833ecbf5a50eee0e29c5d99b56c4 (diff) |
Add static semantic token modifier for associated functions with no &self
Diffstat (limited to 'crates/ide/src/syntax_highlighting/tests.rs')
-rw-r--r-- | crates/ide/src/syntax_highlighting/tests.rs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/crates/ide/src/syntax_highlighting/tests.rs b/crates/ide/src/syntax_highlighting/tests.rs index 2b667b0d4..5c22e2fce 100644 --- a/crates/ide/src/syntax_highlighting/tests.rs +++ b/crates/ide/src/syntax_highlighting/tests.rs | |||
@@ -513,6 +513,34 @@ fn test_extern_crate() { | |||
513 | ); | 513 | ); |
514 | } | 514 | } |
515 | 515 | ||
516 | #[test] | ||
517 | fn test_associated_function() { | ||
518 | check_highlighting( | ||
519 | r#" | ||
520 | fn not_static() {} | ||
521 | |||
522 | struct foo {} | ||
523 | |||
524 | impl foo { | ||
525 | pub fn is_static() {} | ||
526 | pub fn is_not_static(&self) {} | ||
527 | } | ||
528 | |||
529 | trait t { | ||
530 | fn t_is_static() {} | ||
531 | fn t_is_not_static(&self) {} | ||
532 | } | ||
533 | |||
534 | impl t for foo { | ||
535 | pub fn is_static() {} | ||
536 | pub fn is_not_static(&self) {} | ||
537 | } | ||
538 | "#, | ||
539 | expect_file!["./test_data/highlight_assoc_functions.html"], | ||
540 | false, | ||
541 | ) | ||
542 | } | ||
543 | |||
516 | /// Highlights the code given by the `ra_fixture` argument, renders the | 544 | /// Highlights the code given by the `ra_fixture` argument, renders the |
517 | /// result as HTML, and compares it with the HTML file given as `snapshot`. | 545 | /// result as HTML, and compares it with the HTML file given as `snapshot`. |
518 | /// Note that the `snapshot` file is overwritten by the rendered HTML. | 546 | /// Note that the `snapshot` file is overwritten by the rendered HTML. |