Merge branch 'feat/lsp_goto' into develop

This commit is contained in:
2026-02-20 09:40:45 +01:00
2 changed files with 24 additions and 1 deletions
+23
View File
@@ -50,6 +50,18 @@ scl_lsp/
└── grammar.js # Tree-sitter grammar └── grammar.js # Tree-sitter grammar
``` ```
## Filetype Detection
The LSP requires the `scl` filetype to be set. Add to your Neovim config (e.g., `ftdetect/scl.vim`):
```vim
au BufRead,BufNewFile *.scl set filetype=scl
au BufRead,BufNewFile *.udt set filetype=scl
au BufRead,BufNewFile *.db set filetype=scl
```
This enables LSP features (completion, goto definition, hover, etc.) for all SCL-related file types.
## Code Style Guidelines ## Code Style Guidelines
### Module Pattern ### Module Pattern
@@ -235,6 +247,17 @@ Rules are checked in order; first match wins.
| `:SCLExpandAllAttrBlocks` | Expand all `{...}` blocks in buffer | | `:SCLExpandAllAttrBlocks` | Expand all `{...}` blocks in buffer |
| `:SCLCollapseAllAttrBlocks` | Collapse all matching attribute blocks | | `:SCLCollapseAllAttrBlocks` | Collapse all matching attribute blocks |
## LSP Features
### Goto Declaration (`gD`)
The LSP supports goto declaration functionality for:
- **Functions** - Jump to function definition in `.scl` files
- **Function Blocks (FB)** - Jump to FB definition in `.scl` files
- **Data Blocks (DB)** - Jump to DB definition in `.scl` and `.db` files
- **User-Defined Types (UDT)** - Jump to type definition in `.scl` and `.udt` files
Usage: Place cursor on a variable or type name and press `gD` (or use LSP client command).
## Keybindings (SCL/UDT files) ## Keybindings (SCL/UDT files)
### Attribute Block Toggle ### Attribute Block Toggle
+1 -1
View File
@@ -9,7 +9,7 @@ A comprehensive Neovim/LazyVim plugin providing **Language Server Protocol (LSP)
|---------|-------------| |---------|-------------|
| **Hover** | Press `K` to see variable type and struct fields | | **Hover** | Press `K` to see variable type and struct fields |
| **Completion** | `#` for variables, `.` for struct fields, `(` for functions | | **Completion** | `#` for variables, `.` for struct fields, `(` for functions |
| **Go to Definition** | `gd` jump to variable declaration | | **Go to Definition** | `gD` jump to function, FB, DB, or UDT definition |
| **Document Symbols** | Shows functions, variables, types | | **Document Symbols** | Shows functions, variables, types |
| **Workspace Symbols** | Search across all `.scl` files with fuzzy matching | | **Workspace Symbols** | Search across all `.scl` files with fuzzy matching |
| **Semantic Tokens** | Keywords, variables highlighted | | **Semantic Tokens** | Keywords, variables highlighted |