Commit 4fbfa66
authored
feat(config): add server-specific heuristics for spawn filtering (#45)
* feat(config): add server-specific heuristics for spawn filtering
Add minimal heuristics to prevent spawning LSP servers in projects
where they are not applicable (e.g., rust-analyzer in Python project).
- Add ServerHeuristics struct with project_markers field (OR logic)
- Extend LspServerConfig with optional heuristics field
- Filter servers based on workspace markers before spawn_batch()
- Add default heuristics for rust-analyzer, pyright, typescript,
gopls, clangd, zls
- Add comprehensive unit tests for heuristics logic
Servers without heuristics always attempt spawn (backward compatible).
Skipped servers are logged at INFO level.
Closes #37
* docs: update changelog for server heuristics feature
* patch: bump version to 0.3.2 and document server heuristics
- Update workspace version from 0.3.1 to 0.3.2
- Update CHANGELOG with release date
- Add Server Heuristics section to README documenting:
- Default project markers for each language server
- OR logic for marker detection
- Custom heuristics configuration examples1 parent e6c99bf commit 4fbfa66
10 files changed
Lines changed: 361 additions & 19 deletions
File tree
- crates/mcpls-core
- src
- config
- lsp
- tests/integration
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
8 | 28 | | |
9 | 29 | | |
10 | 30 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
261 | 261 | | |
262 | 262 | | |
263 | 263 | | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
264 | 305 | | |
265 | 306 | | |
266 | 307 | | |
| |||
275 | 316 | | |
276 | 317 | | |
277 | 318 | | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
278 | 322 | | |
279 | 323 | | |
280 | 324 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
0 commit comments