docs: add auto-editing features section to AGENTS.md

This commit is contained in:
2026-02-21 01:50:39 +01:00
parent 015dcc985a
commit fed4dcf93a
+28 -3
View File
@@ -283,6 +283,34 @@ The LSP supports goto declaration functionality for:
Usage: Place cursor on a variable or type name and press `gD` (or use LSP client command). Usage: Place cursor on a variable or type name and press `gD` (or use LSP client command).
## Auto-Editing Features
### Auto-Uppercase Keywords
When typing SCL keywords followed by a space, they are automatically converted to uppercase:
- `if ``IF `
- `then ``THEN `
- `end_if``END_IF`
- etc.
Works in `.scl`, `.udt`, and `.db` files.
### Auto-Semicolon for Control Structures
When pressing Enter after an `END_*` control structure keyword, a semicolon is automatically added:
- `END_IF``END_IF;`
- `END_FOR``END_FOR;`
- `END_WHILE``END_WHILE;`
- `END_REPEAT``END_REPEAT;`
- `END_CASE``END_CASE;`
Block definitions (END_VAR, END_FUNCTION, etc.) are NOT affected.
### Auto-Prefix Local Variables
Local variables are automatically prefixed with `#` when typing space or semicolon after BEGIN:
- `myVar := ``#myVar := `
- `counter.in``#counter.in` (on dot)
Can be toggled with `:lua require("scl.auto_prefix").toggle()`.
## Keybindings (SCL/UDT files) ## Keybindings (SCL/UDT files)
### Attribute Block Toggle ### Attribute Block Toggle
@@ -304,9 +332,6 @@ Interactive expand/collapse of individual `{...}` blocks (uses `<Leader>x` prefi
| Key | Mode | Description | | Key | Mode | Description |
|-----|------|-------------| |-----|------|-------------|
| `<Leader>xa` | Normal/Insert | Toggle attribute block under cursor |
| `<Leader>xae` | Normal | Expand all attribute blocks |
| `<Leader>xac` | Normal | Collapse all attribute blocks |
| `<Space>mp` | Insert | Fill multiline FB parameters | | `<Space>mp` | Insert | Fill multiline FB parameters |
| `<Tab>` | Insert | Jump to next parameter or regular Tab | | `<Tab>` | Insert | Jump to next parameter or regular Tab |