* Reapply "Lazy load stack frame information (scopes & variables) (#106)"
This reverts commit 27b60436b8.
* Reapply "Remove futures from debugger ui crate"
This reverts commit 3cf96588e2.
* Don't fetch initial variables twice
This was introduced by my original PR, because I added the fetch on stack frame select but when the stack frames where updated we would already fetch the initial variables. And when the selectedStackFrameUpdated event was received we would refetch it because it was not done yet.
* Remove duplicated method just for testing
* Make keep open entries work again
The issue was the we used the scope_id, which changes after each debug step. So using the name of the scope instead should be more reliable.
* Correctly invalidate variable list information
* Comment out collab variable list for now
Also commenting out an event that triggers the infinite loop.
We want to revisited the collab stuff anyway so we decided to do it this way.
* WIP
* Add assert helper for variable list visual entries
* Wip rework toggle entry (scope/variable) code
* Remove commented code
* Move colors to struct
* Add entry to selection if you click on them
* Add selected option to visual entries assert
* Use pretty assertions for visual entries assert helper
* Use focus handle method to give focus handle
* Register select first and last actions
* Correctly format selected entry
* Add tests helper to get active debug panel item
* Add tests for keyboard navigation
* Remove not needed comment
* Move other tests to test helper
This also removes a test that is duplicated with the keyboard navigation tests, it covers the same
* Update console test to use new test helper
* Fix failing test
I forgot to update the test, because we now always send a body back in a error case.
* Fix clippyyyy
This change replaces the Vec-based implementation with SumTree,
significantly improving performance for frequent insertions. While
the impact may not be immediately noticeable to users, it eliminates the need for costly vector shifts during each insert operation.
* Initial WIP for impl FollowableItem for DebugPanelItem
* Implment DebuggerThreadState proto functions
* Add Debug panel item variable list definition to zed.proto
* Add more debug panel item messages to zed.proto
* WIP
* Fix compile errors
Co-authored-by: Remco Smits <djsmits12@gmail.com>
* More WIP
Co-authored-by: Remco Smits <djsmits12@gmail.com>
* Further WIP lol
* Start working on fake adapter WIP
Co-authored-by: Remco Smits <djsmits12@gmail.com>
Co-authored-by: Mikayla Maki <mikayla@zed.dev>
* Merge with Remco's mock debug adapter client branch
* Fix false positive clippy error
This error was a match variant not being covered when the variant wasn't possible dued
to a feature flag. I'm pretty sure this is a bug in clippy/rust-analyzer and will
open an issue on their repos
* Add todo to change in dap adapter downloads
* WIP Get variable to send during variable list
* Get variable list from/to_proto working
Note: For some reason variable entries aren't rendering even though
everything is being sent
* Fix warning messages
* Fix typo
* Impl stack from list from/to_proto for debug panel item
* Change order of set_from_proto for debug panel item
* Impl Variable list variables to/from proto funcs
* Start work on Set Debugger Panel Item event
* WIP with remco
Co-authored-by: Remco Smits <djsmits12@gmail.com>
* Get SetDebugPanelItem proto message sending and handled
Co-authored-by: Remco Smits <djsmits12@gmail.com>
* Setup UpdateDebugAdapter collab message & send live stack frame list updates
* Use proto enums instead of hardcoded integers
* Use read instead of update
* Send variable list update message each time we build the entries
* Send stack frame message when we selected the active stackframe
* Add more mappings
* Remove debug and rename method to be more inline with others
* Use the correct entries to reset
* Add tests to validate we can go and from proto ScopeVariableIndex
* Rename test
* Create UpdateAdapter ModuleList variant WIP
* Change proto conversion trait to have some types return Result enums
* Get clippy to pass
I removed some proto message we used in DebugPanelItem FollowableItem implmentation
because they were causing clippy errors and will need to be change in the near
future anyway
---------
Co-authored-by: Remco Smits <djsmits12@gmail.com>
Co-authored-by: Mikayla Maki <mikayla@zed.dev>
* Add debug panel flow tests
* Wip debug
* Wip fix test
Co-Authored-By: Anthony Eid <56899983+Anthony-Eid@users.noreply.github.com>
* WIP Get test_show_debug_panel to run
while the test now runs without panicing dued to parked with nothing left to run
the debug panel item is not being spawned
* Get test_show_debug_panel to pass & clean up
* Make clippy pass
* Assert debug panel item is removed when client shutdown
* Move send event back to dapstore
---------
Co-authored-by: Anthony Eid <56899983+Anthony-Eid@users.noreply.github.com>
Co-authored-by: Anthony Eid <hello@anthonyeid.me>
* Rename StopDebugAdapters to ShutdownDebugAdapters
* Remove debug config from install methods
* Move requests methods to background executor
* Wip attach with picker
* Move find client to the first line of the method
The client should always be there at this point.
* Fix correctly determine when to restart
While debugging an reverse request issue, the top level client did send terminated event with `restart: false` but we tried to restart the client resulting in the client never being cleaned up by us.
Because before this change we always assumed if we got a json value we are going to restart the client, which is wrong.
We no try to restart the client if:
- restart arg is a boolean and its true
- restart arg is a json value but no boolean
* Clean up response to adapter
* Fix clippy errors
* WIP tasks
* Simplified debug task schema
This changes debug.json to look for adapter: adapter_name instead of
and object when a user selects a debug adatper and fixes the default
behavior of request (to launch)
Co-authored-by: Remco Smits <djsmits12@gmail.com>
* Make default and flatten work for request
* Rename enum case
* Remove dbg
* Dismiss when candidate is not found
* Add docs for why we update the process id on the config
* Show error when `attach` request is selected but not supported
---------
Co-authored-by: Anthony Eid <hello@anthonyeid.me>
* Make program optional in debug task format
* Remove default config for skipFile JavaScript debugger
* Add Debug case to TerminalKind
* Don't allow serializing debug terminals
* Add respond method so we can send response back for reverse requests
* Implement run in terminal reverse request
* Move client calls to dap store
This commit also fixes an issue with not sending a response for the `StartDebugging` reverse request.
* Make clippy happy
* Use buffer settings for font, size etc.
* Trim end of message
* By default send the output values to the output editor
* WIP send evaluate request
* Rename variable
* Add result to console from evaluate response
* Remove not needed arc
* Remove store capabilities on variable_list
* Specify the capacity for the task vec
* Add placeholder
* WIP add completion provider for existing variables
* Add value to auto completion label
* Make todo for debugger
* Specify the capacity of the vec's
* Make clippy happy
* Remove not needed notifies and add missing one
* WIP move scopes and variables to variable_list
* Rename configuration done method
* Add support for adapter completions and manual variable completions
* Move type to variabel_list
* Change update to read
* Show debug panel when debug session stops
Co-Authored-By: Anthony Eid <56899983+Anthony-Eid@users.noreply.github.com>
Co-Authored-By: Mikayla Maki <mikayla.c.maki@gmail.com>
* Also use scope reference to determine to which where the set value editor should display
* Refetch existing variables after
* Rebuild entries after refetching the variables
---------
Co-authored-by: Anthony Eid <56899983+Anthony-Eid@users.noreply.github.com>
Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>
* Wip render set variable value editor
* Remove unused subscriptions
* Set current variable value & select all when setting value
* Send set variable request
* Rename tread entry to VariableListEntry
* WIP allow setting variables for nested structures
* Refactor & rename vars on thread state to be only the ids
* Fix we did not correct notify the right context when updating variable list
* Clean open entries when debugger stops
* Use SetExpression if adapter supports it when setting value
* Refetch scope variables after setting value
This commit also reworks how we store scopes & variables
* Remove debug code
* Make Clippy happy
* Rename variable
* Change order for variable id
* Allow cancelling set value using escape key
* Create debugger console
* Get console to output console messages during output events
* Use match expression in handle_output_event
* Move debug console code to it's own file console
* Wip move handle reverse requests on the debug panel
* Remove todo for startDebugging
* Remove unused code
* Make clippy happy
* Log error instead of ignoring it
* Remove debug code