MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / into_code_diagnostic

Method into_code_diagnostic

src/diagnostics/lsp/client.rs:601–621  ·  view source on GitHub ↗
(self, document: &LspDocument, command: &str)

Source from the content-addressed store, hash-verified

599
600impl LspDiagnostic {
601 fn into_code_diagnostic(self, document: &LspDocument, command: &str) -> CodeDiagnostic {
602 CodeDiagnostic {
603 language: document.language.clone(),
604 source: self.source.unwrap_or_else(|| command.to_string()),
605 file: document.relative_path.clone(),
606 line_start: self.range.start.line + 1,
607 line_end: self.range.end.line + 1,
608 character_start: Some(self.range.start.character),
609 character_end: Some(self.range.end.character),
610 severity: match self.severity {
611 Some(1) => DiagnosticSeverity::Error,
612 Some(2) => DiagnosticSeverity::Warning,
613 Some(4) => DiagnosticSeverity::Hint,
614 _ => DiagnosticSeverity::Information,
615 },
616 code: self.code.and_then(code_to_string),
617 message: self.message,
618 enclosing_node: None,
619 updated_at: now_unix(),
620 }
621 }
622}
623
624fn now_unix() -> i64 {

Callers 1

Calls 1

now_unixFunction · 0.70

Tested by

no test coverage detected