From ce1e27a42d34b061e9c35b19aef0e1339bf87dee Mon Sep 17 00:00:00 2001 From: Lazar Bulovan Date: Thu, 19 Feb 2026 10:13:43 +0100 Subject: [PATCH] docs: update README with attribute block toggle feature Add documentation for new attribute block toggle feature including: - New commands: SCLToggleAttrBlock, SCLExpandAllAttrBlocks, SCLCollapseAllAttrBlocks - New keybindings: xa, xae, xac - Feature description and usage example --- README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/README.md b/README.md index 98b9e42..77f7210 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,7 @@ A comprehensive Neovim/LazyVim plugin providing **Language Server Protocol (LSP) | **Workspace UDT Scanner** | Scans project for user-defined types (.udt files) | | **Workspace Global DB Scanner** | Scans project for global data blocks (.db files) | | **blink.cmp Integration** | Smart completion source for blink.cmp | +| **Attribute Block Toggle** | Interactive expand/collapse of `{...}` blocks with `xa` | ## Installation @@ -116,6 +117,9 @@ require("scl_lsp").setup({ | `:SCLMultilineParams` | Fill multiline parameters for FB/Function call | | `:LspSCLFormat` | Format current SCL file | | `:SCLGeneratePlcJson` | Generate plc.data.json from data_types/ | +| `:SCLToggleAttrBlock` | Toggle attribute block under cursor | +| `:SCLExpandAllAttrBlocks` | Expand all `{...}` blocks in buffer | +| `:SCLCollapseAllAttrBlocks` | Collapse all matching attribute blocks | ## Keybindings @@ -127,9 +131,32 @@ require("scl_lsp").setup({ | `w` | Workspace Symbols | | `mp` | Fill multiline FB/Function parameters (insert mode) | | `` | Jump to next parameter (insert mode) | +| `xa` | Toggle attribute block under cursor | +| `xae` | Expand all attribute blocks | +| `xac` | Collapse all attribute blocks | | `fw` | Workspace Symbols (Telescope) | | `ca` | Code Actions | +## Attribute Block Toggle + +Interactive expand/collapse of SCL variable attribute blocks: + +```scl +-- Before: Verbose attributes +statCounter{EXTERNALACCESSIBLE := 'false'; EXTERNALVISIBLE := 'false'} : Int; + +-- After: Collapsed +statCounter{...} : Int; +``` + +**Usage:** +- Place cursor inside any `{...}` block +- Press `xa` to toggle expand/collapse +- Use `xae` to expand all blocks in buffer +- Use `xac` to collapse all blocks + +The formatter also supports automatic collapsing via `collapseAttributes` option. + ## External UDT Support ### Option 1: Create `.plc.json`