Closed jaraco closed 1 month ago
LSP doesn't open files when previewing them so it shouldn't be happening.
LSP: Troubleshoot Server
with one of the py files opened?
## Server Configuration
- command
```json
[
"$server_path",
"server"
]
"/Users/jaraco/Library/Caches/Sublime Text/Package Storage/LSP-ruff/bin/ruff" server
source.python
source.python
{
"settings": {
"codeAction": {
"disableRuleComment": {
"enable": true
},
"fixViolation": {
"enable": true
}
},
"configuration": null,
"configurationPreference": "editorFirst",
"exclude": null,
"fixAll": true,
"format": {
"preview": null
},
"lineLength": null,
"lint": {
"enable": true,
"extendSelect": null,
"ignore": null,
"preview": null,
"select": null
},
"logLevel": "error",
"organizeImports": true
}
}
{}
{
"PATH": "/Users/jaraco/Library/Caches/Sublime Text/Package Storage/LSP-ruff/bin:"
}
/Users/jaraco/code/python/cpython/Lib/tokenize.py
{
"auto_complete_selector": "meta.tag, source - comment - string.quoted.double.block - string.quoted.single.block - string.unquoted.heredoc",
"lsp_active": true,
"syntax": "Packages/Python/Python.sublime-syntax"
}
source.python
[
"/Users/jaraco/code/python/cpython"
]
In this forum post and sublimehq/sublime_text#6459, I documented my search to find why Sublime Text has started hanging.
It started last week, not long after the update to Sublime Text 4180. I would do a search and get a beach ball while typing or scrolling through the files in the search dialog. It seems to be related to the previewing/opening of the files, or perhaps the rapid opening and closing of the files. I've found I can only replicate the issue when there are Python files with meaningful Python content in them (empty Python files is not enough).
Disabling LSP-ruff stops the hangs.
I thought that downgrading to Sublime Text 4169 worked around the issue, but I've had it hang on my twice since downgrading, so I may have just incorrectly assessed the situation, given the indeterminacy of the issue.
I suspect the issue is related to the setup and teardown of ruff when applied to many files in quick succession, maybe due to inadequate isolation of the runs and their caches. Maybe ruff is itself hanging or maybe LSP-ruff is hanging.
I could really use some help solving the issue, because it requires me to force-quit Sublime Text and potentially lose work. It's quite disruptive to my flow.