Skip to content

Commit 7a8a76b

Browse files
committed
Add LSP setup notes and parse quoted commands
1 parent aba5551 commit 7a8a76b

File tree

4 files changed

+28
-5
lines changed

4 files changed

+28
-5
lines changed

Cargo.lock

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ dirs = "5.0"
2929
chrono = "0.4"
3030
glob = "0.3"
3131
ignore = "0.4"
32+
shell-words = "1.1"
3233

3334
[dev-dependencies]
3435
tempfile = "3.8"

README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ symbol_index_lsp_languages:
266266
267267
# Kotlin (Kotlin LSP)
268268
# symbol_index_provider: lsp
269-
# symbol_index_lsp_command: "kotlin-lsp.sh --stdio"
269+
# symbol_index_lsp_command: kotlin-lsp
270270
# symbol_index_lsp_languages:
271271
# kt: kotlin
272272
@@ -298,6 +298,21 @@ symbol_index_lsp_languages:
298298
# php: php
299299
```
300300

301+
### LSP Setup Notes (Install + Command)
302+
303+
Use your package manager if you already have one. These are the minimal install commands and the server command to set in `symbol_index_lsp_command`.
304+
305+
- rust-analyzer: `rustup component add rust-analyzer` and (recommended) `rustup component add rust-src`; command: `rust-analyzer`.
306+
- TypeScript/JavaScript (typescript-language-server): `npm install -g typescript-language-server typescript`; command: `typescript-language-server --stdio`.
307+
- Python (python-lsp-server/pylsp): `pip install "python-lsp-server[all]"` (or `python-lsp-server`); command: `pylsp`.
308+
- Go (gopls): `go install golang.org/x/tools/gopls@latest`; command: `gopls`.
309+
- Java (Eclipse JDT LS): use the distribution’s wrapper `bin/jdtls` with `-configuration` and `-data` arguments.
310+
- Kotlin (Kotlin LSP): `brew install JetBrains/utils/kotlin-lsp` or use the standalone zip; command: `kotlin-lsp` (or `kotlin-lsp.sh`, see its `--help` for stdio options).
311+
- C/C++ (clangd): install via your package manager (e.g., `brew install llvm` or `apt-get install clangd-12`); command: `clangd`.
312+
- C# (csharp-ls): `dotnet tool install --global csharp-ls`; command: `csharp-ls`.
313+
- Ruby (solargraph): `gem install solargraph`; command: `solargraph stdio`.
314+
- PHP (Phpactor): install Phpactor (e.g., download the PHAR or install via composer); command: `phpactor language-server`.
315+
301316
## Plugin Development
302317

303318
Create custom analyzers:

src/core/symbol_index.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -421,12 +421,12 @@ struct LspClient {
421421

422422
impl LspClient {
423423
fn spawn(command: &str, root: &Path) -> Result<Self> {
424-
let mut parts = command.split_whitespace();
425-
let program = parts
426-
.next()
424+
let parts = shell_words::split(command).map_err(|err| anyhow::anyhow!(err.to_string()))?;
425+
let (program, args) = parts
426+
.split_first()
427427
.ok_or_else(|| anyhow::anyhow!("Empty LSP command"))?;
428428
let mut cmd = Command::new(program);
429-
cmd.args(parts);
429+
cmd.args(args);
430430
let mut child = cmd
431431
.stdin(Stdio::piped())
432432
.stdout(Stdio::piped())

0 commit comments

Comments
 (0)