Skip to content

Commit

Permalink
fix(forge doc): display custom natspec tag (foundry-rs#9257)
Browse files Browse the repository at this point in the history
fix(forge doc): display custom natspec tag
  • Loading branch information
leovct authored and rplusq committed Nov 29, 2024
1 parent b4152d0 commit 587897d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions crates/doc/src/parser/comment.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use alloy_primitives::map::HashMap;
use derive_more::{Deref, DerefMut};
use derive_more::{derive::Display, Deref, DerefMut};
use solang_parser::doccomment::DocCommentTag;

/// The natspec comment tag explaining the purpose of the comment.
/// See: <https://docs.soliditylang.org/en/v0.8.17/natspec-format.html#tags>.
#[derive(Clone, Debug, PartialEq, Eq)]
#[derive(Clone, Debug, Display, PartialEq, Eq)]
pub enum CommentTag {
/// A title that should describe the contract/interface
Title,
Expand Down
3 changes: 2 additions & 1 deletion crates/doc/src/writer/as_doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,9 @@ impl AsDoc for CommentsRef<'_> {
writer.write_bold(&format!("Note{}:", if customs.len() == 1 { "" } else { "s" }))?;
for c in customs.iter() {
writer.writeln_raw(format!(
"{}{}",
"{}{}: {}",
if customs.len() == 1 { "" } else { "- " },
&c.tag,
&c.value
))?;
writer.writeln()?;
Expand Down

0 comments on commit 587897d

Please sign in to comment.