@@ -247,17 +247,36 @@ impl EditorView {
247247 doc: &Document,
248248 theme: &Theme,
249249 ) -> Vec<(usize, std::ops::Range<usize>)> {
250− let diagnostic_scope = theme
251− .find_scope_index("diagnostic")
250+ use helix_core::diagnostic::Severity;
251+ let get_scope_of = |scope| {
252+ theme
253+ .find_scope_index(scope)
254+ // get one of the themes below as fallback values
255+ .or_else(|| theme.find_scope_index("diagnostic"))
252256 .or_else(|| theme.find_scope_index("ui.cursor"))
253257 .or_else(|| theme.find_scope_index("ui.selection"))
254258 .expect(
255259 "at least one of the following scopes must be defined in the theme: `diagnostic`, `ui.cursor`, or `ui.selection`",
256− );
260+ )
261+ };
262+
263+ // basically just queries the theme color defined in the config
264+ let hint = get_scope_of("diagnostic.hint");
265+ let info = get_scope_of("diagnostic.info");
266+ let warning = get_scope_of("diagnostic.warning");
267+ let error = get_scope_of("diagnostic.error");
268+ let r#default = get_scope_of("diagnostic"); // this is a bit redundant but should be fine
257269
258270 doc.diagnostics()
259271 .iter()
260272 .map(|diagnostic| {
273+ let diagnostic_scope = match diagnostic.severity {
274+ Some(Severity::Info) => info,
275+ Some(Severity::Hint) => hint,
276+ Some(Severity::Warning) => warning,
277+ Some(Severity::Error) => error,
278+ _ => r#default,
279+ };
261280 (
262281 diagnostic_scope,
263282 diagnostic.range.start..diagnostic.range.end,