daveleroy / SublimeDebugger

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

Context debugger.active not working #264

Closed DJManas closed 3 weeks ago

DJManas commented 1 month ago

Hello,

I have just once returned to python and found out, that I have problem with shortcuts. I had read this in #59.

It was working and I was happy, but now that I had launched the Sublime Text, its not working anymore. Not sure why. When I have debugger open and launched it sometimes work, sometimes dont.

Sublime Text: 4 build 4169 Debugger: From git Installed plugins:

Maybee I am just missing something, but when debugger is off, I add sublime.log_commands(True) to console it doesn't register that the key was pressed.

After start console doesn't give any errors

startup, version: 4169 linux x64 channel: stable
executable: /opt/sublime_text/sublime_text
application: /opt/sublime_text
working dir: /home/djmanas
packages path: /home/djmanas/.config/sublime-text/Packages
state path: /home/djmanas/.config/sublime-text/Local
zip path: /opt/sublime_text/Packages
zip path: /home/djmanas/.config/sublime-text/Installed Packages
ignored_packages: ["Vintage"]
pre session restore time: 0.536235
startup time: 1.41543
first paint time: 1.52835
git: using configuration from system git install
git: tracking working dir /home/djmanas/cloud/Projekty/Python/__Libraries__/bankApi.NewBak
Unable to find cancel_build command: exec
reloading python 3.3 plugin BracketHighlighter.bh_core
reloading plugin Default.arithmetic
reloading plugin Default.auto_indent_tag
reloading plugin Default.block
reloading plugin Default.colors
reloading plugin Default.comment
reloading plugin Default.convert_color_scheme
reloading plugin Default.convert_syntax
reloading plugin Default.copy_path
reloading plugin Default.echo
reloading plugin Default.exec
reloading plugin Default.fold
reloading plugin Default.font
reloading plugin Default.goto_line
reloading plugin Default.history_list
reloading plugin Default.html_print
reloading plugin Default.indentation
reloading plugin Default.install_package_control
reloading plugin Default.keymap
reloading plugin Default.kill_ring
reloading plugin Default.mark
reloading plugin Default.new_templates
reloading plugin Default.open_context_url
reloading plugin Default.open_in_browser
reloading plugin Default.pane
reloading plugin Default.paragraph
reloading plugin Default.paste_from_history
reloading plugin Default.profile
reloading plugin Default.quick_panel
reloading plugin Default.rename
reloading plugin Default.run_syntax_tests
reloading plugin Default.save_on_focus_lost
reloading plugin Default.scroll
reloading plugin Default.set_unsaved_view_name
reloading plugin Default.settings
reloading plugin Default.show_scope_name
reloading plugin Default.side_bar
reloading plugin Default.sort
reloading plugin Default.switch_file
reloading plugin Default.symbol
reloading plugin Default.transform
reloading plugin Default.transpose
reloading plugin Default.ui
reloading plugin CSS.css_completions
reloading plugin Diff.diff
reloading plugin HTML.encode_html_entities
reloading plugin HTML.html_completions
reloading plugin Emmet.main
reloading plugin Package Control.plugin
reloading python 3.3 plugin BracketHighlighter.bh_logging
reloading python 3.3 plugin BracketHighlighter.bh_plugin
reloading python 3.3 plugin BracketHighlighter.bh_popup
reloading python 3.3 plugin BracketHighlighter.bh_regions
reloading python 3.3 plugin BracketHighlighter.bh_remove
reloading python 3.3 plugin BracketHighlighter.bh_rules
reloading python 3.3 plugin BracketHighlighter.bh_search
reloading python 3.3 plugin BracketHighlighter.bh_swapping
reloading python 3.3 plugin BracketHighlighter.bh_wrapping
reloading python 3.3 plugin BracketHighlighter.support
reloading python 3.3 plugin Deviot.start_listener
reloading plugin Debugger.start
reloading python 3.3 plugin MarkdownPreview.browser
reloading python 3.3 plugin MarkdownPreview.markdown_preview
reloading plugin Djaneiro.Djaneiro
reloading plugin GitGutter.plugin
reloading python 3.3 plugin MarkdownPreview.markdown_settings
reloading python 3.3 plugin MarkdownPreview.markdown_wrapper
reloading python 3.3 plugin requirementstxt.requirements
reloading python 3.3 plugin SideBarEnhancements.SideBar
reloading python 3.3 plugin SideBarEnhancements.SideBarAPI
reloading python 3.3 plugin SublimeAutoDocstring.auto_docstring
reloading python 3.3 plugin SublimeAutoDocstring.autodocstring_logging
reloading python 3.3 plugin SublimeAutoDocstring.docstring_styles
reloading python 3.3 plugin SublimeAutoDocstring.dparse
reloading python 3.3 plugin SublimeFileDiffs.file_diffs
reloading plugin GitGutter.release
reloading plugin LSP.boot
reloading plugin LSP-file-watcher-chokidar.watcher
reloading plugin LSP-json.commands
reloading plugin LSP-json.plugin
reloading plugin LSP-json.schema_store
reloading plugin LSP-pyright.commands
reloading plugin LSP-pyright.plugin
reloading plugin MarkdownEditing.plugin
reloading plugin SublimeLinter.__allo__
reloading plugin SublimeLinter.__init__
reloading plugin SublimeLinter._init
reloading plugin SublimeLinter.active_linters_view
reloading plugin SublimeLinter.busy_indicator_view
reloading plugin SublimeLinter.goto_commands
reloading plugin SublimeLinter.highlight_view
reloading plugin SublimeLinter.log_handler
reloading plugin SublimeLinter.panel_view
reloading plugin SublimeLinter.quick_actions
reloading plugin SublimeLinter.status_bar_view
reloading plugin SublimeLinter.sublime_linter
reloading plugin SublimeLinter-csslint.linter
reloading plugin SublimeLinter-flake8.linter
reloading plugin SublimeLinter-html-tidy.linter
reloading plugin SublimeLinter-json.linter
reloading plugin SublimeLinter-mypy.linter
reloading plugin SublimeLinter-pydocstyle.linter
reloading plugin SublimeLinter-pylint.linter
plugins loaded
Debugger: [startup]
Debugger: ProjectConfiguration.reload
Debugger: [finished]
reloading settings Packages/User/deviot.sublime-settings
LSP-pyright: INFO: Using python path "/usr/bin/python"
Package Control: Skipping automatic upgrade, last run at 2024-05-29 09:06:56, next run at 2024-05-29 17:06:56 or after

I enable sublime.log_commands(True) and try to launch/continue in debugger, but it wont get triggered, you can see, that I had launched it (won't show, but it was by clicking on play icon), then I pressed F5 more times, but it won't even continue.

>>> sublime.log_commands(True)
command: show_panel {"panel": "console", "toggle": true}
command: git_gutter {"events": 128}
command: show_panel {"panel": "console", "toggle": true}
command: show_overlay {"overlay": "command_palette"}
command: git_gutter_blame {"is_event": true, "line": 0}
command: debugger {"action": "open"}
command: show_panel {"panel": "output.Debugger Console"}
command: debugger_edit
command: show_panel {"panel": "output.Debugger Console"}
command: debugger_edit
command: git_gutter {"events": 128}
command: debugger_edit
command: debugger_edit
command: show_panel {"panel": "output.Debugger Console"}
command: debugger_edit
command: debugger_edit
command: debugger_edit
Debugger: event not handled `debugpySockets`
Debugger: event not handled `debugpySockets`
Debugger: event not handled `debugpySockets`
command: lsp_hover {"point": 326}
Debugger: event not handled `debugpySockets`
command: show_panel {"panel": "output.Debugger Console"}
command: debugger_edit
command: show_panel {"panel": "output.Debugger"}
command: show_panel {"panel": "output.Debugger"}
command: show_panel {"panel": "output.Debugger"}
command: debugger_edit
command: sublime_linter_assigned {"filename": "/home/djmanas/cloud/Projekty/Python/__Libraries__/bankApi/bankFile.py", "linter_names": ["pydocstyle", "flake8", "pylint", "mypy"]}
command: git_gutter {"events": 128}
Traceback (most recent call last):
  File "/home/djmanas/.config/sublime-text/Packages/SublimeLinter/highlight_view.py", line 188, in update_phantoms
    with stable_viewport(view, phantoms):
  File "./python3.8/contextlib.py", line 113, in __enter__
  File "/home/djmanas/.config/sublime-text/Packages/SublimeLinter/highlight_view.py", line 194, in stable_viewport
    pos = cur_pos(view)
  File "/home/djmanas/.config/sublime-text/Packages/SublimeLinter/highlight_view.py", line 207, in cur_pos
    return view.sel()[0]
  File "/opt/sublime_text/Lib/python38/sublime.py", line 2291, in __getitem__
    raise IndexError()
IndexError
command: lsp_hover {"point": 15067}
command: drag_select {"event": {"button": 1, "x": 420.0, "y": 306.0}}
Debugger: error: adapter failed hover evaluation Exception occurred during evaluation.
command: git_gutter_blame {"is_event": true, "line": 470}
command: drag_select {"event": {"button": 1, "x": 374.0, "y": 258.0}}
command: git_gutter_blame {"is_event": true, "line": 466}
command: show_panel {"panel": "console", "toggle": true}
command: drag_select {"event": {"button": 1, "x": 10.0, "y": 497.0}}
command: drag_select {"event": {"button": 1, "x": 423.0, "y": 721.0}, "extend": true}
command: drag_select {"event": {"button": 1, "x": 518.0, "y": 716.0}, "extend": true}

Thanks, Regards, Petr Sourek

DJManas commented 1 month ago

Tried downgrade to 0.11.3, 0.11.0, 0.10.1, 0.9.3, but got strange python errors about more parameters than it was expecting, but when I had pressed F5, it did and showed error in console. 0.11.5 is completely silent.

e.g.:

daveleroy commented 3 weeks ago

This should be fixed now https://github.com/daveleroy/SublimeDebugger/commit/0b009aa2d494f19505bd919801d46d642f644698

DJManas commented 3 weeks ago

Its working thanks.