Skip to main content

workspace/symbol support for python-lsp-server via Jedi

Project description

pylsp-workspace-symbols

A python-lsp-server plugin that adds workspace/symbol support via Jedi.

Why? pylsp does not implement workspace/symbol natively. This plugin fills that gap, enabling "Go to Symbol in Workspace" 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
  • Fast — results in ~130ms after the first call (Jedi cache warm)
  • 🔤 Case-insensitive substring matcharea finds calculate_area, Cal finds Calculator
  • 📁 Smart folder exclusion — automatically skips .git, __pycache__, node_modules, .venv, dist, build, and more
  • ⚙️ Configurable — tune max_symbols and ignore_folders 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": []
      }
    }
  }
}
Option Type Default Description
enabled bool true Enable/disable the plugin
max_symbols int 500 Maximum symbols returned. 0 means no limit
ignore_folders list [] Extra folder names to skip (merged with built-in list)

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

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).

How it works

pylsp does not define a pylsp_workspace_symbols hookspec, so this plugin uses two hooks:

  1. pylsp_experimental_capabilities — advertises workspaceSymbolProvider: true to the client during the initialize handshake.
  2. pylsp_dispatchers — registers a custom JSON-RPC handler for workspace/symbol that calls Jedi's project.complete_search("") and filters results client-side by case-insensitive substring match.

Note: workspace/symbol returns 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.

🧪 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pylsp_workspace_symbols-0.1.0.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pylsp_workspace_symbols-0.1.0-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file pylsp_workspace_symbols-0.1.0.tar.gz.

File metadata

  • Download URL: pylsp_workspace_symbols-0.1.0.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pylsp_workspace_symbols-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e2a9786ad22734351513a9d258bac88bcbd5453eea018f10996fd32a608d6e16
MD5 2d31c3f10484a4be1f67d325ff3e977e
BLAKE2b-256 edeab9f100d8e6626e06f0a059d8ff11e528b02846ce6badac4baf7b7f18a0e4

See more details on using hashes here.

Provenance

The following attestation bundles were made for pylsp_workspace_symbols-0.1.0.tar.gz:

Publisher: publish.yml on Hanatarou/pylsp-workspace-symbols

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pylsp_workspace_symbols-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pylsp_workspace_symbols-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 19afdd72982b8e2fb17435bc3a19fde0cdc7a646d9cc7ecf738220a7f8cc0ad0
MD5 fde3b74172ff2be1f6cdce1d437a888a
BLAKE2b-256 69aae276089e4fb6dfb1f3cac0ec32d771b4e9e5f19e3df98e1ba86c59eaf045

See more details on using hashes here.

Provenance

The following attestation bundles were made for pylsp_workspace_symbols-0.1.0-py3-none-any.whl:

Publisher: publish.yml on Hanatarou/pylsp-workspace-symbols

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page