diff --git a/crates/nu-lsp/src/diagnostics.rs b/crates/nu-lsp/src/diagnostics.rs index 92ea2073ff..2c41b7fde6 100644 --- a/crates/nu-lsp/src/diagnostics.rs +++ b/crates/nu-lsp/src/diagnostics.rs @@ -38,6 +38,17 @@ impl LanguageServer { }); } + for warn in working_set.parse_warnings.iter() { + let message = warn.to_string(); + + diagnostics.diagnostics.push(Diagnostic { + range: span_to_range(&warn.span(), file, span.start), + severity: Some(DiagnosticSeverity::WARNING), + message, + ..Default::default() + }); + } + self.connection .sender .send(lsp_server::Message::Notification(