Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(forge doc): display custom natspec tag #9257

Merged
merged 1 commit into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading