fennel-ls-y
Visual Studio Code extension
Fennel language server integration
A fork of adjuvant/vscode-fennel-ls,
published as LTH.fennel-ls-y. Settings keys are unchanged (fennel-lsx.*), so
uninstall the upstream extension before installing this one to avoid two servers running.
Connects Visual Studio Code to a Language Server - nothing more and nothing less.
Status
It should work, but might not. Tread carefully, and report back.
Setup
A compatible Fennel language server is required.
Either set fennel-lsx.server-version to "bundled" to use the bundled version of the fennel-ls language server.
Lua >= 5.1 is still required.
The extension ships the server as a single, pre-compiled fennel-ls.lua, and runs it as lua fennel-ls.lua.
The interpreter is lua from your PATH, unless fennel-lsx.lua-executable says otherwise.
On Windows, set fennel-lsx.lua-executable to the full path of lua.exe if it is not on your PATH.
Or, set it to "external" to use the executable specified with fennel-lsx.executable.
Fennel language support
This extension provides basic Fennel language support,
but does not provide any syntax hightlighting.
Use additional extensions:
e.g. kongeor.vsc-fennel,
or adjuvant.fennel-syntax if you feel adventurous.
Configuration
Since fennel-ls 0.2, the server reads its settings from an flsproject.fnl in the root of your
project, and no longer from the ones the editor sends it.
See the fennel-ls manual
for the available options and their defaults.
An empty {} is a valid configuration, and marks where the project root is.
The fennel-ls.* settings of this extension are therefore inert with the bundled server;
only fennel-ls.trace.server still does something, since the vscode-languageclient library,
not the server, acts on it.
TODO
- Drop the
fennel-ls.* settings the server no longer reads
- Command to restart the language server
- Expand the capabilities of the server
- Maybe Semantic Highlighting?
Development
Start the "Run Extension" task in vscode (F5)
The npm run watch default build task should start automatically in the background.
It compiles the vendored server into out/fennel-ls.lua once before starting tsc -watch,
so a lua interpreter is needed to build the extension, not just to run it.
Use npm run compile:server to rebuild that file on its own.
It runs lua from your PATH; set the LUA environment variable to use a different interpreter.
Installation
git submodule update --init
npm install --ignore-scripts
npx vsce package
codium --install-extension fennel-ls-0.6.0.vsix
How to update bundled fennel-ls
fennel-ls is vendored as a git submodule in vendor/fennel-ls.
Clone with --recurse-submodules, or run git submodule update --init in an existing checkout.
git -C vendor/fennel-ls fetch --tags && git -C vendor/fennel-ls checkout <tag>
- Commit the new submodule revision
- Increase version (and then npm i)
- Add a changelog entry
Prefer a tag, but a plain commit is fine when a fix you need is not in a release yet.
It currently points a few commits past 0.2.4, for the uri->path fix without which the server
cannot open a single file on Windows.
The submodule is only needed to build the extension.
npm run compile:server compiles it into a self-contained out/fennel-ls.lua
(and copies its fennel-ls.LICENSE alongside), which is what gets packaged.
Everything built lands in out/, which is gitignored and removed by npm run clean.
Notes
The configuration <language-server-id>.trace.server is used by the vscode-languageclient library to set its trace level.
License
MIT License