3 Commits
Author SHA1 Message Date
lazar 3ba1ccbb1b fix: suppress false SCL003 warning for ARRAY[...] type constructor 2026-07-20 14:52:21 +02:00
lazar 86b3f73daf fix: add all-caps EXTERNAL* variants to allowed VAR attributes
VCI-exported .scl files use all-caps attribute names (EXTERNALACCESSIBLE,
EXTERNALVISIBLE, EXTERNALWRITABLE) which were not in the allowed list,
triggering spurious SCL005 warnings.
2026-07-20 14:23:45 +02:00
lazar ef8a44520d docs: simplify mason section to cross-reference tia-lsp.nvim, add manual setup steps 2026-07-19 15:09:58 +02:00
2 changed files with 25 additions and 6 deletions
+17 -6
View File
@@ -58,14 +58,25 @@ make test
# or: lua src/main.lua --test
```
### Mason Installation (Neovim)
### Neovim + Mason (Recommended)
For Neovim users, install via [mason.nvim](https://github.com/mason-org/mason.nvim) using a custom registry. See the [`tia-lsp.nvim` README](https://gitea.l-tech.rs/lazar/tia-lsp.nvim) for full setup instructions.
The recommended way is via [mason.nvim](https://github.com/mason-org/mason.nvim) using the
[`tia-mason-registry`](https://gitea.l-tech.rs/lazar/tia-mason-registry). See the
[`tia-lsp.nvim` README](https://gitea.l-tech.rs/lazar/tia-lsp.nvim) for full step-by-step instructions.
Quick summary:
1. Add the `tia-mason-registry` as a lazy.nvim plugin
2. Register it with mason: `registries = { "file:~/.local/share/nvim/lazy/tia-mason-registry", "github:mason-org/mason-registry" }`
3. `:MasonInstall tia-lsp`
### Manual Setup
```bash
# 1. Clone this repository
git clone --depth 1 https://gitea.l-tech.rs/lazar/tia-lsp.git ~/tia-lsp
# 2. Compile the tree-sitter parser
cc -fPIC -I ~/tia-lsp/src/tree_sitter -c ~/tia-lsp/src/parser.c -o ~/tia-lsp/parser.o
cc -shared ~/tia-lsp/parser.o -o ~/tia-lsp/parser.so
# 3. Start the server (or configure your editor to run this)
lua ~/tia-lsp/src/main.lua
```
## External UDT Support
+8
View File
@@ -106,6 +106,9 @@ function M.validate_diagnostics(content, workspace_types, root_dir)
ExternalWRITABLE = true, -- case variant
ExternalVISIBLE = true,
ExternalACCESSIBLE = true,
EXTERNALWRITABLE = true, -- all-caps VCI export variant
EXTERNALVISIBLE = true, -- all-caps VCI export variant
EXTERNALACCESSIBLE = true,-- all-caps VCI export variant
S7_SetPoint = true,
S7_Optimized_Access = true,
}
@@ -215,8 +218,13 @@ function M.validate_diagnostics(content, workspace_types, root_dir)
if type_part:match("%s+OF%s+") then
base_type = type_part:match('.*%s+OF%s+"([^"]+)"') or type_part:match(".*%s+OF%s+([%w_]+)")
end
local is_array_keyword = base_type and base_type:upper() == "ARRAY"
and type_part:match("^[Aa][Rr][Rr][Aa][Yy]%[")
local upper_type = base_type and base_type:upper() or nil
if base_type and base_type ~= "" and
not is_array_keyword and
not all_types[base_type] and
not builtin.is_known_data_type(upper_type) and
not builtin.is_known_type_or_instruction(upper_type) then