diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-03-28 16:43:11 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-03-28 16:43:11 +0100 |
commit | bb1d925dab36372c6bd1fb5671bb68ce938ff009 (patch) | |
tree | ad32fbab8caf6563961b1366c726d8323fb303f5 /crates/ide/src/hover.rs | |
parent | ce6bb5ccca48b177f6cd12b42b4c52f3e1b44e0c (diff) | |
parent | 772987911851d6480ec8c905c0cac1e2f881152c (diff) |
Merge #8212
8212: Basic support macro 2.0 r=jonas-schievink a=edwin0cheng
Turn out it is quite straight forward :)
r @jonas-schievink
![m2](https://user-images.githubusercontent.com/11014119/112712565-6eb99380-8f0b-11eb-88de-5d7f974dfe6d.png)
Co-authored-by: Edwin Cheng <[email protected]>
Diffstat (limited to 'crates/ide/src/hover.rs')
-rw-r--r-- | crates/ide/src/hover.rs | 31 |
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 | ||
1244 | macro foo() {} | ||
1245 | |||
1246 | fn 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);"#, |