Skip to content

feat: Add Nim language server support via nimlangserver#1150

Open
zerone0x wants to merge 1 commit intooraios:mainfrom
zerone0x:feature/nim-language-support
Open

feat: Add Nim language server support via nimlangserver#1150
zerone0x wants to merge 1 commit intooraios:mainfrom
zerone0x:feature/nim-language-support

Conversation

@zerone0x
Copy link
Contributor

Summary

Adds support for the Nim programming language using nimlangserver, resolving #645.

Changes

  • New language server: src/solidlsp/language_servers/nim_language_server.py
    • NimLanguageServer class using nimlangserver executable
    • Supports stdio communication
    • Checks for nimlangserver availability with a helpful error message on failure
  • Language registration: Added Language.NIM = "nim" to the enum in ls_config.py with .nim and .nims file matchers and factory integration
  • Test repository: test/resources/repos/nim/test_repo/
    • src/calculator.nim: Arithmetic procedures (add, subtract, multiply, divide, factorial, power)
    • src/utils.nim: String utilities (trim, startsWith, endsWith, split, join)
    • main.nim: Entry point referencing both modules
    • test_repo.nimble: Project file
  • Tests: test/solidlsp/nim/test_nim_basic.py
    • Symbol discovery in calculator.nim, utils.nim, and main.nim
    • Cross-file reference tests for calculator.add and utils.trim
    • Tests are skipped when nimlangserver is not installed
  • Documentation: Updated README.md, docs/01-about/020_programming-languages.md, and CHANGELOG.md

Installation

Nim can be installed from https://nim-lang.org/install.html

Testing

Tests are skipped automatically when nimlangserver is not installed:

Adds support for Nim programming language using nimlangserver
(https://github.com/nim-lang/langserver).

- Add NimLanguageServer class in src/solidlsp/language_servers/nim_language_server.py
- Register Language.NIM enum value with .nim and .nims file matchers
- Add NIM to the language server factory
- Create test repository with calculator and utils modules
- Add basic integration tests for symbol finding and cross-file references
- Update README.md, docs, CHANGELOG.md

Resolves oraios#645

Co-Authored-By: Claude <noreply@anthropic.com>
@MischaPanch
Copy link
Contributor

Hi @zerone0x . We have a long-standing open PR for nim support that has gone through multiple review rounds #658 . It's actually fairly close to being merged, though it had to resort to a lot of hacks. Could you maybe have a look at it, check the differences to yours, maybe review/comment there?

@zerone0x
Copy link
Contributor Author

Hi @zerone0x . We have a long-standing open PR for nim support that has gone through multiple review rounds #658 . It's actually fairly close to being merged, though it had to resort to a lot of hacks. Could you maybe have a look at it, check the differences to yours, maybe review/comment there?

Sure, thanks for reminding.

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.

2 participants