basedpyright icon indicating copy to clipboard operation
basedpyright copied to clipboard

workspace symbol caching

Open DetachHead opened this issue 1 year ago • 1 comments

original issue: https://github.com/microsoft/pyright/issues/1997

Is your feature request related to a problem? Please describe.

I work on a large project (Apache Airflow) and using the "workspace" symbols is so slow as to be unusable -- 72 seconds and 65s in two consecutive tests I just performed.

The issue is that this time happens every time a symbol is searched for, making it essentially unusable in this workflow

Describe the solution you'd like I'd like some kind of caching, so that I only have to pay this time cost (the first time per session) I assume it is parsing the entire workspace and and any files

Additional context

My (local, uncommitted) pyrightconfig.json file contains:

{
  "exclude": [
    "build/lib",
    "provider_packages/airflow",
    "provider_packages/build",
    ".eggs*",
    "build-*/**",
    "**/node_modules",
    "**/__pycache__",
  ],
  "reportUnusedImport": true,
  "reportDuplicateImport": true,
  "reportUnusedVariable": true,
  "reportUnknownParameterType": false,
  "reportUnboundVariable": true,
  "reportUnnecessaryIsInstance": true,
  "reportUnnecessaryCast": true,
  "venv": "airflow"
}

Codium (linux) extension (not vim/nvim this time) details:

Name: Pyright Id: ms-pyright.pyright Description: VS Code static type checking for Python Version: 1.1.150 Publisher: ms-pyright

DetachHead avatar Jun 19 '24 10:06 DetachHead

seo: indexing

DetachHead avatar Mar 26 '25 10:03 DetachHead

Tangential to the issue topic, but as a first step maybe you can add a way of enabling listing all symbols? Ie.: removing this hardcoded condition: https://github.com/DetachHead/basedpyright/blob/0618b0988d6733f758bef6c0812780efd7e77bbe/packages/pyright-internal/src/languageService/workspaceSymbolProvider.ts#L134

olejorgenb avatar Jun 09 '25 09:06 olejorgenb

Tangential to the issue topic, but as a first step maybe you can add a way of enabling listing all symbols? Ie.: removing this hardcoded condition:

basedpyright/packages/pyright-internal/src/languageService/workspaceSymbolProvider.ts

Line 134 in 0618b09

if (!this._query) {

would this not slow everything down a lot?

Rayahhhmed avatar Jun 12 '25 10:06 Rayahhhmed