lithermes-ai 0.8.2 → 0.8.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/README_Ko-KR.md +1 -1
- package/assets/lithermes-plugin/README.md +4 -4
- package/assets/lithermes-plugin/__init__.py +12 -0
- package/assets/lithermes-plugin/payload-version.json +150 -6
- package/assets/lithermes-plugin/plugin.yaml +1 -1
- package/assets/lithermes-plugin/skills/debugging/SKILL.md +42 -0
- package/assets/lithermes-plugin/skills/litresearch/SKILL.md +241 -0
- package/assets/lithermes-plugin/skills/lsp-setup/SKILL.md +153 -0
- package/assets/lithermes-plugin/skills/lsp-setup/references/bash/README.md +68 -0
- package/assets/lithermes-plugin/skills/lsp-setup/references/c-cpp/README.md +78 -0
- package/assets/lithermes-plugin/skills/lsp-setup/references/csharp/README.md +90 -0
- package/assets/lithermes-plugin/skills/lsp-setup/references/dart/README.md +59 -0
- package/assets/lithermes-plugin/skills/lsp-setup/references/elixir/README.md +61 -0
- package/assets/lithermes-plugin/skills/lsp-setup/references/go/README.md +63 -0
- package/assets/lithermes-plugin/skills/lsp-setup/references/haskell/README.md +69 -0
- package/assets/lithermes-plugin/skills/lsp-setup/references/java/README.md +70 -0
- package/assets/lithermes-plugin/skills/lsp-setup/references/julia/README.md +70 -0
- package/assets/lithermes-plugin/skills/lsp-setup/references/kotlin/README.md +72 -0
- package/assets/lithermes-plugin/skills/lsp-setup/references/lua/README.md +68 -0
- package/assets/lithermes-plugin/skills/lsp-setup/references/php/README.md +61 -0
- package/assets/lithermes-plugin/skills/lsp-setup/references/python/README.md +73 -0
- package/assets/lithermes-plugin/skills/lsp-setup/references/ruby/README.md +67 -0
- package/assets/lithermes-plugin/skills/lsp-setup/references/rust/README.md +65 -0
- package/assets/lithermes-plugin/skills/lsp-setup/references/swift/README.md +64 -0
- package/assets/lithermes-plugin/skills/lsp-setup/references/terraform/README.md +66 -0
- package/assets/lithermes-plugin/skills/lsp-setup/references/typescript/README.md +82 -0
- package/assets/lithermes-plugin/skills/lsp-setup/references/yaml/README.md +65 -0
- package/assets/lithermes-plugin/skills/lsp-setup/references/zig/README.md +59 -0
- package/assets/lithermes-plugin/skills/lsp-setup/scripts/detect-lsp.ts +221 -0
- package/assets/lithermes-plugin/skills/lsp-setup/scripts/lsp-server-table.ts +146 -0
- package/assets/lithermes-plugin/skills/lsp-setup/scripts/tsconfig.json +18 -0
- package/assets/lithermes-plugin/skills/lsp-setup/scripts/verify-lsp.ts +252 -0
- package/assets/lithermes-plugin/skills/visual-qa/SKILL.md +282 -0
- package/assets/lithermes-plugin/skills/visual-qa/scripts/ansi.ts +17 -0
- package/assets/lithermes-plugin/skills/visual-qa/scripts/cli.ts +96 -0
- package/assets/lithermes-plugin/skills/visual-qa/scripts/east-asian-width.ts +72 -0
- package/assets/lithermes-plugin/skills/visual-qa/scripts/image-diff.ts +109 -0
- package/assets/lithermes-plugin/skills/visual-qa/scripts/png-crc.ts +27 -0
- package/assets/lithermes-plugin/skills/visual-qa/scripts/png-decode.ts +206 -0
- package/assets/lithermes-plugin/skills/visual-qa/scripts/png-synth.ts +57 -0
- package/assets/lithermes-plugin/skills/visual-qa/scripts/tui-grid.ts +88 -0
- package/assets/lithermes-plugin/skills/visual-qa/scripts/types.ts +54 -0
- package/package.json +3 -2
- package/src/lib/install.js +1 -1
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: lsp-setup
|
|
3
|
+
description: "Configure a Language Server (LSP) for a specific language so Hermes tooling — diagnostics, go-to-definition, find-references, rename — works in LitHermes. Use when you need to set up or install a language server, fix 'no LSP server configured' / 'server not installed', choose between servers (basedpyright vs pyright vs ruff), or add a language to the Hermes LSP config. Routes by file extension to references/<language>/README.md for the server choice, per-OS install commands, the LSP config snippet, and troubleshooting. Ships scripts: detect-lsp.ts (scan a project for languages + report each server's install/config status against the Hermes LSP config) and verify-lsp.ts (real diagnostics roundtrip). Covers typescript, python, go, rust, c/c++, java, kotlin, c#/razor, swift, ruby, php, dart, elixir, zig, lua, bash, yaml, terraform, haskell, julia."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# LSP Setup
|
|
7
|
+
|
|
8
|
+
Configure the right Language Server for a project so Hermes's `lsp` tools
|
|
9
|
+
(`lsp.diagnostics`, `lsp.goto_definition`, `lsp.find_references`, `lsp.symbols`,
|
|
10
|
+
`lsp.rename`) actually work in LitHermes. This skill is an index: detect what a
|
|
11
|
+
project needs, install the server, declare it in the Hermes LSP config, then
|
|
12
|
+
verify with a real diagnostics roundtrip.
|
|
13
|
+
|
|
14
|
+
This is the multi-language configurator. For a quick post-edit diagnostics pass
|
|
15
|
+
on an already-configured language, use the lighter `lsp` skill instead — `lsp` is
|
|
16
|
+
the quick path, `lsp-setup` is the configurator that wires new languages in.
|
|
17
|
+
|
|
18
|
+
The recommended server per language is the source of truth in
|
|
19
|
+
`scripts/lsp-server-table.ts`; each `references/<language>/README.md` mirrors it.
|
|
20
|
+
|
|
21
|
+
## Runtime
|
|
22
|
+
|
|
23
|
+
The scripts are dependency-free TypeScript. Run them with either:
|
|
24
|
+
|
|
25
|
+
- **Node 22.6+:** `node --experimental-strip-types scripts/detect-lsp.ts <dir>`
|
|
26
|
+
- **Bun:** `bun scripts/detect-lsp.ts <dir>`
|
|
27
|
+
|
|
28
|
+
No `npm install` is required; the scripts import only Node built-ins and the
|
|
29
|
+
embedded `lsp-server-table.ts`.
|
|
30
|
+
|
|
31
|
+
## Phase 0 — Language Gate (run first)
|
|
32
|
+
|
|
33
|
+
Identify the language from the file extension, then read the matching reference
|
|
34
|
+
before installing or configuring anything.
|
|
35
|
+
|
|
36
|
+
| Extension(s) | Reference |
|
|
37
|
+
|---|---|
|
|
38
|
+
| `.ts .tsx .js .jsx .mjs .cjs .mts .cts` | `references/typescript/README.md` |
|
|
39
|
+
| `.py .pyi` | `references/python/README.md` |
|
|
40
|
+
| `.go` | `references/go/README.md` |
|
|
41
|
+
| `.rs` | `references/rust/README.md` |
|
|
42
|
+
| `.c .cpp .cc .cxx .h .hpp .hh .hxx` | `references/c-cpp/README.md` |
|
|
43
|
+
| `.java` | `references/java/README.md` |
|
|
44
|
+
| `.kt .kts` | `references/kotlin/README.md` |
|
|
45
|
+
| `.cs .razor .cshtml` | `references/csharp/README.md` |
|
|
46
|
+
| `.swift` | `references/swift/README.md` |
|
|
47
|
+
| `.rb .rake .gemspec .ru` | `references/ruby/README.md` |
|
|
48
|
+
| `.php` | `references/php/README.md` |
|
|
49
|
+
| `.dart` | `references/dart/README.md` |
|
|
50
|
+
| `.ex .exs` | `references/elixir/README.md` |
|
|
51
|
+
| `.zig .zon` | `references/zig/README.md` |
|
|
52
|
+
| `.lua` | `references/lua/README.md` |
|
|
53
|
+
| `.sh .bash .zsh .ksh` | `references/bash/README.md` |
|
|
54
|
+
| `.yaml .yml` | `references/yaml/README.md` |
|
|
55
|
+
| `.tf .tfvars` | `references/terraform/README.md` |
|
|
56
|
+
| `.hs .lhs` | `references/haskell/README.md` |
|
|
57
|
+
| `.jl` | `references/julia/README.md` |
|
|
58
|
+
|
|
59
|
+
## Workflow — detect, install, configure, verify
|
|
60
|
+
|
|
61
|
+
### 1. Detect
|
|
62
|
+
|
|
63
|
+
Scan the project to see which languages are present and whether each server is
|
|
64
|
+
installed and already declared in the Hermes LSP config:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
node --experimental-strip-types scripts/detect-lsp.ts <projectDir>
|
|
68
|
+
node --experimental-strip-types scripts/detect-lsp.ts <projectDir> --json
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
For each detected language it prints the recommended server, the executable it
|
|
72
|
+
needs on `PATH`, whether that executable is installed, an install hint, and
|
|
73
|
+
whether the Hermes LSP config already declares the language. Use
|
|
74
|
+
`--config=<path>` to point at a different config copy.
|
|
75
|
+
|
|
76
|
+
### 2. Install
|
|
77
|
+
|
|
78
|
+
Open `references/<language>/README.md` and run the install command for your OS,
|
|
79
|
+
then confirm the executable resolves:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
command -v <server-executable> # e.g. typescript-language-server, gopls, rust-analyzer
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### 3. Configure (Hermes LSP config)
|
|
86
|
+
|
|
87
|
+
Hermes declares servers under the top-level `lsp` key (the project copy lives at
|
|
88
|
+
`.lithermes/lsp.json`). The map is keyed by **language name**; each entry holds a
|
|
89
|
+
`command` array and an `extensions` list that tells Hermes which file extensions
|
|
90
|
+
route to that server:
|
|
91
|
+
|
|
92
|
+
```json
|
|
93
|
+
{
|
|
94
|
+
"lsp": {
|
|
95
|
+
"<language>": {
|
|
96
|
+
"command": ["<bin>", "<arg>"],
|
|
97
|
+
"extensions": [".ext"]
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Rules:
|
|
104
|
+
|
|
105
|
+
- One entry per server, keyed by language name. The `command` is the full argv.
|
|
106
|
+
- `extensions` lists each owned extension. Hermes resolves the server for an
|
|
107
|
+
edited file by matching its extension here.
|
|
108
|
+
- The shipped default declares only `typescript`. Add a language by copying the
|
|
109
|
+
block from its reference README into the `lsp` map.
|
|
110
|
+
- Server-specific tuning (schemas, licence keys, check commands) travels through
|
|
111
|
+
the LSP `initializationOptions` or a project config file (for example
|
|
112
|
+
`.clangd`, `.rubocop.yml`, `pyrightconfig.json`), not through the Hermes LSP
|
|
113
|
+
config.
|
|
114
|
+
|
|
115
|
+
If a language also needs a bridge (for example a server exposed through a stdio
|
|
116
|
+
bridge rather than a direct binary), declare that bridge and keep the `command`
|
|
117
|
+
pointed at the resulting executable. Most servers here are direct binaries and
|
|
118
|
+
need only the `lsp` entry.
|
|
119
|
+
|
|
120
|
+
Each language reference gives a ready-to-paste snippet.
|
|
121
|
+
|
|
122
|
+
### 4. Verify
|
|
123
|
+
|
|
124
|
+
Run a real diagnostics roundtrip against a source file. The script resolves the
|
|
125
|
+
server for the file extension (from the Hermes LSP config when present, else the
|
|
126
|
+
embedded table), spawns it, runs the JSON-RPC `initialize` -> `initialized` ->
|
|
127
|
+
`didOpen` handshake over stdio, waits for `textDocument/publishDiagnostics`, and
|
|
128
|
+
reports:
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
node --experimental-strip-types scripts/verify-lsp.ts <path/to/file.ext>
|
|
132
|
+
node --experimental-strip-types scripts/verify-lsp.ts <file> --timeout=90000
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
`OK` = the server started and answered with diagnostics. `FAIL: language server
|
|
136
|
+
not installed` = go back to step 2. Other `FAIL` text carries the server or
|
|
137
|
+
timeout error. `SKIP` = no server is known for that extension; add one via the
|
|
138
|
+
reference and the Hermes LSP config. Exit codes: 0 OK, 1 FAIL, 2 usage, 3 SKIP.
|
|
139
|
+
|
|
140
|
+
## Scripts
|
|
141
|
+
|
|
142
|
+
| Script | Purpose |
|
|
143
|
+
|---|---|
|
|
144
|
+
| `scripts/detect-lsp.ts` | Scan a directory; per detected language report the recommended server, install status, install hint, and whether the Hermes LSP config declares it. `--json` for machine output, `--config=<path>` to target a config. |
|
|
145
|
+
| `scripts/verify-lsp.ts` | Real LSP diagnostics roundtrip for one file over stdio JSON-RPC; `OK`/`FAIL`/`SKIP` + exit code 0/1/2/3. Dependency-free. |
|
|
146
|
+
| `scripts/lsp-server-table.ts` | Embedded snapshot of the recommended server per language, mirrored by the references. |
|
|
147
|
+
|
|
148
|
+
## When LSP tooling is unavailable
|
|
149
|
+
|
|
150
|
+
If Hermes does not expose `lsp` tools and a server is not installed, do not
|
|
151
|
+
fabricate a passing diagnostics result. Fall back to the project's own commands
|
|
152
|
+
(`tsc --noEmit`, `ruff`, `cargo check`, `go test`, etc.), label the LSP gap as a
|
|
153
|
+
controlled skip, and report it — consistent with the `lsp` skill's failure rules.
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Bash — LSP setup (Hermes / LitHermes)
|
|
2
|
+
|
|
3
|
+
- **Recommended server:** `bash-language-server start`
|
|
4
|
+
- **Extensions:** `.sh .bash .zsh .ksh`
|
|
5
|
+
- **Install hint:** `npm install -g bash-language-server`
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
- **macOS:** `npm install -g bash-language-server`
|
|
10
|
+
- **Linux:** `npm install -g bash-language-server`
|
|
11
|
+
- **Windows:** `npm install -g bash-language-server` (PowerShell)
|
|
12
|
+
|
|
13
|
+
For real diagnostics, also install `shellcheck`:
|
|
14
|
+
|
|
15
|
+
- **macOS:** `brew install shellcheck`
|
|
16
|
+
- **Linux:** `apt install shellcheck` (or `dnf install ShellCheck`)
|
|
17
|
+
- **Windows:** `scoop install shellcheck`
|
|
18
|
+
|
|
19
|
+
Confirm it resolves:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
command -v bash-language-server
|
|
23
|
+
command -v shellcheck
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Configure
|
|
27
|
+
|
|
28
|
+
Add a `bash` entry to the Hermes LSP config under `lsp.<language>`:
|
|
29
|
+
|
|
30
|
+
```json
|
|
31
|
+
{
|
|
32
|
+
"lsp": {
|
|
33
|
+
"bash": {
|
|
34
|
+
"command": [
|
|
35
|
+
"bash-language-server",
|
|
36
|
+
"start"
|
|
37
|
+
],
|
|
38
|
+
"extensions": [
|
|
39
|
+
".sh",
|
|
40
|
+
".bash",
|
|
41
|
+
".zsh",
|
|
42
|
+
".ksh"
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Hermes routes these extensions to `bash-language-server` via the `extensions` list.
|
|
50
|
+
`bash-language-server` discovers `shellcheck` on PATH automatically; to point at a
|
|
51
|
+
non-PATH binary, export `SHELLCHECK_PATH` in the launching shell.
|
|
52
|
+
|
|
53
|
+
## Alternatives
|
|
54
|
+
|
|
55
|
+
- `shellcheck` standalone as a linter-only flow (no LSP).
|
|
56
|
+
- `shfmt` for formatting (complements, does not replace, the LSP).
|
|
57
|
+
|
|
58
|
+
## Troubleshooting
|
|
59
|
+
- **PATH:** `bash-language-server` on PATH; reopen shell after `npm -g` install.
|
|
60
|
+
- **No diagnostics:** `shellcheck` missing — diagnostics are powered by it; install and reopen.
|
|
61
|
+
- **Wrong shell dialect:** `.zsh`/`.ksh` are linted as bash; shellcheck may flag shell-specific syntax.
|
|
62
|
+
|
|
63
|
+
## Verify
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
node --experimental-strip-types ../../scripts/verify-lsp.ts path/to/file.sh
|
|
67
|
+
# or: bun ../../scripts/verify-lsp.ts path/to/file.sh
|
|
68
|
+
```
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# C / C++ — LSP setup (Hermes / LitHermes)
|
|
2
|
+
|
|
3
|
+
- **Recommended server:** `clangd --background-index --clang-tidy`
|
|
4
|
+
- **Extensions:** `.c .cpp .cc .cxx .c++ .h .hpp .hh .hxx .h++`
|
|
5
|
+
- **Install hint:** `https://clangd.llvm.org/installation`
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
- **macOS:** `brew install llvm` (clangd ships in the LLVM keg; add its `bin` to PATH)
|
|
10
|
+
- **Linux:** `apt install clangd` (Debian/Ubuntu); use your distro package elsewhere
|
|
11
|
+
- **Windows:** install LLVM from `https://releases.llvm.org` or `winget install LLVM.LLVM`
|
|
12
|
+
|
|
13
|
+
See `https://clangd.llvm.org/installation` for other platforms.
|
|
14
|
+
|
|
15
|
+
Confirm it resolves:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
command -v clangd
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Configure
|
|
22
|
+
|
|
23
|
+
Add a `c-cpp` entry to the Hermes LSP config under `lsp.<language>`:
|
|
24
|
+
|
|
25
|
+
```json
|
|
26
|
+
{
|
|
27
|
+
"lsp": {
|
|
28
|
+
"c-cpp": {
|
|
29
|
+
"command": [
|
|
30
|
+
"clangd",
|
|
31
|
+
"--background-index",
|
|
32
|
+
"--clang-tidy"
|
|
33
|
+
],
|
|
34
|
+
"extensions": [
|
|
35
|
+
".c",
|
|
36
|
+
".h",
|
|
37
|
+
".cpp",
|
|
38
|
+
".cc",
|
|
39
|
+
".cxx",
|
|
40
|
+
".hpp",
|
|
41
|
+
".hh",
|
|
42
|
+
".hxx"
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Hermes routes these extensions to `clangd` via the `extensions` list. clangd reads
|
|
50
|
+
build flags from a project `.clangd` file, not from the Hermes LSP config; the `command`
|
|
51
|
+
above already passes `--background-index --clang-tidy`.
|
|
52
|
+
|
|
53
|
+
## Compile commands
|
|
54
|
+
|
|
55
|
+
clangd needs a `compile_commands.json` at the project root (or in `build/`) for
|
|
56
|
+
accurate diagnostics and cross-file navigation. Generate it with:
|
|
57
|
+
|
|
58
|
+
- **CMake:** `cmake -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON` (symlink/copy `build/compile_commands.json` to the root)
|
|
59
|
+
- **Make / other:** `bear -- make`
|
|
60
|
+
|
|
61
|
+
Without it, clangd falls back to heuristic flags and reports spurious errors.
|
|
62
|
+
|
|
63
|
+
## Alternatives
|
|
64
|
+
|
|
65
|
+
`ccls` exists as a third-party server — set the `command` to `["ccls"]` in the
|
|
66
|
+
`c-cpp` entry if you prefer it.
|
|
67
|
+
|
|
68
|
+
## Troubleshooting
|
|
69
|
+
- **PATH:** `clangd` must be on PATH; reopen shell after install. Homebrew LLVM is keg-only — add `$(brew --prefix llvm)/bin` to PATH.
|
|
70
|
+
- **Spurious "file not found" / unknown flags:** missing or stale `compile_commands.json` — regenerate it after changing the build.
|
|
71
|
+
- **Header-only diagnostics wrong:** ensure the header's translation unit appears in the compile database, or add a `.clangd` `CompileFlags` block.
|
|
72
|
+
|
|
73
|
+
## Verify
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
node --experimental-strip-types ../../scripts/verify-lsp.ts path/to/file.cpp
|
|
77
|
+
# or: bun ../../scripts/verify-lsp.ts path/to/file.cpp
|
|
78
|
+
```
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# C# — LSP setup (Hermes / LitHermes)
|
|
2
|
+
|
|
3
|
+
- **Recommended server:** `csharp-ls`
|
|
4
|
+
- **Extensions:** `.cs`
|
|
5
|
+
- **Install hint:** `dotnet tool install -g csharp-ls`
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
Requires the **.NET SDK**. Install the tool globally:
|
|
10
|
+
|
|
11
|
+
- **macOS:** `dotnet tool install -g csharp-ls`
|
|
12
|
+
- **Linux:** `dotnet tool install -g csharp-ls`
|
|
13
|
+
- **Windows:** `dotnet tool install -g csharp-ls`
|
|
14
|
+
|
|
15
|
+
Global .NET tools land in `~/.dotnet/tools` — ensure that directory is on PATH (Windows: `%USERPROFILE%\.dotnet\tools`).
|
|
16
|
+
|
|
17
|
+
Confirm it resolves:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
command -v csharp-ls
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Configure
|
|
24
|
+
|
|
25
|
+
Add a `csharp` entry to the Hermes LSP config under `lsp.<language>`:
|
|
26
|
+
|
|
27
|
+
```json
|
|
28
|
+
{
|
|
29
|
+
"lsp": {
|
|
30
|
+
"csharp": {
|
|
31
|
+
"command": [
|
|
32
|
+
"csharp-ls"
|
|
33
|
+
],
|
|
34
|
+
"extensions": [
|
|
35
|
+
".cs"
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Hermes routes `.cs` edits to `csharp-ls` via the `extensions` list. `csharp-ls` picks up
|
|
43
|
+
the nearest `.sln` or `.csproj`; keep the solution restorable (`dotnet restore`).
|
|
44
|
+
|
|
45
|
+
## Razor / Blazor
|
|
46
|
+
|
|
47
|
+
Razor and Blazor files use a separate server. Add a second entry:
|
|
48
|
+
|
|
49
|
+
```json
|
|
50
|
+
{
|
|
51
|
+
"lsp": {
|
|
52
|
+
"razor": {
|
|
53
|
+
"command": [
|
|
54
|
+
"roslyn-language-server",
|
|
55
|
+
"--stdio"
|
|
56
|
+
],
|
|
57
|
+
"extensions": [
|
|
58
|
+
".razor",
|
|
59
|
+
".cshtml"
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Install it (requires **v5.8.0+**; see [dotnet/razor](https://github.com/dotnet/razor)):
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
dotnet tool install -g roslyn-language-server --prerelease
|
|
70
|
+
command -v roslyn-language-server
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Alternatives
|
|
74
|
+
|
|
75
|
+
**OmniSharp** — legacy C# language server. Still works but is being superseded by
|
|
76
|
+
the Roslyn-based servers; prefer `csharp-ls` / `roslyn-language-server`.
|
|
77
|
+
|
|
78
|
+
## Troubleshooting
|
|
79
|
+
|
|
80
|
+
- **PATH:** `csharp-ls` / `roslyn-language-server` on PATH (`~/.dotnet/tools`); reopen shell after install.
|
|
81
|
+
- **No .NET SDK:** install the SDK (not just the runtime) before installing the tool.
|
|
82
|
+
- **No symbols:** run `dotnet restore`; an unrestored solution yields empty results.
|
|
83
|
+
- **Razor needs v5.8.0+:** older `roslyn-language-server` builds lack the `--stdio` Razor support — install with `--prerelease`.
|
|
84
|
+
|
|
85
|
+
## Verify
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
node --experimental-strip-types ../../scripts/verify-lsp.ts path/to/File.cs
|
|
89
|
+
# or: bun ../../scripts/verify-lsp.ts path/to/File.cs
|
|
90
|
+
```
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Dart — LSP setup (Hermes / LitHermes)
|
|
2
|
+
|
|
3
|
+
- **Recommended server:** `dart language-server --lsp`
|
|
4
|
+
- **Extensions:** `.dart`
|
|
5
|
+
- **Install hint:** `Included with the Dart/Flutter SDK`
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
The language server ships inside the Dart SDK (and the Flutter SDK, which bundles Dart). There is no separate package to install — just put `dart` (or `flutter`) on PATH.
|
|
10
|
+
|
|
11
|
+
- **macOS:** `brew install dart` (or install Flutter and use its bundled `dart`)
|
|
12
|
+
- **Linux:** install the Dart SDK from your package manager / `https://dart.dev/get-dart`, or install Flutter
|
|
13
|
+
- **Windows:** install the Dart SDK or Flutter SDK and add its `bin` to PATH
|
|
14
|
+
|
|
15
|
+
Confirm it resolves:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
command -v dart
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Configure
|
|
22
|
+
|
|
23
|
+
Add a `dart` entry to the Hermes LSP config under `lsp.<language>`:
|
|
24
|
+
|
|
25
|
+
```json
|
|
26
|
+
{
|
|
27
|
+
"lsp": {
|
|
28
|
+
"dart": {
|
|
29
|
+
"command": [
|
|
30
|
+
"dart",
|
|
31
|
+
"language-server",
|
|
32
|
+
"--lsp"
|
|
33
|
+
],
|
|
34
|
+
"extensions": [
|
|
35
|
+
".dart"
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Hermes routes `.dart` edits to the Dart language server via the `extensions` list. No
|
|
43
|
+
extra configuration is normally required.
|
|
44
|
+
|
|
45
|
+
## Alternatives
|
|
46
|
+
|
|
47
|
+
None.
|
|
48
|
+
|
|
49
|
+
## Troubleshooting
|
|
50
|
+
- **PATH:** `dart` must be on PATH; reopen the shell after installing the SDK. Flutter users: ensure `<flutter>/bin/cache/dart-sdk/bin` or the Flutter `bin` is exported.
|
|
51
|
+
- **Flutter vs Dart:** if you only have Flutter installed, the bundled `dart` works — make sure Flutter's `bin` is on PATH rather than relying on a separate Dart install.
|
|
52
|
+
- **SDK out of date:** run `dart --version` / `flutter upgrade` if analysis behaves oddly on newer language features.
|
|
53
|
+
|
|
54
|
+
## Verify
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
node --experimental-strip-types ../../scripts/verify-lsp.ts path/to/file.dart
|
|
58
|
+
# or: bun ../../scripts/verify-lsp.ts path/to/file.dart
|
|
59
|
+
```
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Elixir — LSP setup (Hermes / LitHermes)
|
|
2
|
+
|
|
3
|
+
- **Recommended server:** `elixir-ls`
|
|
4
|
+
- **Extensions:** `.ex .exs`
|
|
5
|
+
- **Install hint:** `https://github.com/elixir-lsp/elixir-ls`
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
ElixirLS needs Erlang/OTP and Elixir installed first. Build the release from
|
|
10
|
+
`https://github.com/elixir-lsp/elixir-ls` and put the `elixir-ls` launcher script on PATH.
|
|
11
|
+
|
|
12
|
+
- **macOS:** `brew install elixir-ls` (Homebrew provides the launcher), or build the release manually
|
|
13
|
+
- **Linux:** clone elixir-ls, run `mix deps.get && mix compile && mix elixir_ls.release2 -o release`, then add `release/` to PATH
|
|
14
|
+
- **Windows:** build the release and add the `release` dir (use the `.bat` launcher) to PATH
|
|
15
|
+
|
|
16
|
+
Confirm it resolves:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
command -v elixir-ls
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Configure
|
|
23
|
+
|
|
24
|
+
Add an `elixir` entry to the Hermes LSP config under `lsp.<language>`:
|
|
25
|
+
|
|
26
|
+
```json
|
|
27
|
+
{
|
|
28
|
+
"lsp": {
|
|
29
|
+
"elixir": {
|
|
30
|
+
"command": [
|
|
31
|
+
"elixir-ls"
|
|
32
|
+
],
|
|
33
|
+
"extensions": [
|
|
34
|
+
".ex",
|
|
35
|
+
".exs"
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Hermes routes `.ex`/`.exs` edits to `elixir-ls` via the `extensions` list. No extra
|
|
43
|
+
configuration is normally required.
|
|
44
|
+
|
|
45
|
+
## Alternatives
|
|
46
|
+
|
|
47
|
+
- **lexical**: set the `command` to `["lexical"]` — fast, modern alternative LSP.
|
|
48
|
+
- **next-ls**: set the `command` to `["nextls", "--stdio"]` — from the elixir-tools project.
|
|
49
|
+
|
|
50
|
+
## Troubleshooting
|
|
51
|
+
- **PATH:** `elixir-ls` must be on PATH; reopen the shell after install.
|
|
52
|
+
- **asdf users:** the launcher is a shim — after `asdf install`, run `asdf reshim elixir` so the `elixir-ls` shim resolves, and ensure the Erlang/Elixir versions match the build.
|
|
53
|
+
- **First start is slow:** ElixirLS compiles your deps on first run; initial diagnostics can take a while on large projects.
|
|
54
|
+
- **OTP mismatch:** build elixir-ls with the same Erlang/Elixir versions you use for the project to avoid bytecode errors.
|
|
55
|
+
|
|
56
|
+
## Verify
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
node --experimental-strip-types ../../scripts/verify-lsp.ts path/to/file.ex
|
|
60
|
+
# or: bun ../../scripts/verify-lsp.ts path/to/file.ex
|
|
61
|
+
```
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Go — LSP setup (Hermes / LitHermes)
|
|
2
|
+
|
|
3
|
+
- **Recommended server:** `gopls`
|
|
4
|
+
- **Extensions:** `.go`
|
|
5
|
+
- **Install hint:** `go install golang.org/x/tools/gopls@latest`
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
- **macOS:** `go install golang.org/x/tools/gopls@latest` (or `brew install gopls`)
|
|
10
|
+
- **Linux:** `go install golang.org/x/tools/gopls@latest`
|
|
11
|
+
- **Windows:** `go install golang.org/x/tools/gopls@latest`
|
|
12
|
+
|
|
13
|
+
Requires the Go toolchain. `go install` drops the binary in `$GOPATH/bin`
|
|
14
|
+
(default `~/go/bin`) — that directory must be on PATH.
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
export PATH="$PATH:$(go env GOPATH)/bin"
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Confirm it resolves:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
command -v gopls
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Configure
|
|
27
|
+
|
|
28
|
+
Add a `go` entry to the Hermes LSP config under `lsp.<language>`:
|
|
29
|
+
|
|
30
|
+
```json
|
|
31
|
+
{
|
|
32
|
+
"lsp": {
|
|
33
|
+
"go": {
|
|
34
|
+
"command": [
|
|
35
|
+
"gopls"
|
|
36
|
+
],
|
|
37
|
+
"extensions": [
|
|
38
|
+
".go"
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Hermes routes `.go` edits to `gopls` via the `extensions` list. Analyses such as
|
|
46
|
+
`staticcheck` are configured in `gopls` settings (e.g. a workspace `settings.json`
|
|
47
|
+
consumed by your editor) rather than in the Hermes LSP config.
|
|
48
|
+
|
|
49
|
+
## Alternatives
|
|
50
|
+
|
|
51
|
+
None — `gopls` is the official and de facto sole Go language server.
|
|
52
|
+
|
|
53
|
+
## Troubleshooting
|
|
54
|
+
- **PATH:** `gopls` must be on PATH; ensure `$(go env GOPATH)/bin` is exported, then reopen the shell.
|
|
55
|
+
- **No diagnostics / "no required module":** open the directory containing `go.mod` as the workspace root. Outside a module, gopls degrades. Run `go mod tidy` if dependencies are unresolved.
|
|
56
|
+
- **Stale toolchain:** reinstall with `go install golang.org/x/tools/gopls@latest` after upgrading Go.
|
|
57
|
+
|
|
58
|
+
## Verify
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
node --experimental-strip-types ../../scripts/verify-lsp.ts path/to/file.go
|
|
62
|
+
# or: bun ../../scripts/verify-lsp.ts path/to/file.go
|
|
63
|
+
```
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Haskell — LSP setup (Hermes / LitHermes)
|
|
2
|
+
|
|
3
|
+
- **Recommended server:** `haskell-language-server-wrapper --lsp`
|
|
4
|
+
- **Extensions:** `.hs .lhs`
|
|
5
|
+
- **Install hint:** `ghcup install hls`
|
|
6
|
+
|
|
7
|
+
The `-wrapper` binary detects your project's GHC version and dispatches to the matching HLS build.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
- **macOS:** `ghcup install hls` (install ghcup via `brew install ghcup` or the official script)
|
|
12
|
+
- **Linux:** `ghcup install hls` (ghcup script from https://www.haskell.org/ghcup/)
|
|
13
|
+
- **Windows:** `ghcup install hls` (ghcup is installed via the Windows installer / PowerShell bootstrap)
|
|
14
|
+
|
|
15
|
+
HLS needs a working GHC plus Cabal and/or Stack. Install a matching toolchain first:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
ghcup install ghc
|
|
19
|
+
ghcup install cabal
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Confirm it resolves:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
command -v haskell-language-server-wrapper
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Configure
|
|
29
|
+
|
|
30
|
+
Add a `haskell` entry to the Hermes LSP config under `lsp.<language>`:
|
|
31
|
+
|
|
32
|
+
```json
|
|
33
|
+
{
|
|
34
|
+
"lsp": {
|
|
35
|
+
"haskell": {
|
|
36
|
+
"command": [
|
|
37
|
+
"haskell-language-server-wrapper",
|
|
38
|
+
"--lsp"
|
|
39
|
+
],
|
|
40
|
+
"extensions": [
|
|
41
|
+
".hs",
|
|
42
|
+
".lhs"
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Hermes routes `.hs`/`.lhs` edits to the HLS wrapper via the `extensions` list. Per-project
|
|
50
|
+
plugin/formatter settings normally live in a `hie.yaml` (cradle) and
|
|
51
|
+
`.haskell-language-server` files rather than the Hermes LSP config.
|
|
52
|
+
|
|
53
|
+
## Alternatives
|
|
54
|
+
|
|
55
|
+
- `ghcide` (the core HLS engine, standalone) — largely superseded by HLS.
|
|
56
|
+
- `hlint` standalone for lint-only checks; `ormolu`/`fourmolu` for formatting.
|
|
57
|
+
|
|
58
|
+
## Troubleshooting
|
|
59
|
+
- **PATH:** `haskell-language-server-wrapper` on PATH; reopen shell after `ghcup install`.
|
|
60
|
+
- **GHC mismatch:** the installed HLS must support your project's GHC version — run `ghcup install hls` for that GHC, or align GHC to a supported one.
|
|
61
|
+
- **No cradle:** multi-package repos may need a `hie.yaml`; generate one with `gen-hie > hie.yaml`.
|
|
62
|
+
- **Slow first load:** HLS compiles dependencies on first open; let it finish indexing.
|
|
63
|
+
|
|
64
|
+
## Verify
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
node --experimental-strip-types ../../scripts/verify-lsp.ts path/to/file.hs
|
|
68
|
+
# or: bun ../../scripts/verify-lsp.ts path/to/file.hs
|
|
69
|
+
```
|