Skip to content

Commit b59a9f1

Browse files
authored
Document why rust-analyzer doesn't show action name in action docs (#23072)
rust-analyzer does not support derive_macro expansion in attributes - rust-lang/rust-analyzer#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
1 parent 102e708 commit b59a9f1

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

crates/gpui/src/action.rs

+9-6
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,10 @@ impl ActionRegistry {
252252
macro_rules! actions {
253253
($namespace:path, [ $($name:ident),* $(,)? ]) => {
254254
$(
255-
#[doc = "The `"]
255+
// Unfortunately rust-analyzer doesn't display the name due to
256+
// https://github.com/rust-lang/rust-analyzer/issues/8092
256257
#[doc = stringify!($name)]
257-
#[doc = "` action, see [`gpui::actions!`]"]
258+
#[doc = "action generated by `gpui::actions!`"]
258259
#[derive(::std::clone::Clone,::std::cmp::PartialEq, ::std::default::Default)]
259260
pub struct $name;
260261

@@ -281,9 +282,10 @@ macro_rules! actions {
281282
#[macro_export]
282283
macro_rules! action_as {
283284
($namespace:path, $name:ident as $visual_name:ident) => {
284-
#[doc = "The `"]
285+
// Unfortunately rust-analyzer doesn't display the name due to
286+
// https://github.com/rust-lang/rust-analyzer/issues/8092
285287
#[doc = stringify!($name)]
286-
#[doc = "` action, see [`gpui::actions!`]"]
288+
#[doc = "action generated by `gpui::action_as!`"]
287289
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
288290
pub struct $name;
289291

@@ -311,9 +313,10 @@ macro_rules! action_as {
311313
#[macro_export]
312314
macro_rules! action_aliases {
313315
($namespace:path, $name:ident, [$($alias:ident),* $(,)?]) => {
314-
#[doc = "The `"]
316+
// Unfortunately rust-analyzer doesn't display the name due to
317+
// https://github.com/rust-lang/rust-analyzer/issues/8092
315318
#[doc = stringify!($name)]
316-
#[doc = "` action, see [`gpui::actions!`]"]
319+
#[doc = "action, generated by `gpui::action_aliases!`"]
317320
#[derive(
318321
::std::cmp::PartialEq,
319322
::std::clone::Clone,

0 commit comments

Comments
 (0)