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:
parent
102e70816c
commit
b59a9f1f42
1 changed files with 9 additions and 6 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue