* Remove space in cargo.toml
* Add TCPHost for Javascript and PHP adapter
* Allow falling back to first open port
* Add some more docs to TCPHost
* Fix cached binaries prevent from having multiple debug sessions for one adapters
This was an issue, because we stored the port arg inside the DebugAdapterBinary which was cached so could not change anymore.
Co-authored-by: Anthony Eid <hello@anthonyeid.me>
* Add default setting for tcp timeout
Co-Authored-By: Anthony Eid <56899983+Anthony-Eid@users.noreply.github.com>
---------
Co-authored-by: Anthony Eid <hello@anthonyeid.me>
Co-authored-by: Anthony Eid <56899983+Anthony-Eid@users.noreply.github.com>
* Correctly invalidate and refetch data
* Fix show current stack frame after invalidating
* Remove not used return value
* Clean up
* Don't send SelectedStackFrameChanged when id is still the same
* Only update the active debug line if we got the editor
* 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
* Remove not needed notify
* Add loaded sources list
* Remove not needed double nested div.child()
* Remove not needed block
* Fix todo for updating loaded source
Before this change the debug panel was still in the running state, which is/was wrong. So updating the status to Ended, will update the UI to an correct state.
* WIP Move stack frame list to own module
* Add missing notify
* Remove some more duplicated state for the current stack frame
* Clear highlights when stack frame has changed
* Fix go to stack frame again
* Create basic breakpoint prompt editor structure
* Get breakpoint prompt to properly render
* Fix bug where toggle breakpoint failed to work
This bug occurs when a breakpoint anchor position is moved from the begining
of a line. This causes dap_store.breakpoint hashmap to fail to properly get
the correct element, thus toggling the wrong breakpoint.
The fix to this bug is passing a breakpoint anchor to an editor's display map
and to the render breakpoint function. Instead of creating a new anchor when
clicking on a breakpoint icon, zed will use the breakpoint anchor passed to
the display map.
In the case of using toggle breakpoint action, zed will iterate through all
breakpoints in that buffer to check if any are on the cursor's line number,
then use anchor if found. Otherwise, zed creates a new anchor.
* Fix bug where breakpoint icon overlaps with other icons
This bug happened when an icon {code action | code runner} was rendered on the same line of a breakpoint
where that breakpoint's anchor was not at the start of the line
* Get breakpoint prompt to add log breakpoint's correctly
* Clean up breakpoint prompt UI & allow editting of log messages
---------
Co-authored-by: Remco Smits <djsmits12@gmail.com>
* 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>
* Only include dap store if editor.mode is FULL
* Move go to stack frame to debug_panel_item
* Notify dap_store when updating active breakpoints location
* Fix clippyyyy
* Show active debug line when you reopen a buffer
* Remove uncommented code
This is not needed anymore, we already clear the highlights when thread exited
* Make clippy happy
* Fix todo for removing highlights on exited event
This PR moves out all the actions from the **debug_panel_item** to the **workspace** which allows people to use these actions inside their key binds.
I also had to remove the debug_panel dependency inside the debug_panel_item, because we hit a `"cannot update debug_panel while it is already being updated"` panic. So instead of updating the thread status inside the **debug_panel** we now do this inside the **debug_panel_item** to prevent this panic.
I also move the actions to its own debugger namespace, so it's more clear what the actions are for.
The new actions can now also be used for key binds:
```
debugger: start
debugger: continue
debugger: step into
debugger: step over
debugger: step out
debugger: restart
debugger: stop
debugger: pause
```
/cc @Anthony-Eid We now can have key binds for debugger actions.
* Make dap store global
* Partially move initialize & capability code to dap store
* Reuse shutdown for shutdown clients
* Rename merge_capabilities
* Correctly fallback to current thread id for checking to skip event
* Move mthod
* Move terminate threads to dap store
* Move disconnect and restart to dap store
* Update dap-types to the correct version
This includes the capabilities::merge method
* Change dap store to WeakModel in debug panels
* Make clippy happy
* Move pause thread to dap store
* WIP refactor out thread state and capbilities
* Move update thread status to debug panel method
* Remove double notify
* Move continue thread to dap store
* Change WeakModel dapStore to Model dapStore
* Move step over to dap store
* Move step in to dap store
* Move step out to dap store
* Remove step back
we don't support this yet
* Move threadState type to debugPanel
* Change to background task
* Fix panic when debugSession stopped
* Remove capabilities when debug client stops
* Add missing notify
* Remove drain that causes panic
* Remove Arc<DebugAdapterClient> from debug_panel_item instead use the id
* Reset stack_frame_list to prevent crash
* Refactor ThreadState to model to prevent recursion dependency in variable_list
* WIP
* WIP move set_variable_value and get_variables to dap store
* Remove unused method
* Fix correctly insert updated variables
Before this changes you would see the variables * scopes. Because it did not insert the the variables per scope.
* Correctly update current stack frame on variable list
* Only allow building variable list entries for current stack frame
* Make toggle variables & scopes work again
* Fix clippy
* Pass around id instead of entire client
* Move set breakpoints to dap store
* Show thread status again in tooltip text
* Move stack frames and scope requests to dap store
* Move terminate request to dap store
* Remove gap that is not doing anything
* Add retain back to remove also threads that belong to the client
* Add debug kind back to tab content
This also changes the concept of passing the receiver inside the request to make sure we handle all the requests in the right order.
Now we have another peace of state that keeps track of the current requests, and when request comes in we move the receiver to the pending requests state and handle the request as we did before.
* Start setting up new debug task format
* Set up blueprint for converting from debug task to regular task
* Create debug adapter trait
* Get debug.json schema to json lsp to show users hints
* Start debugger task refactor to enable easier debugger setup
* Get python adapter to work within task.json
co-authored-by: Piotr <piotr@zed.dev>
* Start work on getting Php Debug adapter working
* Make debug adapter trait work with async functions
Fix CICD spell check & clippy warnings
Co-authored-by: Remco Smits <djsmits12@gmail.com>
---------
Co-authored-by: Piotr <piotr@zed.dev>
Co-authored-by: Remco Smits <djsmits12@gmail.com>
* Move breakpoint and client code to dap store
This also changes how we sync breakpoints. Now we just update the dap store model instead of having a RWlock.
The goal is to prepare for making inlay hints for debugging work.
* Remove debug code
* Remove unused method
* Fix don't grow the amount tasks for sending all the breakpoints
* Partially implement terminate clients when app quits
* Sync open breakpoints to closed breakpoints when buffer is closed
* Call terminate request also for not already started clients
* Fix missing import
* Remove not needed read_with call
* 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