feat: improve formatter and attribute block handling
- Format multi-line assignments with proper alignment - Format FB calls in multiline style with parameter alignment - Auto-expand collapsed attribute blocks before save - Rename command from LspSCLFormat to SCLFormat - Condense AGENTS.md and add testing section with reference project
This commit is contained in:
@@ -34,9 +34,8 @@ function M.setup(opts)
|
||||
end
|
||||
|
||||
if opts.lsp and opts.lsp.formatting then
|
||||
vim.api.nvim_buf_create_user_command(b, "LspSCLFormat", function()
|
||||
vim.api.nvim_buf_create_user_command(b, "SCLFormat", function()
|
||||
vim.lsp.buf.format({ name = "scl_lsp" })
|
||||
-- Clear attr_toggle state since line positions may have changed
|
||||
local ok, at = pcall(require, "scl.attr_toggle")
|
||||
if ok then
|
||||
at.clear_buffer_state(vim.api.nvim_get_current_buf())
|
||||
@@ -56,9 +55,8 @@ function M.setup(opts)
|
||||
})
|
||||
|
||||
-- Create global format command (works on current buffer)
|
||||
vim.api.nvim_create_user_command("LspSCLFormat", function()
|
||||
vim.api.nvim_create_user_command("SCLFormat", function()
|
||||
vim.lsp.buf.format({ name = "scl_lsp" })
|
||||
-- Clear attr_toggle state since line positions may have changed
|
||||
local ok, at = pcall(require, "scl.attr_toggle")
|
||||
if ok then
|
||||
at.clear_buffer_state(vim.api.nvim_get_current_buf())
|
||||
|
||||
Reference in New Issue
Block a user