daveleroy / SublimeDebugger

Graphical Debugger for Sublime Text for debuggers that support the debug adapter protocol
MIT License
366 stars 41 forks source link

Unable to run with SublimeText 4 and Package Control 4 #242

Closed meengit closed 6 months ago

meengit commented 6 months ago

Hi @daveleroy

Thank you very much for this package. I used it for quite some time. However, with Package Control Release 4.0.1 I'm unable to run it anymore. I'm not sure if it is a local issue. However, the following installation methods results in Python errors in SublimeText's console, and I can't find a way to make it work again.

General

Preparation

Cleared /Users/***/Library/Caches/Sublime Text/Cache before installation.

Method 1 – Use the package from Package Control

The console shows the following error:

Unable to parse color value var(background) at Packages/Debugger/contributes/ColorScheme/Mariana.sublime-color-scheme:5:18
reloading plugin Debugger.start
Debugger: Installing Debugger33
Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python38/sublime_plugin.py", line 432, in load_module
    m.plugin_loaded()
  File "/Users/***/Library/Application Support/Sublime Text/Packages/Debugger/start.py", line 56, in plugin_loaded
    data = sublime.load_resource("Packages/Debugger/modules/adapters/util/bridge33.py")
  File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python38/sublime.py", line 1199, in load_resource
    raise FileNotFoundError(f'resource "{name}" not found')
FileNotFoundError: resource "Packages/Debugger/modules/adapters/util/bridge33.py" not found
top level value must be an array
top level value must be an array
reloading python 3.3 plugin Debugger33.bridge33
generating syntax summary

When I try to open the debugger from Menu Tools > Debugger > Open the console shows:

Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python38/sublime_plugin.py", line 1502, in is_visible_
    ret = self.is_visible(**args)
  File "/Users/***/Library/Application Support/Sublime Text/Packages/Debugger/modules/command.py", line 105, in is_visible
    return command.is_visible(self.window)
  File "/Users/***/Library/Application Support/Sublime Text/Packages/Debugger/modules/command.py", line 76, in is_visible
    if self.flags & Command.development and not Settings.development:
  File "/Users/***/Library/Application Support/Sublime Text/Packages/Debugger/modules/settings.py", line 17, in __get__
    return SettingsRegistery.settings.get(self.key, self.default)
AttributeError: type object 'SettingsRegistery' has no attribute 'settings'
Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python38/sublime_plugin.py", line 1478, in is_enabled_
    ret = self.is_enabled(**args)
  File "/Users/***/Library/Application Support/Sublime Text/Packages/Debugger/modules/command.py", line 100, in is_enabled
    command = CommandsRegistry.commands_by_action[action]
KeyError: 'lldb_display'
Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python38/sublime_plugin.py", line 1502, in is_visible_
    ret = self.is_visible(**args)
  File "/Users/***/Library/Application Support/Sublime Text/Packages/Debugger/modules/command.py", line 104, in is_visible
    command = CommandsRegistry.commands_by_action[action]
KeyError: 'lldb_display'
Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python38/sublime_plugin.py", line 1478, in is_enabled_
    ret = self.is_enabled(**args)
  File "/Users/***/Library/Application Support/Sublime Text/Packages/Debugger/modules/command.py", line 100, in is_enabled
    command = CommandsRegistry.commands_by_action[action]
KeyError: 'lldb_toggle_dereference'
Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python38/sublime_plugin.py", line 1502, in is_visible_
    ret = self.is_visible(**args)
  File "/Users/***/Library/Application Support/Sublime Text/Packages/Debugger/modules/command.py", line 104, in is_visible
    command = CommandsRegistry.commands_by_action[action]
KeyError: 'lldb_toggle_dereference'
Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python38/sublime_plugin.py", line 1658, in run_
    return self.run(**args)
  File "/Users/***/Library/Application Support/Sublime Text/Packages/Debugger/modules/command.py", line 97, in run
    command.run(self.window, kwargs)
  File "/Users/***/Library/Application Support/Sublime Text/Packages/Debugger/modules/command.py", line 63, in run
    debugger = Debugger.create(window, skip_project_check = bool(self.flags & Command.allow_debugger_outside_project))
  File "/Users/***/Library/Application Support/Sublime Text/Packages/Debugger/modules/debugger.py", line 39, in create
    debugger = Debugger.get(window, create=True, skip_project_check=skip_project_check)
  File "/Users/***/Library/Application Support/Sublime Text/Packages/Debugger/modules/debugger.py", line 62, in get
    instance = Debugger(window, skip_project_check=skip_project_check)
  File "/Users/***/Library/Application Support/Sublime Text/Packages/Debugger/modules/debugger.py", line 97, in __init__
    self.project = Project(window, skip_project_check)
  File "/Users/***/Library/Application Support/Sublime Text/Packages/Debugger/modules/project.py", line 16, in __init__
    if not skip_project_check and not Settings.global_debugger_configurations:
  File "/Users/***/Library/Application Support/Sublime Text/Packages/Debugger/modules/settings.py", line 17, in __get__
    return SettingsRegistery.settings.get(self.key, self.default)
AttributeError: type object 'SettingsRegistery' has no attribute 'settings'

Method 2 – Install from GitHub Repository using Package Control's Add Repository command(s)

The console shows the following error:

reloading plugin SublimeDebugger.start
Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python38/sublime_plugin.py", line 325, in reload_plugin
    m = importlib.import_module(modulename)
  File "./python3.8/importlib/__init__.py", line 127, in import_module
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 868, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/Users/***/Library/Application Support/Sublime Text/Packages/SublimeDebugger/start.py", line 22, in <module>
    from .modules.adapters.util.bridge import DebuggerBridgeCommand
  File "/Users/***/Library/Application Support/Sublime Text/Packages/SublimeDebugger/modules/adapters/__init__.py", line 1, in <module>
    from .lldb import LLDB
  File "/Users/***/Library/Application Support/Sublime Text/Packages/SublimeDebugger/modules/adapters/lldb.py", line 11, in <module>
    from .import util
  File "/Users/***/Library/Application Support/Sublime Text/Packages/SublimeDebugger/modules/adapters/util/__init__.py", line 10, in <module>
    from .import process
ImportError: cannot import name 'process' from partially initialized module 'SublimeDebugger.modules.adapters.util' (most likely due to a circular import) (/Users/***/Library/Application Support/Sublime Text/Packages/SublimeDebugger/modules/adapters/util/__init__.py)
top level value must be an array
top level value must be an array
generating syntax summary

Also, cmd + shift + p > Package Control: Satisfy Libraries results in:

Package Control: The library "psutil" is not available for Python 3.8
error: Package Control

One or more libraries could not be installed or updated.

Please check the console for details.

Summary

Question

Do you see a reason for behavior? Do I have missed something? Can you reproduce the errors?

daveleroy commented 6 months ago

I don't know why installing via package control would not be working.

https://github.com/daveleroy/SublimeDebugger/commit/c124fb018163492216636112ad5f95aec92dbd86 should fix your issue with installing from the main branch

daveleroy commented 6 months ago

https://github.com/daveleroy/SublimeDebugger/issues/225 this mentions restarting

meengit commented 6 months ago

Hi @daveleroy, thank you very much for your prompt answer. I can confirm that the Debugger is working again with both installation methods.