mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-12 08:36:03 +00:00
remove option from Diagnostic
This commit is contained in:
parent
70df097c89
commit
29798c763c
@ -364,7 +364,7 @@ impl AnalysisImpl {
|
||||
.map(|d| Diagnostic {
|
||||
range: d.range,
|
||||
message: d.msg,
|
||||
severity: Some(d.severity),
|
||||
severity: d.severity,
|
||||
fix: None,
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
@ -386,7 +386,7 @@ impl AnalysisImpl {
|
||||
Diagnostic {
|
||||
range: name_node.range(),
|
||||
message: "unresolved module".to_string(),
|
||||
severity: Some(Severity::Error),
|
||||
severity: Severity::Error,
|
||||
fix: Some(fix),
|
||||
}
|
||||
}
|
||||
@ -409,7 +409,7 @@ impl AnalysisImpl {
|
||||
Diagnostic {
|
||||
range: name_node.range(),
|
||||
message: "can't declare module at this location".to_string(),
|
||||
severity: Some(Severity::Error),
|
||||
severity: Severity::Error,
|
||||
fix: Some(fix),
|
||||
}
|
||||
}
|
||||
|
@ -197,7 +197,7 @@ pub struct Diagnostic {
|
||||
pub message: String,
|
||||
pub range: TextRange,
|
||||
pub fix: Option<SourceChange>,
|
||||
pub severity: Option<Severity>,
|
||||
pub severity: Severity,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
|
@ -13,7 +13,7 @@ use gen_lsp_server::{
|
||||
};
|
||||
use languageserver_types::NumberOrString;
|
||||
use ra_analysis::{Canceled, FileId, LibraryData};
|
||||
use ra_vfs::{VfsTask};
|
||||
use ra_vfs::VfsTask;
|
||||
use rayon;
|
||||
use threadpool::ThreadPool;
|
||||
use rustc_hash::FxHashSet;
|
||||
@ -23,7 +23,7 @@ use failure_derive::Fail;
|
||||
|
||||
use crate::{
|
||||
main_loop::subscriptions::Subscriptions,
|
||||
project_model::{workspace_loader},
|
||||
project_model::workspace_loader,
|
||||
req,
|
||||
server_world::{ServerWorld, ServerWorldState},
|
||||
Result,
|
||||
|
@ -650,7 +650,7 @@ pub fn publish_diagnostics(
|
||||
.into_iter()
|
||||
.map(|d| Diagnostic {
|
||||
range: d.range.conv_with(&line_index),
|
||||
severity: d.severity.map(to_diagnostic_severity),
|
||||
severity: Some(to_diagnostic_severity(d.severity)),
|
||||
code: None,
|
||||
source: Some("rust-analyzer".to_string()),
|
||||
message: d.message,
|
||||
|
Loading…
Reference in New Issue
Block a user