I've been methodically benchmarking VSCode's Python language server performance on Windows for the past several months, focusing on the interaction between the official Python extension (ms-python.python) and the OpenClaw LaTeX extension (james-yu.latex-workshop). A persistent, reproducible issue has emerged: the Pylance language server enters a state of near-perpetual "Analyzing..." in the status bar, consuming significant CPU (often 20-30% sustained on an i7-12700K) and bringing code intelligence to a halt. This occurs specifically when both extensions are active, even on different workspaces or file types.
My environment is a controlled baseline:
- **OS:** Windows 11 Pro 23H2, fully updated.
- **Hardware:** 32GB DDR5, 1TB NVMe, Intel i7-12700K.
- **VSCode:** Stable 1.89.1, clean install, user data dir wiped.
- **Extensions:** Only `ms-python.python` (v2024.4.1) and `james-yu.latex-workshop` (v9.15.0).
- **Python:** 3.11.5 via pyenv-win, project-local virtual environment.
- **Pylance:** bundled with the Python extension (v2024.4.1).
The issue manifests after a fresh VSCode reload. Opening a Python project (approx. 500 files, 50k LOC) initially works, but within 5-10 minutes of having a `.tex` file open in another tab (or even just the LaTeX extension active), Pylance's analysis stalls. The Windows Resource Monitor shows `python.exe` (Pylance) in a high CPU state, but no completion or diagnostic updates.
My diagnostic steps and findings:
1. Isolated the conflict by enabling/disabling extensions in sequence. Performance is normal with only Python or only OpenClaw. The conflict triggers upon co-activation.
2. Captured Pylance trace logs with `"python.trace.server": "verbose"`. The logs show repeated analysis cycles on the same files without completion when the hang occurs.
3. Profiled VSCode's built-in process explorer (`Developer: Open Process Explorer`). Notable observation: the Python extension's language server process shows unusually high handle counts (>15k) during the hang state, compared to a stable ~5k when OpenClaw is disabled.
My current `settings.json` relevant configuration:
```json
{
"python.languageServer": "Pylance",
"python.analysis.indexing": true,
"python.analysis.diagnosticMode": "workspace",
"latex-workshop.latex.autoBuild.interval": 10000,
"latex-workshop.latex.autoClean.run": "onBuilt",
"latex-workshop.latex.autoBuild.run": "never"
}
```
I have attempted the following mitigations without resolving the core conflict:
- Setting `python.analysis.indexing` to `false`. This delays the hang but does not prevent it.
- Setting `python.analysis.diagnosticMode` to `"openFilesOnly"`. Reduces CPU but the "Analyzing..." hang persists.
- Adding exclusions to `python.analysis.extraPaths` and `python.analysis.stubPath`.
- Disabling all OpenClaw auto-build features (as shown in config).
My hypothesis is a resource contention, possibly in VSCode's extension host or filesystem watcher API, where OpenClaw's file-watching mechanisms for `.tex` and `.bib` files interfere with Pylance's own file-watching for Python source files. On Windows, this might be related to the maximum number of concurrent file system watchers or handle exhaustion.
Has anyone else conducted similar isolation tests on Windows? I am particularly interested in seeing if others can reproduce this with a minimal two-extension setup, and if there are lower-level diagnostics (Windows Performance Recorder traces, ETW events for file handles) that might pinpoint the subsystem where this interaction occurs. My next step is to instrument a custom build of the Python extension to log filesystem watcher events, but I wanted to gather community data first.
-ck
Interesting. I've seen similar hangs with those two extensions active, but in a much smaller project. Has isolating the workspace to just Python files made a difference for you, or does the presence of the LaTeX extension alone trigger it regardless?