Installing GCSL Parsers
You can load the native parser directly in Neovim without a parser-manager plugin. This procedure configures syntax highlighting and folds. It does not configure the language server or install an indentation plugin.
Before you start #
You need the following:
- Neovim 0.11 with support for Tree-sitter language ABI 15.
- The grammar's
gcsl.sonative build for your host. - The four files in the grammar repository's
queries/directory.
The example uses a Linux development build. From the grammar repository, build the native parser with pekit:
parser=
The command keeps the built parser's path, which pekit prints indented
under the target name, in parser.
Install the parser and queries #
-
Create the runtime directories under your Neovim configuration:
config="/nvim" -
Copy the parser and queries into those directories:
-
Add the file type and highlighting setup to
init.lua:vim.. vim..
Check the result #
Open a .gcsl file containing a function and a string interpolation. Run
:InspectTree to view the syntax tree. It should contain named_function
and interpolation nodes for those constructs.
Run :Inspect over a function name to see its highlight capture. Use za
on a multiline block to toggle its fold. A parser-load error usually means
the shared object was built for a different host or the editor does not
support its language ABI.
Indentation and text objects #
The indentation and text-object queries require an editor integration that understands their capture names and predicates. Merely copying the files does not enable those features. Configure your chosen integration using its version's instructions; plugin APIs can differ between branches.