mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-02 08:11:12 +00:00
Added can_problem and Docs
This commit is contained in:
parent
d5163fa4d4
commit
a1b8c97039
1 changed files with 15 additions and 2 deletions
|
@ -12,8 +12,15 @@ pub struct Report {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Report {
|
impl Report {
|
||||||
pub fn problem(filename: PathBuf, problem: Problem) -> Self {
|
pub fn can_problem(filename: PathBuf, problem: Problem) -> Self {
|
||||||
let text = ReportText::Plain("TODO convert Problem to ReportText".into());
|
let text = match problem {
|
||||||
|
Problem::UnusedDef(symbol, region) => {
|
||||||
|
panic!("TODO implelment me!");
|
||||||
|
}
|
||||||
|
_ => {
|
||||||
|
panic!("TODO implement others");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
Report { filename, text }
|
Report { filename, text }
|
||||||
}
|
}
|
||||||
|
@ -39,6 +46,9 @@ pub enum ReportText {
|
||||||
|
|
||||||
/// A URL, which should be rendered as a hyperlink.
|
/// A URL, which should be rendered as a hyperlink.
|
||||||
Url(Box<str>),
|
Url(Box<str>),
|
||||||
|
|
||||||
|
/// The documentation for this symbol.
|
||||||
|
Docs(Symbol),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ReportText {
|
impl ReportText {
|
||||||
|
@ -83,6 +93,9 @@ impl ReportText {
|
||||||
src_lines, region
|
src_lines, region
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Docs(_) => {
|
||||||
|
panic!("TODO implment docs");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue