aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src
diff options
context:
space:
mode:
authorEdwin Cheng <[email protected]>2021-03-27 06:47:04 +0000
committerEdwin Cheng <[email protected]>2021-03-27 06:57:11 +0000
commiteedadd70241e70f76b178763fd0e005217e36ea1 (patch)
tree6eaf9996f4e6e177df8d7802bb2046e0505aaa7d /crates/ide/src
parent4520002b63b5a27e7676822aecfb2d435bf36e5a (diff)
Add support for doc on hover for macro 2.0
Diffstat (limited to 'crates/ide/src')
-rw-r--r--crates/ide/src/hover.rs31
1 files changed, 31 insertions, 0 deletions
diff --git a/crates/ide/src/hover.rs b/crates/ide/src/hover.rs
index c43089476..3c951c507 100644
--- a/crates/ide/src/hover.rs
+++ b/crates/ide/src/hover.rs
@@ -1235,6 +1235,37 @@ fn f() { fo$0o!(); }
1235 } 1235 }
1236 1236
1237 #[test] 1237 #[test]
1238 fn test_hover_macro2_invocation() {
1239 check(
1240 r#"
1241/// foo bar
1242///
1243/// foo bar baz
1244macro foo() {}
1245
1246fn f() { fo$0o!(); }
1247"#,
1248 expect![[r#"
1249 *foo*
1250
1251 ```rust
1252 test
1253 ```
1254
1255 ```rust
1256 macro foo
1257 ```
1258
1259 ---
1260
1261 foo bar
1262
1263 foo bar baz
1264 "#]],
1265 )
1266 }
1267
1268 #[test]
1238 fn test_hover_tuple_field() { 1269 fn test_hover_tuple_field() {
1239 check( 1270 check(
1240 r#"struct TS(String, i32$0);"#, 1271 r#"struct TS(String, i32$0);"#,