sublimelsp / LSP-ruff

LSP helper for ruff - an extremely fast Python linter, written in Rust.
https://packagecontrol.io/packages/LSP-ruff
MIT License
31 stars 4 forks source link

LSP-ruff hangs Sublime Text during file search #75

Closed jaraco closed 1 month ago

jaraco commented 1 month ago

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.

rchl commented 1 month ago

LSP doesn't open files when previewing them so it shouldn't be happening.

jaraco commented 1 month ago

Troubleshooting: LSP-ruff

Version

## Server Configuration
 - command
```json
[
  "$server_path",
  "server"
]

Active view

Project / Workspace

LSP configuration

## System PATH - /Users/jaraco/.local/bin - /opt/homebrew/opt/openssl@1.1/bin - /Applications/Firefox.app/Contents/MacOS - /Users/jaraco/.cargo/bin - /opt/python/bin - /opt/homebrew/bin - /Users/jaraco/Dropbox/bin/mac - /Users/jaraco/Dropbox/bin/scripts - /Applications/SourceTree.app/Contents/Resources/ - /Applications/Visual Studio Code.app/Contents/Resources/app/bin - /Applications/Sublime Merge.app/Contents/SharedSupport/bin - /Applications/Sublime Text.app/Contents/SharedSupport/bin - /usr/local/bin - /System/Cryptexes/App/usr/bin - /usr/bin - /bin - /usr/sbin - /sbin - /var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin - /var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin - /var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin - /Library/Apple/usr/bin - /Users/jaraco/code/MestreLion/git-tools --- I started capturing some videos, starting with showing that the issue doesn't occur with LSP-ruff disabled, but after disabling LSP-ruff, the issue occurred again, so I need to go back and re-assess my assumptions, but at first blush, it looks like LSP-ruff is not implicated, so I'm going to close this for now. I'll update if I find otherwise.