docs: update README with attribute block toggle feature
Add documentation for new attribute block toggle feature including: - New commands: SCLToggleAttrBlock, SCLExpandAllAttrBlocks, SCLCollapseAllAttrBlocks - New keybindings: <Leader>xa, <Leader>xae, <Leader>xac - Feature description and usage example
This commit is contained in:
@@ -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 UDT Scanner** | Scans project for user-defined types (.udt files) |
|
||||||
| **Workspace Global DB Scanner** | Scans project for global data blocks (.db files) |
|
| **Workspace Global DB Scanner** | Scans project for global data blocks (.db files) |
|
||||||
| **blink.cmp Integration** | Smart completion source for blink.cmp |
|
| **blink.cmp Integration** | Smart completion source for blink.cmp |
|
||||||
|
| **Attribute Block Toggle** | Interactive expand/collapse of `{...}` blocks with `<Leader>xa` |
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
@@ -116,6 +117,9 @@ require("scl_lsp").setup({
|
|||||||
| `:SCLMultilineParams` | Fill multiline parameters for FB/Function call |
|
| `:SCLMultilineParams` | Fill multiline parameters for FB/Function call |
|
||||||
| `:LspSCLFormat` | Format current SCL file |
|
| `:LspSCLFormat` | Format current SCL file |
|
||||||
| `:SCLGeneratePlcJson` | Generate plc.data.json from data_types/ |
|
| `: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
|
## Keybindings
|
||||||
|
|
||||||
@@ -127,9 +131,32 @@ require("scl_lsp").setup({
|
|||||||
| `<leader>w` | Workspace Symbols |
|
| `<leader>w` | Workspace Symbols |
|
||||||
| `<Space>mp` | Fill multiline FB/Function parameters (insert mode) |
|
| `<Space>mp` | Fill multiline FB/Function parameters (insert mode) |
|
||||||
| `<Tab>` | Jump to next parameter (insert mode) |
|
| `<Tab>` | Jump to next parameter (insert mode) |
|
||||||
|
| `<Leader>xa` | Toggle attribute block under cursor |
|
||||||
|
| `<Leader>xae` | Expand all attribute blocks |
|
||||||
|
| `<Leader>xac` | Collapse all attribute blocks |
|
||||||
| `<leader>fw` | Workspace Symbols (Telescope) |
|
| `<leader>fw` | Workspace Symbols (Telescope) |
|
||||||
| `<leader>ca` | Code Actions |
|
| `<leader>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 `<Leader>xa` to toggle expand/collapse
|
||||||
|
- Use `<Leader>xae` to expand all blocks in buffer
|
||||||
|
- Use `<Leader>xac` to collapse all blocks
|
||||||
|
|
||||||
|
The formatter also supports automatic collapsing via `collapseAttributes` option.
|
||||||
|
|
||||||
## External UDT Support
|
## External UDT Support
|
||||||
|
|
||||||
### Option 1: Create `.plc.json`
|
### Option 1: Create `.plc.json`
|
||||||
|
|||||||
Reference in New Issue
Block a user