Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

Commit

Permalink
chore: do not show the URL in case it's broken
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico committed Dec 23, 2022
1 parent f6982db commit acc99d1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 3 additions & 2 deletions crates/rome_lsp/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,9 @@ pub(crate) fn diagnostic_to_lsp<D: Diagnostic>(
let code_description = diagnostic
.category()
.and_then(|category| category.link())
.map(|link| CodeDescription {
href: Url::parse(link).unwrap(),
.and_then(|link| {
let href = Url::parse(link).ok()?;
Some(CodeDescription { href })
});

let message = PrintDescription(&diagnostic).to_string();
Expand Down
4 changes: 4 additions & 0 deletions website/src/pages/lint/rules/noInnerDeclarations.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,7 @@ function f() {
}
```

## Related links

- [Disable a rule](/linter/#disable-a-lint-rule)
- [Rule options](/linter/#rule-options)

0 comments on commit acc99d1

Please sign in to comment.