-
Notifications
You must be signed in to change notification settings - Fork 1.6k
add diagnostic Span (couples File and TextRange)
#16101
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
Changes from 4 commits
b993468
8b86a5f
868e3b5
1266c26
ace0455
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,7 +8,7 @@ use crate::types::string_annotation::{ | |
| }; | ||
| use crate::types::{ClassLiteralType, KnownInstanceType, Type}; | ||
| use crate::{declare_lint, Db}; | ||
| use ruff_db::diagnostic::{Diagnostic, DiagnosticId, Severity}; | ||
| use ruff_db::diagnostic::{Diagnostic, DiagnosticId, Severity, Span}; | ||
| use ruff_db::files::File; | ||
| use ruff_python_ast::{self as ast, AnyNodeRef}; | ||
| use ruff_text_size::{Ranged, TextRange}; | ||
|
|
@@ -802,12 +802,8 @@ impl Diagnostic for TypeCheckDiagnostic { | |
| TypeCheckDiagnostic::message(self).into() | ||
| } | ||
|
|
||
| fn file(&self) -> Option<File> { | ||
| Some(TypeCheckDiagnostic::file(self)) | ||
| } | ||
|
|
||
| fn range(&self) -> Option<TextRange> { | ||
| Some(Ranged::range(self)) | ||
| fn span(&self) -> Option<Span> { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same: I'm sort of inclined to simply store the
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one is a little trickier because a |
||
| Some(Span::from(self.file).with_range(self.range)) | ||
| } | ||
|
|
||
| fn severity(&self) -> Severity { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.