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

rust-analyzer does not support derive_macro expansion in attributes -
https://github.com/rust-lang/rust-analyzer/issues/8092. This could be
worked around via a proc_macro, but I think it'd be best to just require
docs for every action.

Release Notes:

- N/A
This commit is contained in:
Michael Sloan 2025-01-13 10:48:50 -07:00 committed by GitHub
parent 102e70816c
commit b59a9f1f42
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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,