diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-10-12 08:38:24 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-10-12 08:38:24 +0100 |
commit | 518f6d772482c7c58e59081f340947087a9b4800 (patch) | |
tree | d904f1b98cad63944b4c405238d8b3938a9debb9 /crates/stdx | |
parent | d5fcedb38eec33e2eb12ed550a9b90f6950855fe (diff) | |
parent | 3bd4fe96dce17eb2bff380389b24ea325bf54803 (diff) |
Merge #5917
5917: Add a command to open docs for the symbol under the cursor r=matklad a=zacps
#### Todo
- [ ] Decide if there should be a default keybind or context menu entry
- [x] Figure out how to get the documentation path for methods and other non-top-level defs
- [x] Design the protocol extension. In future we'll probably want parameters for local/remote documentation URLs, so that should maybe be done in this PR?
- [x] Code organisation
- [x] Tests
Co-authored-by: Zac Pullar-Strecker <[email protected]>
Diffstat (limited to 'crates/stdx')
-rw-r--r-- | crates/stdx/src/macros.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/crates/stdx/src/macros.rs b/crates/stdx/src/macros.rs index bf298460f..f5ee3484b 100644 --- a/crates/stdx/src/macros.rs +++ b/crates/stdx/src/macros.rs | |||
@@ -18,7 +18,13 @@ macro_rules! format_to { | |||
18 | }; | 18 | }; |
19 | } | 19 | } |
20 | 20 | ||
21 | // Generates `From` impls for `Enum E { Foo(Foo), Bar(Bar) }` enums | 21 | /// Generates `From` impls for `Enum E { Foo(Foo), Bar(Bar) }` enums |
22 | /// | ||
23 | /// # Example | ||
24 | /// | ||
25 | /// ```rust | ||
26 | /// impl_from!(Struct, Union, Enum for Adt); | ||
27 | /// ``` | ||
22 | #[macro_export] | 28 | #[macro_export] |
23 | macro_rules! impl_from { | 29 | macro_rules! impl_from { |
24 | ($($variant:ident $(($($sub_variant:ident),*))?),* for $enum:ident) => { | 30 | ($($variant:ident $(($($sub_variant:ident),*))?),* for $enum:ident) => { |