From 9a55720a8880bc920ed3f0601d72a5643c243974 Mon Sep 17 00:00:00 2001 From: Magnus Larsen Date: Mon, 20 Jan 2025 08:02:45 +0100 Subject: [PATCH] feat(sqruff): include error code in diagnostic --- lua/lint/linters/sqruff.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lua/lint/linters/sqruff.lua b/lua/lint/linters/sqruff.lua index a33ff247..833f2d9e 100644 --- a/lua/lint/linters/sqruff.lua +++ b/lua/lint/linters/sqruff.lua @@ -17,7 +17,6 @@ return { return {} end - local decoded = vim.json.decode(output) local diagnostics = {} local messages = decoded[""] @@ -29,7 +28,7 @@ return { col = msg.range.start.character - 1, end_col = msg.range["end"].character - 1, message = msg.message, - -- code not provided: https://github.com/quarylabs/sqruff/issues/1219 + code = msg.code, source = msg.source, severity = assert(severities[msg.severity], "missing mapping for severity " .. msg.severity), })