bob-lsp
v0.1.2
Published
Language servers for IBM Bob Shell: definitions, references, types, symbols, and the errors each edit introduces
Maintainers
Readme
bob-lsp
bob-lsp lets IBM Bob Shell ask language servers where a name is defined, where it is used, what type it has and what a file contains. After each file Bob edits, bob-lsp tells Bob which errors that edit introduced.
Bob Shell 2.1.0 has a list of language servers and reads ~/.bob/lsp.yaml,
but has no LSP client, so it never starts them. bob-lsp is a Bob plugin: an
MCP server, the bridge, that runs the language servers, and hooks that run
before and after Bob's edit tools. It uses the same language servers as
Claude Code's LSP plugins.
bob-lsp is unofficial and is not an IBM product.

What Bob gets
- An
lsptool, read-only and approved without asking, with the operationsgoToDefinition,goToImplementation,findReferences,hover,documentSymbol,findSymbol,workspaceSymbol,incomingCalls,outgoingCallsanddiagnostics. A position is a line plus a column or a symbol name, or a symbol name alone for its first occurrence in the file, so Bob does not need to count characters.documentSymboloutlines a file;depth: 0lists only its top-level symbols.findSymbolfinds symbols by name path, such asGreeter/hello, in a file or withworkspace: truein the whole project.depthadds their children,includeBodytheir source, andsubstringMatchinglets the last name match part of a name.findReferencesgroups the references by the symbol that contains each one, such asMethod Greeter/hello, with the line of source.
- After each
apply_diff,insert_content,search_and_replaceandwrite_file, the errors that edit introduced in the edited file. bob-lsp compares the file's errors before and after the edit, so errors that were already there are not repeated, and a clean edit adds nothing. - At session start, a note naming the languages the
lsptool serves in the folder, and each missing language server with the command that installs it, for Bob to pass on to you.
After an edit, Bob sees:
bob-lsp: 1 problem introduced by this edit in main.py:
main.py:5:14 error [Pyright reportAssignmentType]: Type "str" is not assignable to declared type "int"Languages
| Server | Languages | Installs with | |---|---|---| | pyright | Python | mise, npm, uv, brew | | vtsls | TypeScript, JavaScript | mise, npm | | rust-analyzer | Rust | rustup, brew | | gopls | Go | mise, go, brew | | jdtls | Java | brew | | clangd | C, C++, Objective-C | Xcode command line tools, brew | | sourcekit-lsp | Swift | Xcode, Swift toolchain | | bash-language-server | Shell | mise, npm, brew | | lua-language-server | Lua | mise, brew | | ruby-lsp | Ruby | gem |
To add a server or change one, see Configure.
Requirements
- macOS or Linux
- Node.js 22.18 or later
- IBM Bob Shell 2.1 or later
Install
npm install --global bob-lsp
bob-lsp enablebob-lsp enable writes the plugin to ~/.bob/plugins/bob-lsp, where Bob
loads it in every folder. bob-lsp enable --workspace writes it to the
current folder's .bob/plugins/bob-lsp instead. Restart Bob to load it.
Bob runs a plugin's hooks only in folders you trust.
Check which language servers the current folder needs, then install the missing ones:
bob-lsp status # the servers for this folder's languages, installed or not
bob-lsp install # install the missing ones
bob-lsp install gopls # or name thembob-lsp install uses the first installer on PATH that has a package
for the server, in the order mise, npm, brew, rustup, go, cargo, uv, gem,
and shows its output. With --dry-run it prints the commands instead.
The plugin records the paths to node and to bob-lsp, so run bob-lsp enable
again after moving or reinstalling either.
Uninstall
bob-lsp disable # or bob-lsp disable --workspace
npm uninstall --global bob-lspbob-lsp disable removes the plugin folder that enable wrote. The
language servers that bob-lsp install installed stay; remove them with
the installer that installed them.
From a clone
git clone https://github.com/gillesdandrea/bob-lsp
cd bob-lsp
npm install
npm run build
node dist/cli.js enableConfigure
~/.bob/lsp-servers.json applies in every folder. Every key is optional:
{
"autoInstall": false,
"diagnostics": {
"onEdit": true,
"includeWarnings": false,
"max": 20,
"timeoutMs": 4000,
"baselineTimeoutMs": 5000
},
"servers": {
"pyright": { "enabled": false },
"basedpyright": {
"label": "Python",
"command": "basedpyright-langserver",
"args": ["--stdio"],
"extensionToLanguage": { ".py": "python", ".pyi": "python" },
"rootMarkers": ["pyproject.toml"],
"install": { "uv": "basedpyright" }
}
}
}| Key | Meaning | Default |
|---|---|---|
| autoInstall | At session start, install the missing servers for the folder's languages in the background, logging to /tmp/bob-lsp-<uid>/install.log, instead of only reporting them | false |
| diagnostics.onEdit | Report the errors each edit introduces | true |
| diagnostics.includeWarnings | Also report new warnings | false |
| diagnostics.max | The most problems one report lists | 20 |
| diagnostics.timeoutMs | How long to wait for a server's diagnostics after an edit | 4000 |
| diagnostics.baselineTimeoutMs | How long an edit may wait while bob-lsp records the file's diagnostics before it | 5000 |
| servers | Servers by id: an entry with a built-in id changes only the fields it names, and a new id adds a server after the built-in ones | the servers in Languages |
A folder's .bob/lsp-servers.json applies on top of
~/.bob/lsp-servers.json, but may set only the diagnostics keys and
servers.<id>.enabled, for servers bob-lsp already knows. That file comes
with the repository, so bob-lsp refuses one that names a command, an
installer or autoInstall: opening Bob in a cloned repository must not run
programs the repository chose.
{ "diagnostics": { "includeWarnings": true }, "servers": { "jdtls": { "enabled": false } } }A server takes the fields of a Claude Code .lsp.json entry: command,
args, env, extensionToLanguage, initializationOptions and
settings, the answers to the server's workspace/configuration
requests. bob-lsp adds these:
| Field | Meaning | Default |
|---|---|---|
| label | The languages, for messages | the id |
| enabled | false turns the server off | true |
| rootMarkers | Files that mark a project root | none |
| excludeMarkers | Files that rule the server out, like deno.json | none |
| fallback | With no root marker, workspace serves the file from the workspace root and none does not serve it | workspace |
| publishesWhenClean | false for a server that sends nothing for a file without errors | true |
| install | The package for each installer: mise, npm, brew, rustup, go, cargo, uv, gem | none |
| hint | Install steps to show when no installer applies | none |
When two servers serve the same file type, the first one that is installed
answers lsp requests, and both report diagnostics.
How it works
bob-lsp enable writes a Bob plugin. Its mcp.json starts bob-lsp mcp
for each session, and its hooks/hooks.json runs bob-lsp hook at
session start and before and after each edit.
bob-lsp mcp, the bridge, starts a language server the first time Bob
asks about a file in its language: one server per project root, found by
walking up from the file to the nearest root marker. At startup it starts
the servers whose root markers are at the workspace root. Bob edits files
on disk, so before each request the bridge sends the server the file's
current text.
Bob runs each hook as a separate process. The hooks reach the bridge
through a unix socket in /tmp/bob-lsp-<uid>/, named after the workspace
and Bob's process id. Before an edit, the PreToolUse hook has the bridge
record the file's diagnostics. After it, the PostToolUse hook asks the
bridge for the new ones. An error is new when the file had no identical
error before the edit (same severity, source, code and message) on any
line, so an error the edit only moved is not reported.
Bob IDE
In Bob IDE, bob-lsp offers no tool, starts no language server, and its
hooks do nothing. Bob IDE loads plugins from the same ~/.bob/plugins
folder, but it gets code intelligence from its editor, and Bob reports the
errors each of its edits introduces from the editor's diagnostics.
bob-lsp knows it runs in Bob IDE from VSCODE_CRASH_REPORTER_PROCESS_TYPE,
which VS Code sets to extensionHost in the process where Bob IDE runs and
removes from the shells of its integrated terminal. A Bob Shell started in
that terminal therefore still gets bob-lsp. The hooks read the variable
directly. The bridge gets it from mcp.json, through Bob's
${env:…} expansion, and otherwise checks whether its parent is an
Electron process.
Limits
- Bob starts MCP servers with only
HOME,LOGNAME,PATH,SHELL,TERMandUSERfrom its environment, and the language servers inherit that. Anything they find throughPATHworks, including an activated virtualenv and mise shims. Set any other variable a server needs, such asJAVA_HOME, in itsenv. - bob-lsp reports errors in the edited file only, not in the files that depend on it.
- Diagnostics that a server computes only on save, like rust-analyzer's
cargo checkresults, may arrive after the report. - The
lsptool only reads. It does not rename or apply code actions, so every change goes through Bob's own edit tools and approvals.
Contribute
Bug reports, fixes and new language servers are welcome: see CONTRIBUTING.md to build and test bob-lsp, and CHANGELOG.md for what changed in each release. Report a vulnerability privately, as SECURITY.md explains.
