Skip to content

Commit

Permalink
fix: properly display unsupported tags (#357)
Browse files Browse the repository at this point in the history
  • Loading branch information
rojvv authored Oct 27, 2023
1 parent eaed9ca commit 46e9c53
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/printer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,15 @@ impl<'a> DocPrinter<'a> {
self.format_jsdoc_tag_maybe_doc(w, doc, indent)
}
JsDocTag::Unsupported { value } => {
writeln!(w, "{}@{}", Indent(indent), colors::magenta(value))
let name = value.split_whitespace().next().unwrap_or("@");
let value = &value[name.len()..];
writeln!(
w,
"{}@{}{}",
Indent(indent),
colors::magenta(&name[1..]),
value
)
}
}
}
Expand Down
17 changes: 17 additions & 0 deletions src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6581,6 +6581,23 @@ import Options = Test.Options;
export { Options };";
"interface Options"
);

contains_test!(doc_printer_unsupported_tag,
r#"
/**
* @customtagone
* @customtagtwo value
*/
export function noop() {
}
"#;
"
function noop()
@customtagone
@customtagtwo value
"
);
}

fn create_analyzer() -> CapturingModuleAnalyzer {
Expand Down

0 comments on commit 46e9c53

Please sign in to comment.