From 789b7ada1b4f00e08d026dffde410dcfa6a0ba87 Mon Sep 17 00:00:00 2001 From: Magnus Larsen Date: Tue, 21 Jan 2025 20:31:56 +0100 Subject: [PATCH] sqruff: include error code in diagnostic (#729) --- 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), })