Sublime Forum

ST 4180 hangs during file search with LSP-ruff installed

#1

Not long after the recent update to build 4180, Sublime Text started hanging when using the file search dialog (Cmd + P), usually after deleting some characters from the search.

Originally reported in this thread, it seems to be unrelated to that issue.

Since that report, I’ve been able to replicate the issue pretty reliably by just mashing the keyboard in the search including backspace.

Here’s a video of it happening:

Note that even while you see a text edit cursor near the end, it appears as a beach ball in real life.

I have been unable to replicate the issue in safe mode, suggesting a plugin is implicated. I suspect LSP, given its heavy involvement with open files (and the fact that files get opened for preview during search).

0 Likes

Sublime Hanging and can't use app
#2

I removed LSP and the issue persists, so it’s something else.

0 Likes

#3

Here are the list of packages I have installed:

		"AutoSpell",
		"Babel",
		"Discord Rich Presence",
		"Dockerfile Syntax Highlighting",
		"EditorConfig",
		"Git",
		"HexViewer",
		"HTMLBeautify",
		"LSP-ruff",
		"MarkdownPreview",
		"Package Control",
		"PowerShell",
		"Pretty JSON",
		"Puppet",
		"python-black",
		"sublime-github",
		"SublimeLinter",
		"Swift",
		"ToggleExclude",
		"Wrap Plus",

I’d like to bisect that list. Is there an easy way to disable a set of packages without uninstalling each?

0 Likes

#4

Aha. I learned about “ignored_packages” in the “Package Control.sublime-settings”, so I can just copy/paste half of the installed packages there to disable them.

0 Likes

#5

After bisecting the packages, I’ve pretty definitively determined that LSP-ruff is implicated. I had assumed that by uninstalling LSP that LSP-ruff would have no effect, but it seems that adding (only) LSP-ruff to the ignored_packages works around the issue.

0 Likes

#6

I downgraded Sublime Text to 4169 and removed LSP-ruff from ignored packages, and it is once again stable and functional.

0 Likes

#7

I’ve found an easier way to replicate the issue. Rather than doing a bunch of typing of characters, simply hit Cmd+P to bring up the search dialog, then scroll through the results by holding down the down key. As it scrolls, Sublime Text will preview-open each of the files and one of them will trigger the hang.

I tried creating a directory of empty Python files, but I was unable to replicate the issue with empty files. I had to grab a real Python project.

So here are the replication steps:

  1. Install Sublime Text 4180
  2. Install Package Control
  3. Install LSP-ruff
  4. Copy some non-trivial Python files to a directory (something like http --follow https://github.com/python/cpython/archive/refs/tags/v3.12.5.zip | bsdtar -x cpython-3.12.5/Lib/*.py)
  5. Open that directory (subl cpython-3.12.5/Lib)
  6. Use Cmd+P and scroll up and down the list until the application hangs

Given that this issue behaves a lot like a race condition, it’s also possible you’ll need similar hardware specs to mine or for it to fail at the same rate. I’m using a Macbook Pro 2023 14" with M3 Pro chip.

Given that this issue affects build 4180 and not 4169, it’s probably best for the ST team to investigate (and not LSP-ruff).

I’m out of avenues to pursue, so I’m hoping the ST team can take it from here to find a resolution.

0 Likes

#8

I’ve reported the issue as a bug in sublimehq/sublime_text#6459.

0 Likes

#9

Well shoot. After a long day of coding, Sublime Text 4169 also hung on a file search. It seems that although the issue may be present on 4169 as well, just a lot more prominent in 4180. I don’t recall it happening at all prior to the upgrade last week, although if it happened only once a month or less, I’d probably just assumed something had gotten corrupted or glitched.

Since it’s now affecting multiple Sublime Text versions, I should probably report the issue to the LSP-ruff project (which I was planning to do anyway for visibility).

0 Likes