Skip to content

feat: add Nim language server support#1186

Closed
LikiosSedo wants to merge 2 commits intooraios:mainfrom
LikiosSedo:feat/nim-language-support
Closed

feat: add Nim language server support#1186
LikiosSedo wants to merge 2 commits intooraios:mainfrom
LikiosSedo:feat/nim-language-support

Conversation

@LikiosSedo
Copy link
Copy Markdown

Summary

  • Add Nim language support via nimlangserver (v1.12.0)
  • Automatic binary download for 5 platforms: Linux x64/arm64, macOS x64/arm64, Windows x64
  • Follows the same RuntimeDependencyCollection pattern as Dart and other language servers

Changes

  • src/solidlsp/language_servers/nim_language_server.py — Language server implementation with platform-aware binary management, Nim-specific directory exclusions (nimcache, nimblecache, htmldocs, nimbledeps)
  • src/solidlsp/ls_config.py — Register NIM in Language enum, add .nim/.nims file matchers, add factory method
  • pyproject.toml — Add nim pytest marker
  • test/resources/repos/nim/test_repo/ — Minimal Nim project with cross-module imports (calculator, utils, main, tests)
  • test/solidlsp/nim/test_nim_basic.py — 8 tests covering document symbols, cross-file references, hover, and full symbol tree

Prerequisites

nimlangserver requires the Nim compiler (nim / nimsuggest) to be installed on the system. The language server binary itself is downloaded automatically.

Testing

  • uv run poe format — passes
  • uv run poe type-check — passes (mypy, 0 errors)
  • Tests require Nim to be installed: uv run poe test -m nim

Verification

Archive structure verified — both .tar.gz (Linux) and .zip (macOS/Windows) releases contain the nimlangserver binary at the archive root (no nested directories).

Closes #645

Add support for the Nim programming language via nimlangserver
(https://github.com/nim-lang/langserver).

- Add NimLanguageServer with RuntimeDependencyCollection for automatic
  binary download across 5 platforms (linux-x64/arm64, macos-x64/arm64,
  windows-x64)
- Register NIM in Language enum with .nim/.nims file matchers
- Add test repository with cross-module Nim code (calculator, utils, main)
- Add test suite covering symbol finding, cross-file references, hover,
  and full symbol tree
- Add nim pytest marker

Note: nimlangserver requires the Nim compiler (nim/nimsuggest) to be
installed on the system for full functionality.

Closes oraios#645
The RuntimeDependencyCollection uses shutil.unpack_archive which
expects "gztar" format identifier, not "tar.gz".
@MischaPanch
Copy link
Copy Markdown
Contributor

@LikiosSedo thanks for the contribution.

There is a long-stanging open PR for adding nim in which a lot of conversation happened. Pls have a look in #645 and consider closing this and commenting there. We are waiting for the resolution of the last minor issues before that one can be merged. If you are interested in that, you could ping the PRs author and potentially finalize it if they don't have the time now

@LikiosSedo
Copy link
Copy Markdown
Author

Thanks for the heads-up @MischaPanch — I wasn't aware of #658. Closing this in favor of that PR. I'll take a look and see if I can help with the remaining issues.

@LikiosSedo LikiosSedo closed this Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for Nim language

2 participants