When trying to use “Go to definition” for a PHP project, I get the following error:
Traceback (most recent call last):
File “/Applications/Sublime Text.app/Contents/MacOS/Lib/python38/sublime_plugin.py”, line 1480, in run_
return self.run(**args)
File “/Applications/Sublime Text.app/Contents/MacOS/Packages/Default.sublime-package/symbol.py”, line 256, in run
KeyError: ‘x’
Sublime Text 4 Symbol Error
It appears to, it works if I downgrade to Sublime Text 3. I removed a the babel and JSON Pretty print packages, cleared ~/Library/Caches/Sublime Text 3.
Works in v3, but not in v4
Do you have an override for the default package? Check if there’s a folder called default in the Preferences > Browser Packages…
menu.
Not sure if you tried this as “safe mode” (sry if you did, just to ensure): https://www.sublimetext.com/docs/safe_mode.html
This is reproducible in Safe Mode
, but note that it only triggers when you invoke the Goto
command from the main menu; if you use the key binding or the hover popup, it doesn’t.
The easiest reproduction is to start in Safe Mode, and then pick Goto > Goto Definition
from the main menu (you don’t even need to type anything into the tab or load a file).
The line in question is the window_to_text
call here:
if not symbol:
if event:
pt = v.window_to_text((event["x"], event["y"]))
else:
pt = v.sel()[0]
GotoDefinition
doesn’t get passed an event
when it’s invoked from the Main menu (though it does from the key binding and the hover popup), so event["x"]
bombs it.
Appears to still be an issue with 4113
Traceback (most recent call last):
File “/Applications/Sublime Text 4.app/Contents/MacOS/Lib/python38/sublime_plugin.py”, line 1480, in run_
return self.run(**args)
File “/Applications/Sublime Text 4.app/Contents/MacOS/Packages/Default.sublime-package/symbol.py”, line 256, in run
KeyError: ‘x’
Could you push the fix for this issue. Go To Definition is broken on ST4 (4113) which makes it close to unusable.
Traceback (most recent call last):
File "/opt/sublime_text/Lib/python38/sublime_plugin.py", line 1480, in run_
return self.run(**args)
File "/opt/sublime_text/Packages/Default.sublime-package/symbol.py", line 256, in run
KeyError: 'x'