From b879a25fc2c985d76cca26a9f4ec63eb1be9ee14 Mon Sep 17 00:00:00 2001 From: Predrag Nikolic Date: Sat, 12 Dec 2020 00:12:47 +0100 Subject: [PATCH] fix: diagnostics line regex this will make sure the last line `1018:1 error Invalid type "sublime.TextChange.str" mypy` is also matched. (before this commit that line wasn't matched) plugin/documents.py: 3:2 error Cannot find module named '.completion' mypy 4:2 error Cannot find module named '.core.css' mypy 1018:1 error Invalid type "sublime.TextChange.str" mypy --- Syntaxes/Diagnostics.sublime-syntax | 2 +- plugin/core/diagnostics.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Syntaxes/Diagnostics.sublime-syntax b/Syntaxes/Diagnostics.sublime-syntax index 32ab4e871..9b071f506 100644 --- a/Syntaxes/Diagnostics.sublime-syntax +++ b/Syntaxes/Diagnostics.sublime-syntax @@ -18,7 +18,7 @@ contexts: 2: punctuation.separator.lsp line: - - match: ^\s+(?=\d) + - match: ^\s*(?=\d) push: - ensure-diag-meta-scope - expect-source-and-code diff --git a/plugin/core/diagnostics.py b/plugin/core/diagnostics.py index caa84e6b7..96986b433 100644 --- a/plugin/core/diagnostics.py +++ b/plugin/core/diagnostics.py @@ -7,7 +7,7 @@ def ensure_diagnostics_panel(window: sublime.Window) -> Optional[sublime.View]: - return ensure_panel(window, "diagnostics", r"^(.*):$", r"^\s+(\d+):(\d+)", + return ensure_panel(window, "diagnostics", r"^(.*):$", r"^\s*(\d+):(\d+)", "Packages/LSP/Syntaxes/Diagnostics.sublime-syntax")