Skip to content

Diagnostic should use Source #1681

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

Closed
matklad opened this issue Aug 12, 2019 · 0 comments · Fixed by #1683
Closed

Diagnostic should use Source #1681

matklad opened this issue Aug 12, 2019 · 0 comments · Fixed by #1683
Labels
E-has-instructions Issue has some instructions and pointers to code to get started E-medium good first issue

Comments

@matklad
Copy link
Member

matklad commented Aug 12, 2019

In Diagnostic, we have

pub trait Diagnostic {
    fn file(&self) -> HirFileId;
    fn syntax_node_ptr(&self) -> SyntaxNodePtr;
}

I think this should be changed to

pub trait Diagnostic {
    fn source(&self) -> Source<SyntaxNodePtr>;
}

which is the same information, but arranged in a more robust way.

Source is defined here: https://github.com/rust-analyzer/rust-analyzer/blob/e3f8e6023d66ceb37040833bf317d77019bb10f1/crates/ra_hir/src/code_model/src.rs#L9

@matklad matklad added good first issue E-medium E-has-instructions Issue has some instructions and pointers to code to get started labels Aug 12, 2019
bors bot added a commit that referenced this issue Aug 12, 2019
1683: Use Source in Diagnostic r=matklad a=eupn

Closes #1681.

Co-authored-by: Evgenii P <[email protected]>
@bors bors bot closed this as completed in #1683 Aug 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-has-instructions Issue has some instructions and pointers to code to get started E-medium good first issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant