Skip to content

584973/lang-zoo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lang-zoo

A polyglot sandbox for testing editor LSP integrations and test runner plugins. Each language directory contains a main source file designed to exercise LSP features (hover, go-to-definition, completions, diagnostics) and a matching test file you can run through your editor's test runner.

Languages

Language LSP server Test framework Run tests
C clangd assert.h (hand-rolled) cc -o test_main test_main.c && ./test_main
C++ clangd assert (hand-rolled) c++ -std=c++23 -o test_main test_main.cpp && ./test_main
Go gopls testing (stdlib) go test ./...
Java jdtls JUnit 5 via Maven / Gradle
Kotlin kotlin-language-server kotlin.test via Gradle
Lua lua-language-server busted busted (from lua/)
Python pyright / pylsp pytest pytest
Ruby ruby-lsp RSpec rspec
Rust rust-analyzer built-in (#[test]) cargo test
TypeScript typescript-language-server Vitest npm i && npm test (from web/)
JavaScript typescript-language-server Vitest same as above
Zig zls std.testing zig test main.zig

Structure

lang-zoo/
├── c/
│   ├── main.c           # LSP test file
│   └── test_main.c      # tests
├── cpp/
│   ├── main.cpp
│   ├── test_main.cpp
│   └── compile_commands.json
├── go/
│   ├── main.go
│   ├── main_test.go
│   └── go.mod
├── java/
│   ├── Main.java
│   └── MainTest.java
├── kotlin/
│   ├── main.kt
│   └── MainTest.kt
├── lua/
│   ├── main.lua
│   ├── .luarc.json
│   └── spec/
│       └── main_spec.lua
├── python/
│   ├── main.py
│   └── test_main.py
├── ruby/
│   ├── main.rb
│   └── spec/
│       └── main_spec.rb
├── rust/
│   ├── Cargo.toml
│   └── src/
│       └── main.rs
├── web/
│   ├── main.js
│   ├── main.ts
│   ├── main.test.js
│   ├── main.test.ts
│   ├── package.json     # Vitest
│   └── tsconfig.json
└── zig/
    └── main.zig

LSP features covered

Each main file is written to exercise:

  • Hover — types, doc comments, signatures
  • Go-to-definition — structs, interfaces, functions
  • Completions — method chains, stdlib APIs
  • Diagnostics — intentional unused-variable comments to toggle warnings
  • Parameter hints — functions with multiple arguments

Dependencies

Install the test frameworks you want to use:

# Python
pip install pytest

# Ruby
gem install rspec

# Lua
luarocks install busted

# JavaScript / TypeScript
cd web && npm install

Java and Kotlin tests require JUnit 5 on the classpath — use Maven or Gradle to manage dependencies.

About

Sandbox for testing lsp

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors