Browse by type
tower-lsp[!note] This repo use a language which is a very small subset of
rustcallednano rust
fn factorial(x) {
// Conditionals are supported!
if x == 0 {
1
} else {
x * factorial(x - 1)
}
}
// The main function
fn main() {
let three = 3;
let meaning_of_life = three * 14 + 1;
print("Hello, world!");
print("The meaning of life is...");
if meaning_of_life == 42 {
print(meaning_of_life);
} else {
print("...something we cannot know");
print("However, I can tell you that the factorial of 10 is...");
// Function calling
print(factorial(10));
}
}
This repo is a template for tower-lsp, a useful github project template which makes writing new language servers easier.
pnpm icargo buildcode .examples/test.nrs from this project.[!note] If encountered errors like
Cannot find module '/xxx/xxx/dist/extension.js'please try run commandtsc -bmanually, you could refer https://github.com/IWANABETHATGUY/tower-lsp-boilerplate/issues/6 for more details
VsCodenrs-language-server is under your PATHpnpm run packagecode --install-extension nrs-language-server-${version}.vsix, the version you could inspect in file system.VsCode, and write a minimal nano rust file, then inspect the effect.For other editor, please refer the related manual, you could skip steps above.
This repo use a language nano rust which first introduced by chumsky . Most common language feature has been implemented, you could preview via the video below.
[x] InlayHint for LiteralType

[x] semantic token
make sure your semantic token is enabled, you could enable your semantic token by
adding this line to your settings.json
{
"editor.semanticHighlighting.enabled": true,
}
https://user-images.githubusercontent.com/17974631/156926382-a1c4c911-7ea1-4d3a-8e08-3cf7271da170.mp4
https://user-images.githubusercontent.com/17974631/156926355-010ef2cd-1d04-435b-bd1e-8b0dab9f44f1.mp4
https://user-images.githubusercontent.com/17974631/156926103-94d90bd3-f31c-44e7-a2ce-4ddfde89bc33.mp4
https://user-images.githubusercontent.com/17974631/157367235-7091a36c-631a-4347-9c1e-a3b78db81714.mp4
https://user-images.githubusercontent.com/17974631/157367229-99903896-5583-4f67-a6da-1ae1cf206876.mp4
$ claude mcp add tower-lsp-boilerplate \
-- python -m otcore.mcp_server <graph>