https://github.com/rydesun/fennel-language-server
Fennel language server protocol (LSP) support.
https://github.com/rydesun/fennel-language-server
fennel language-server lsp-server neovim parser
Last synced: 10 months ago
JSON representation
Fennel language server protocol (LSP) support.
- Host: GitHub
- URL: https://github.com/rydesun/fennel-language-server
- Owner: rydesun
- License: mit
- Created: 2022-09-16T13:03:11.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-08-28T08:22:03.000Z (almost 3 years ago)
- Last Synced: 2025-04-12T16:13:20.903Z (about 1 year ago)
- Topics: fennel, language-server, lsp-server, neovim, parser
- Language: Rust
- Homepage:
- Size: 108 KB
- Stars: 121
- Watchers: 7
- Forks: 9
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# fennel-language-server
[](https://github.com/rydesun/fennel-language-server/actions/workflows/test.yaml)
[](https://github.com/rydesun/fennel-language-server/blob/master/LICENSE)
Fennel language server protocol (LSP) support.
`fennel-language-server` is currently in a very early stage and unreliable.
Use it just for an encouraging try.
## Installation
Because it is written in pure Rust language,
the server should be installed via `cargo`.
```sh
cargo install --git https://github.com/rydesun/fennel-language-server
```
No demand for the Fennel environment. You don't even need Fennel runtime!
(It sounds a little weird but that's the truth)
## Integration
**NOTE**: The executable file is now named `fennel-language-server`.
The former name `fennel-ls` has been abandoned.
### Neovim
For Nvim user to setup `fennel-language-server` with `nvim-lspconfig`,
add the following code to your configuration.
```lua
local lspconfig = require 'lspconfig'
require 'lspconfig.configs'.fennel_language_server = {
default_config = {
-- replace it with true path
cmd = {'/PATH/TO/BINFILE'},
filetypes = {'fennel'},
single_file_support = true,
-- source code resides in directory `fnl/`
root_dir = lspconfig.util.root_pattern("fnl"),
settings = {
fennel = {
workspace = {
-- If you are using hotpot.nvim or aniseed,
-- make the server aware of neovim runtime files.
library = vim.api.nvim_list_runtime_paths(),
},
diagnostics = {
globals = {'vim'},
},
},
},
},
}
lspconfig.fennel_language_server.setup{}
```
## Status
There is a long way to go.
Features are partially completed:
- [x] `Diagnostics`: Be careful these are not fully provided!
- [x] `Goto Definition`
- [x] `Code Completion`
- [x] `References`
- [x] `Hover`
- [x] `Rename`
- [ ] `Formatter`
**All features don't work properly on multi-symbols.**
It means that you cannot hover on the part after the dot, for example.
The following are also known issues:
- Macro grammar support is very limited.
You may suffer from wrong diagnostics.
- Type checking is very weak.
- Lack of cross-file operation.
Such as `require-macros` still does not analyzed.
You should use `import-macros` for a clear namespace.
## Also See
XeroOl `fennel-ls` written in pure fennel you may love
[https://git.sr.ht/~xerool/fennel-ls](https://git.sr.ht/~xerool/fennel-ls)