Compare commits

..
7 Commits
Author SHA1 Message Date
lazar e7152cd6d4 version bump 2026-07-24 13:22:34 +02:00
lazar 514498ac37 version bump 2026-07-20 19:32:19 +02:00
lazar bf636c95e2 docs: initial README explaining purpose and how the registry works 2026-07-19 15:09:59 +02:00
lazar 4d670ae31f version bump 2026-07-18 20:25:38 +02:00
lazar 7a7d9e433e version bump 2026-07-18 19:44:08 +02:00
lazar 5f57d8516a feat: compile tree-sitter parser.so during install + bump to v0.1.1
The mason build script now compiles parser.c into parser.so using cc,
so the plugin can load it via vim.treesitter.language.add() without
requiring :TSInstall (which doesn't work for custom parsers in current
nvim-treesitter).

Also bumps the package version from @0.1.0 to @0.1.1 to include the
semanticTokensProvider fix and the readlink symlink resolution fix.

The parser.so is registered as a 'share' file so mason links it to a
stable path. The plugin resolves it via exepath('tia-lsp').
2026-07-18 18:01:45 +02:00
lazar d06341b26b fix: resolve symlink in bin wrapper with readlink -f
Mason's bin/ directory contains a symlink to the actual wrapper script
in packages/<name>/bin/. The wrapper used $(dirname "$0") which
resolved to mason/bin/ (the symlink location), then ../src/main.lua
pointed to mason/src/main.lua which doesn't exist.

Use readlink -f to resolve the symlink first, so dirname points to
packages/tia-lsp/bin/ and ../src/main.lua correctly resolves to
packages/tia-lsp/src/main.lua.
2026-07-18 16:58:13 +02:00
2 changed files with 32 additions and 2 deletions
+24
View File
@@ -0,0 +1,24 @@
# tia-mason-registry
A custom [mason.nvim](https://github.com/mason-org/mason.nvim) registry that defines how to build and install the [`tia-lsp`](https://gitea.l-tech.rs/lazar/tia-lsp) language server for Siemens TIA Portal languages (SCL, with STL/AWL/LAD/FBD planned).
This repository is not meant to be used directly or installed as a standalone plugin. It contains a single package recipe (`packages/tia-lsp/package.yaml`) that mason reads to know how to download `tia-lsp`, compile its tree-sitter parser, and place the `tia-lsp` executable on PATH.
## Usage
See the [`tia-lsp.nvim` README](https://gitea.l-tech.rs/lazar/tia-lsp.nvim) for complete step-by-step installation instructions.
## How it works
1. Mason clones this registry to access `packages/tia-lsp/package.yaml`
2. The recipe clones the [`tia-lsp`](https://gitea.l-tech.rs/lazar/tia-lsp) source repository
3. It compiles `src/parser.c` into `parser.so` (the tree-sitter parser)
4. It creates a `bin/tia-lsp` shell script that runs `lua src/main.lua`
5. Mason places `tia-lsp` (and `parser.so`) in its managed package directory
## Requirements
- [mason.nvim](https://github.com/mason-org/mason.nvim) 2.x
- [yq](https://github.com/mikefarah/yq) — required by mason to parse YAML registries (install via `:MasonInstall yq`)
- C compiler (`cc`) — required to build `parser.so`
- Lua 5.1+ — runtime for the LSP server
+8 -2
View File
@@ -10,7 +10,7 @@ categories:
- LSP
source:
id: pkg:generic/tia-lsp@0.1.0
id: pkg:generic/tia-lsp@0.1.7
build:
env:
VERSION: "{{version}}"
@@ -18,8 +18,14 @@ source:
git clone --depth 1 --branch "v$VERSION" https://gitea.l-tech.rs/lazar/tia-lsp.git tia-lsp-src
cp -r tia-lsp-src/src ./src
mkdir -p bin
printf '#!/bin/bash\nexec lua "$(dirname "$0")/../src/main.lua" "$@"\n' > bin/tia-lsp
cc -fPIC -I src/tree_sitter -c src/parser.c -o parser.o
cc -shared parser.o -o parser.so
rm -f parser.o
printf '#!/bin/bash\nexec lua "$(dirname "$(readlink -f "$0")")/../src/main.lua" "$@"\n' > bin/tia-lsp
chmod +x bin/tia-lsp
bin:
tia-lsp: bin/tia-lsp
share:
parser.so: parser.so