Closed blacelle closed 1 day ago
Could you share what file type is displayed in the status bar at the bottom right corner when you open the untitled file? Trying to understand if VS Code is treating the cvs file as a Python file. Also, does that repro if you save the file?
It is assumed as Python.
Once saved, and the environment reloaded, the file is properly detected as CSV and the issue does not appear.
This might be an issue with VSCode's content-based language detection system that analyzes the content of the untitled file and attempts to guess the appropriate language mode. Transferring to vscode.
Just to be clear, a CSV being guessed as Python is an issue, but any content causing a CPU spike when it's in a Python file is a separate Pylance issue.
As a user, I can manually switch the language, if I accidentally pick Python, and suddenly my machine crawls, that's an issue in the language server.
Linking this with the meta issue of samples where our model chooses the wrong language: https://github.com/microsoft/vscode/issues/131450
Environment data
Code Snippet
No python code, as the issue seems unrelated to .py files.
Repro Steps
Expected behavior
Low CPU activity
Actual behavior
100% single-thread activity for minutes.
Closing the Unsaved tab should kill the faulty process, but it remains 100% CPU. I need to kill it. Killing while having the tab still open let another process starting right away with 100% activity.
Logs
I added
python.analysis.logLevek: Trace
and set Trace in the Toggle in the output. Though, I feel Traces are not reported. Still, we see2024-10-23 10:09:32.553 [info] (57585) [FG] parsing: untitled:Untitled-2 (1400ms)
which rfers to my large unsaved CSV file.I keep seeing in
ps aux | grep python
the faulty process: