Get insight with NimSight
Nim language server based around nim check
I first started programming Nim using micro which just had a linter for Nim which I found helpful enough so I wanted that same experiences in my other editors. Doesn't support auto-complete and likely never will unless the --suggest option starts working
Tested with Kate and helix, semi tested with NeoVim (I run the test suite with it, but personally dont use it)
This is the list of features that are supported/will eventually be supported
- Show errors/warnings
- Show outline of document
- Basic fixes for some errors
- Nimble and nimscript files
- Go-to symbol definition (The code is there, but it basically never works)
- Find usages
- Rename symbol
- Code lens (Nimble tasks, run tests)
Installation is supported via nimble install nimsight or via the flake github:ire4ever1190/nimsight
Add this into the list of LSP servers
{
"nim": {
"command": ["nimsight"],
"path": ["%{ENV:HOME}/.nimble/bin", "%{ENV:USERPROFILE}/.nimble/bin"],
"rootIndicationFilePatterns": ["*.nimble", "config.nims"],
"url": "https://github.com/ire4ever1190/nimsight",
"highlightingModeRegex": "Nim",
"initializationOptions": {
"nimBinary": "/path/to/nim"
}
}
}Add this into your languages.toml file
[[language]]
language-servers = ["nimsight"]
name = "nim"
[language-server.nimsight]
args = []
command = "nimsight"
[language-server.nimsight.config.nimBinary]
path = "/path/to/nim"The following configuration options can be passed via initializationOptions:
nimBinary: Path to the Nim binary to use (defaults tonimornim.exe)nimbleBinary: Path to the Nimble binary to use (defaults tonimbleornimble.exe)
Code is broken into two main sections
src/nimsight.nim: Main entry point, registers all the handlerssrc/nimsight/: Contains code for Nim related stuffsrc/nimsight/sdk: Contains an SDK for interacting with language servers. Can be used outside of this