Change the default ts_parser_url from the local file:// path to the
Gitea-hosted tia-lsp repository, so :TSInstall scl works out of the
box after the repo split.
Rename the project from scl_lsp to tia_lsp to future-proof for additional
TIA Portal languages (STL/AWL, LAD, FBD). The 'scl' language name is kept
as-is for the SCL filetype and tree-sitter parser; future languages get
their own names (stl, lad, fbd).
Project-wide changes:
- lua/scl_lsp/ → lua/tia_lsp/ (plugin entry point)
- lua/scl/ → lua/tia/ (language modules, shared across TIA langs)
- require('scl.*') → require('tia.*')
- require('scl_lsp') → require('tia_lsp')
- LSP client name: 'scl_lsp' → 'tia_lsp'
- Diagnostic source: 'scl_lsp' → 'tia_lsp' (src/diagnostics.lua)
- package.json name: 'scl-language-server' → 'tia-lsp'
lua/tia_lsp/init.lua:
- Add vim.fn.exepath('tia-lsp') detection so the plugin prefers the
mason-installed executable and falls back to { 'lua', server_path }
for manual installs.
- Add opts.ts_parser_url to configure the tree-sitter parser source.
- Remove hardcoded ~/dev/scl_lsp paths in favor of ~/dev/tia-lsp and
the new ts_parser_url option.
Cleanup:
- Delete lua/tia/init.lua (dead code, unreferenced duplicate of tia_lsp).
- Delete scl_lsp.sh (replaced by the mason-installed bin/tia-lsp wrapper).
- Update README.md and AGENTS.md to reflect the two-repo split
(tia-lsp server + tia-lsp.nvim plugin) and document Mason installation.
Unchanged (intentional):
- grammar.js, src/grammar.json, src/parser.c: tree-sitter language name
remains 'scl' (it's the language, not the project).
- Filetype patterns ('scl', 'udt', 'db') in autocmds.
- :SCL* command names (per-filetype prefix; future :STL* etc.).
Tests pass with the same pre-existing failures as before the rename
(formatter VAR_INPUT test, udt_parser line 199 const-variable bug,
plc_json reference-project-missing). No new failures introduced.
- SCLFormat: Remove clear_buffer_state() call that was preventing
expand after formatting (attr_toggle state now preserved)
- Diagnostics: Fix false 'Undefined variable' for IEC literals
like T#2s, D#1d, S5T#1s (TIME, DATE, S5TIME types)
- Formatter: Fix block comments (* ... *) being misidentified as
FB calls in VAR_IN_OUT/VAR_INPUT/VAR_OUTPUT sections
- Formatter: Fix array-based FB calls like instTimers[idx].TON()
not being properly formatted with aligned parameters
- Update AGENTS.md to encourage comments instead of forbidding them
- Add docstrings to all public functions in src/ modules
- Add module headers and function comments to lua/scl/ modules
- Fix formatter to properly indent multi-line IF/ELSIF conditions
- Fix FB call detection to not match IF statements with parentheses
- 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
- Auto-uppercase SCL keywords (IF, CASE, FOR, NOT, AND, etc.) when typing space
- Auto-add semicolon after END_* keywords (END_IF, END_FOR, etc.) when:
- Leaving insert mode on a line ending with END_*
- Pressing Enter after typing END_*
- Added complete keyword list including TYPE, STRUCT, DATA_BLOCK, etc.
- Works for .scl, .udt, and .db files
- Add case-insensitive pattern matching for attributes
- Add patterns for NonRetain and Retain attributes
- Add generic patterns for key := value and single word attributes
- Fix BufUnload autocmd to also handle *.udt and *.db files
When :LspSCLFormat is used, line numbers and positions change,
but the attr_toggle module stores state based on old positions.
This caused toggle/expand/collapse to not work after formatting.
Now clears the attr_toggle buffer state after formatting so that
users can collapse blocks fresh after formatting.
The function searches for := or => patterns anywhere in the code,
without verifying that the cursor is inside an FB/Function call context
Added is_inside_fb_call() function (lines 133-176):
- Traces backwards from cursor position
- Tracks parenthesis depth to skip nested calls
- Finds the opening ( of an FB call and checks if the name before it is a known variable
- Returns true only if cursor is inside an FB/Function call
Modified jump_to_next_param() (lines 178-189):
- Now returns false immediately if not inside an FB call context
- This causes the keymap to fall back to normal <Tab> behavior
Result:
- Inside FB call: <Tab> jumps to next := or =>
- Outside FB call: <Tab> behaves normally (inserts tab character)
The completion now correctly handles DB patterns after any operator
(:=, =>, =, <>, >=, <=, >, <, AND, OR, NOT) by finding the last operator
and only matching DB patterns in the active portion after it.
- Add db_parser.lua to parse .db files (DATA_BLOCK with VAR sections)
- Update workspace_types.lua to scan for .db files in project
- Update blink_cmp_source.lua to provide DB auto-completion:
- DB names available in general completion (without quotes)
- Type quote to get DB members
- Multi-level nested member access support
- Add DB count to workspace commands
- Update README with Global DB documentation
- Fix FB/function call parameter detection to prevent incorrect # prefixing
- Preserve # prefix when filling multiline params
- Add comma after first parameter and closing bracket on last param line
- Fix Tab navigation to position cursor after :=/=> operators
- Clean up dead code in multiline_params.lua
- Add setup functions for multiline params feature in both scl and scl_lsp