fix: Attribute block expand/collapse, TIME literal diagnostics, and formatter bugs

- SCLFormat: Remove clear_buffer_state() call that was preventing
       expand after formatting (attr_toggle state now preserved)
     - Diagnostics: Fix false 'Undefined variable' for IEC literals
       like T#2s, D#1d, S5T#1s (TIME, DATE, S5TIME types)
     - Formatter: Fix block comments (* ... *) being misidentified as
       FB calls in VAR_IN_OUT/VAR_INPUT/VAR_OUTPUT sections
     - Formatter: Fix array-based FB calls like instTimers[idx].TON()
       not being properly formatted with aligned parameters
This commit is contained in:
2026-02-24 15:27:58 +01:00
parent 15b0e5360a
commit 137eda3e77
-8
View File
@@ -36,10 +36,6 @@ function M.setup(opts)
if opts.lsp and opts.lsp.formatting then
vim.api.nvim_buf_create_user_command(b, "SCLFormat", function()
vim.lsp.buf.format({ name = "scl_lsp" })
local ok, at = pcall(require, "scl.attr_toggle")
if ok then
at.clear_buffer_state(vim.api.nvim_get_current_buf())
end
end, {})
end
end,
@@ -57,10 +53,6 @@ function M.setup(opts)
-- Create global format command (works on current buffer)
vim.api.nvim_create_user_command("SCLFormat", function()
vim.lsp.buf.format({ name = "scl_lsp" })
local ok, at = pcall(require, "scl.attr_toggle")
if ok then
at.clear_buffer_state(vim.api.nvim_get_current_buf())
end
end, {})
-- Start LSP for any existing scl buffers (handles lazy loading case)