Rip out "diagnostic providers"
This commit is contained in:
parent
496066db59
commit
508b9dc024
16 changed files with 267 additions and 688 deletions
|
@ -571,7 +571,7 @@ mod tests {
|
|||
use super::*;
|
||||
use client::{http::ServerResponse, test::FakeHttpClient, Client, UserStore};
|
||||
use gpui::TestAppContext;
|
||||
use language::{Diagnostic, DiagnosticEntry, DiagnosticSeverity, LanguageRegistry};
|
||||
use language::{Diagnostic, DiagnosticEntry, DiagnosticSeverity, LanguageRegistry, PointUtf16};
|
||||
use project::FakeFs;
|
||||
use serde_json::json;
|
||||
use std::sync::Arc;
|
||||
|
@ -629,11 +629,12 @@ mod tests {
|
|||
|
||||
worktree.update(&mut cx, |worktree, cx| {
|
||||
worktree
|
||||
.update_diagnostics_from_provider(
|
||||
.update_diagnostic_entries(
|
||||
Arc::from("/test/main.rs".as_ref()),
|
||||
None,
|
||||
vec![
|
||||
DiagnosticEntry {
|
||||
range: 20..21,
|
||||
range: PointUtf16::new(1, 8)..PointUtf16::new(1, 9),
|
||||
diagnostic: Diagnostic {
|
||||
message:
|
||||
"move occurs because `x` has type `Vec<char>`, which does not implement the `Copy` trait"
|
||||
|
@ -646,7 +647,7 @@ mod tests {
|
|||
},
|
||||
},
|
||||
DiagnosticEntry {
|
||||
range: 40..41,
|
||||
range: PointUtf16::new(2, 8)..PointUtf16::new(2, 9),
|
||||
diagnostic: Diagnostic {
|
||||
message:
|
||||
"move occurs because `y` has type `Vec<char>`, which does not implement the `Copy` trait"
|
||||
|
@ -659,7 +660,7 @@ mod tests {
|
|||
},
|
||||
},
|
||||
DiagnosticEntry {
|
||||
range: 58..59,
|
||||
range: PointUtf16::new(3, 6)..PointUtf16::new(3, 7),
|
||||
diagnostic: Diagnostic {
|
||||
message: "value moved here".to_string(),
|
||||
severity: DiagnosticSeverity::INFORMATION,
|
||||
|
@ -670,7 +671,7 @@ mod tests {
|
|||
},
|
||||
},
|
||||
DiagnosticEntry {
|
||||
range: 68..69,
|
||||
range: PointUtf16::new(4, 6)..PointUtf16::new(4, 7),
|
||||
diagnostic: Diagnostic {
|
||||
message: "value moved here".to_string(),
|
||||
severity: DiagnosticSeverity::INFORMATION,
|
||||
|
@ -681,7 +682,7 @@ mod tests {
|
|||
},
|
||||
},
|
||||
DiagnosticEntry {
|
||||
range: 112..113,
|
||||
range: PointUtf16::new(7, 6)..PointUtf16::new(7, 7),
|
||||
diagnostic: Diagnostic {
|
||||
message: "use of moved value".to_string(),
|
||||
severity: DiagnosticSeverity::ERROR,
|
||||
|
@ -692,7 +693,7 @@ mod tests {
|
|||
},
|
||||
},
|
||||
DiagnosticEntry {
|
||||
range: 112..113,
|
||||
range: PointUtf16::new(7, 6)..PointUtf16::new(7, 7),
|
||||
diagnostic: Diagnostic {
|
||||
message: "value used here after move".to_string(),
|
||||
severity: DiagnosticSeverity::INFORMATION,
|
||||
|
@ -703,7 +704,7 @@ mod tests {
|
|||
},
|
||||
},
|
||||
DiagnosticEntry {
|
||||
range: 122..123,
|
||||
range: PointUtf16::new(8, 6)..PointUtf16::new(8, 7),
|
||||
diagnostic: Diagnostic {
|
||||
message: "use of moved value".to_string(),
|
||||
severity: DiagnosticSeverity::ERROR,
|
||||
|
@ -714,7 +715,7 @@ mod tests {
|
|||
},
|
||||
},
|
||||
DiagnosticEntry {
|
||||
range: 122..123,
|
||||
range: PointUtf16::new(8, 6)..PointUtf16::new(8, 7),
|
||||
diagnostic: Diagnostic {
|
||||
message: "value used here after move".to_string(),
|
||||
severity: DiagnosticSeverity::INFORMATION,
|
||||
|
@ -782,11 +783,12 @@ mod tests {
|
|||
|
||||
worktree.update(&mut cx, |worktree, cx| {
|
||||
worktree
|
||||
.update_diagnostics_from_provider(
|
||||
.update_diagnostic_entries(
|
||||
Arc::from("/test/a.rs".as_ref()),
|
||||
None,
|
||||
vec![
|
||||
DiagnosticEntry {
|
||||
range: 15..15,
|
||||
range: PointUtf16::new(0, 15)..PointUtf16::new(0, 15),
|
||||
diagnostic: Diagnostic {
|
||||
message: "mismatched types".to_string(),
|
||||
severity: DiagnosticSeverity::ERROR,
|
||||
|
@ -797,7 +799,7 @@ mod tests {
|
|||
},
|
||||
},
|
||||
DiagnosticEntry {
|
||||
range: 15..15,
|
||||
range: PointUtf16::new(0, 15)..PointUtf16::new(0, 15),
|
||||
diagnostic: Diagnostic {
|
||||
message: "expected `usize`, found `char`".to_string(),
|
||||
severity: DiagnosticSeverity::INFORMATION,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue