Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Document why rust-analyzer doesn't show action name in action docs (#23072)

Michael Sloanb59a9f1f42b3
diff --git a/crates/gpui/src/action.rs b/crates/gpui/src/action.rs
index bc7388e513e..06029676650 100644
--- a/crates/gpui/src/action.rs
+++ b/crates/gpui/src/action.rs
@@ -252,9 +252,10 @@ impl ActionRegistry {
macro_rules! actions {
($namespace:path, [ $($name:ident),* $(,)? ]) => {
$(
- #[doc = "The `"]
+ // Unfortunately rust-analyzer doesn't display the name due to
+ // https://github.com/rust-lang/rust-analyzer/issues/8092
#[doc = stringify!($name)]
- #[doc = "` action, see [`gpui::actions!`]"]
+ #[doc = "action generated by `gpui::actions!`"]
#[derive(::std::clone::Clone,::std::cmp::PartialEq, ::std::default::Default)]
pub struct $name;
@@ -281,9 +282,10 @@ macro_rules! actions {
#[macro_export]
macro_rules! action_as {
($namespace:path, $name:ident as $visual_name:ident) => {
- #[doc = "The `"]
+ // Unfortunately rust-analyzer doesn't display the name due to
+ // https://github.com/rust-lang/rust-analyzer/issues/8092
#[doc = stringify!($name)]
- #[doc = "` action, see [`gpui::actions!`]"]
+ #[doc = "action generated by `gpui::action_as!`"]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
pub struct $name;
@@ -311,9 +313,10 @@ macro_rules! action_as {
#[macro_export]
macro_rules! action_aliases {
($namespace:path, $name:ident, [$($alias:ident),* $(,)?]) => {
- #[doc = "The `"]
+ // Unfortunately rust-analyzer doesn't display the name due to
+ // https://github.com/rust-lang/rust-analyzer/issues/8092
#[doc = stringify!($name)]
- #[doc = "` action, see [`gpui::actions!`]"]
+ #[doc = "action, generated by `gpui::action_aliases!`"]
#[derive(
::std::cmp::PartialEq,
::std::clone::Clone,