Workspace/symbol search and inlay hints for python-lsp-server via Jedi
Project description
pylsp-workspace-symbols
A python-lsp-server plugin that adds workspace/symbol search and inlay hints via Jedi.
Why?
pylspdoes not implementworkspace/symbolnatively, and its inlay hints support is limited. This plugin fills both gaps, enabling "Go to Symbol in Workspace" and rich type inference hints in any LSP client — including CudaText, Neovim, Emacs, and others.
✨ Features
- 🔍 Workspace-wide symbol search — find functions, classes, and modules across all files in the project
- 💡 Inlay hints — inline type annotations inferred by Jedi for assignments, return types, raised exceptions, and parameter names at call sites
- ⚡ Fast — results in ~130ms after the first call (Jedi cache warm)
- 🔤 Case-insensitive substring match —
areafindscalculate_area,CalfindsCalculator - 📁 Smart folder exclusion — automatically skips
.git,__pycache__,node_modules,.venv,dist,build, and more - ⚙️ Configurable — tune all options via pylsp settings
- 🐍 Python 3.8+ — compatible with all modern Python versions
📦 Installation
pip install pylsp-workspace-symbols
The plugin is discovered automatically by pylsp via its entry point — no manual configuration needed.
⚙️ Configuration
Add to your LSP client's pylsp settings (e.g. in settings.json or equivalent):
{
"pylsp": {
"plugins": {
"jedi_workspace_symbols": {
"enabled": true,
"max_symbols": 500,
"ignore_folders": []
},
"inlay_hints": {
"enabled": true,
"show_assign_types": true,
"show_return_types": true,
"show_raises": true,
"show_parameter_hints": true,
"max_hints_per_file": 200
}
}
}
}
Workspace symbol options
| Option | Type | Default | Description |
|---|---|---|---|
enabled |
bool | true |
Enable/disable workspace symbol search |
max_symbols |
int | 500 |
Maximum symbols returned. 0 means no limit |
ignore_folders |
list | [] |
Extra folder names to skip (merged with built-in list) |
Inlay hint options
| Option | Type | Default | Description |
|---|---|---|---|
enabled |
bool | true |
Enable/disable all inlay hints |
show_assign_types |
bool | true |
Show inferred types for unannotated assignments (x = 42 → : int) |
show_return_types |
bool | true |
Show inferred return types for unannotated functions (def f(): → -> str) |
show_raises |
bool | true |
Show raised exception types (raise ValueError(...) → Raises: ValueError) |
show_parameter_hints |
bool | true |
Show parameter names at call sites (f(1, 2) → a=1, b=2) |
max_hints_per_file |
int | 200 |
Maximum hints per file. 0 means no limit |
Built-in ignored folders
.git, .hg, .svn, __pycache__, .mypy_cache, .ruff_cache, .pytest_cache,
node_modules, .venv, venv, .env, env, dist, build, .eggs, egg-info
🚀 Usage
Workspace symbol search
Once installed, your LSP client will receive workspaceSymbolProvider: true in the server capabilities.
Use your client's "Go to Symbol in Workspace" command (typically Ctrl+T or # in the symbol picker).
Inlay hints
Your LSP client will receive inlayHintProvider: true in the server capabilities. Hints are
rendered inline by the client automatically. The following hint types are supported:
- Assignment hints — unannotated variable assignments, including
self.attrin__init__ - Return hints — unannotated
defandasync deffunctions, inferred from the firstreturnstatement - Raise hints —
raise ExceptionType(...)statements - Parameter hints — positional argument names at call sites (keyword args are skipped as self-documenting)
Inlay hints respect type annotations already present in the source — annotated functions and variables are never hinted twice.
🔍 How it works
Workspace symbols
pylsp does not define a pylsp_workspace_symbols hookspec, so this plugin uses two hooks:
pylsp_experimental_capabilities— advertisesworkspaceSymbolProvider: trueto the client during theinitializehandshake.pylsp_dispatchers— registers a custom JSON-RPC handler forworkspace/symbolthat calls Jedi'sproject.complete_search()and filters results client-side by case-insensitive substring match.
Note:
workspace/symbolreturns module-level definitions (functions, classes, modules). Local variables inside functions are not indexed — this is standard LSP behaviour, consistent with pyright and other Python language servers.
Inlay hints
The plugin handles the textDocument/inlayHint request using a hybrid approach:
- Regex scan — fast pass over the source to locate
def, assignment,raise, and call patterns. _literal_typefast-path — resolves common literals ("str",42,True,[...], etc.) without calling Jedi.- Jedi inference — for non-literal expressions,
script.infer()andscript.get_signatures()are used to resolve types. - Signature fallback — for
self.attr = paramassignments, the enclosingdefsignature is inspected for type annotations or default values.
🧪 Tests
pip install -e ".[dev]"
pytest
🤝 Contributing
Issues and pull requests are welcome! Please open an issue before submitting a large change.
📚 References
👤 Author
Bruno Eduardo — github.com/Hanatarou
📄 License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pylsp_workspace_symbols-0.2.0.tar.gz.
File metadata
- Download URL: pylsp_workspace_symbols-0.2.0.tar.gz
- Upload date:
- Size: 19.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f73fd28e8831f6444afbd29f5315da9ab51909705f1a497347dd522d913b603e
|
|
| MD5 |
c7202ed5fefe3b196b2d15151b40b4ca
|
|
| BLAKE2b-256 |
1ed8d16c928e0b625eabfc18fe7f9910672773121bd3ca7f5717c6626b3ce651
|
Provenance
The following attestation bundles were made for pylsp_workspace_symbols-0.2.0.tar.gz:
Publisher:
publish.yml on Hanatarou/pylsp-workspace-symbols
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pylsp_workspace_symbols-0.2.0.tar.gz -
Subject digest:
f73fd28e8831f6444afbd29f5315da9ab51909705f1a497347dd522d913b603e - Sigstore transparency entry: 976559162
- Sigstore integration time:
-
Permalink:
Hanatarou/pylsp-workspace-symbols@8c89bcb7d4cc52e99a01a45640efa709d0cda6ef -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/Hanatarou
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8c89bcb7d4cc52e99a01a45640efa709d0cda6ef -
Trigger Event:
push
-
Statement type:
File details
Details for the file pylsp_workspace_symbols-0.2.0-py3-none-any.whl.
File metadata
- Download URL: pylsp_workspace_symbols-0.2.0-py3-none-any.whl
- Upload date:
- Size: 15.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
16986aea6126d08ed959bf79a353c2ced2805785e83adcfb7a1d456380e4eb25
|
|
| MD5 |
9cf800f496f73ea772b7f577f6652861
|
|
| BLAKE2b-256 |
46f10f433fecec18311eed70825d84510a01ed5fc3f6a8b8789d1ed8af0c8d5d
|
Provenance
The following attestation bundles were made for pylsp_workspace_symbols-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on Hanatarou/pylsp-workspace-symbols
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pylsp_workspace_symbols-0.2.0-py3-none-any.whl -
Subject digest:
16986aea6126d08ed959bf79a353c2ced2805785e83adcfb7a1d456380e4eb25 - Sigstore transparency entry: 976559166
- Sigstore integration time:
-
Permalink:
Hanatarou/pylsp-workspace-symbols@8c89bcb7d4cc52e99a01a45640efa709d0cda6ef -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/Hanatarou
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8c89bcb7d4cc52e99a01a45640efa709d0cda6ef -
Trigger Event:
push
-
Statement type: