Commit Graph

95 Commits (8b0ae3d27912799d59e4948ff11d3a5428e32ce4)

Author SHA1 Message Date
quantonganh 085706e0cd
Include completions for git-ignored files in debugger prompt (#7936) 11 months ago
Yomain 8afc0282f2
Fix crash when cwd is deleted (#7185) 12 months ago
Gokul Soumya f18acadbd0
Completely remove old Picker and rename FilePicker to Picker 1 year ago
Michael Davis 545acfda88
Make file preview callback optional
When Picker and FilePicker are merged, not all Pickers will be able to
show a preview.

Co-authored-by: Gokul Soumya <gokulps15@gmail.com>
1 year ago
A-Walrus d5fe08ddb8
Replace DAP vars popup, instead of adding new (#7034) 1 year ago
Daniel Sedlak e856906f76
Fix typos (#6643) 1 year ago
Filip Dutescu 376c19e06b
feat(dap): implement Restart request (#5651)
Add a restart debug session command, which would issue a
[Restart Request][1], if the debugger supports it and a session is
running. It uses the same arguments and requests used to start the
initial session, when recreating it.

It builds upon #5532, making use of the changes to the termination
workflow of a session.

[1]: https://microsoft.github.io/debug-adapter-protocol/specification#Requests_Restart

Closes: #5594

Signed-off-by: Filip Dutescu <filip.dutescu@gmail.com>
1 year ago
Filip Dutescu 44729fbaf9
fix(dap): validate key and index exist when requesting vars (#5628)
Check if the stack frames contain the thread id and the frame before
trying to get the frame id. If case any of the two fails to be
found, provide the user with messages to inform them of the issue and
gracefully return.

Closes: #5625

Signed-off-by: Filip Dutescu <filip.dutescu@gmail.com>
1 year ago
Filip Dutescu e3765ac6d2
feat(dap): send Disconnect if Terminated event received (#5532)
Send a `Disconnect` DAP request if the `Terminated` event is received.
According to the specification, if the debugging session was started by
as `launch`, the debuggee should be terminated alongside the session. If
instead the session was started as `attach`, it should not be disposed of.

This default behaviour can be overriden if the `supportTerminateDebuggee`
capability is supported by the adapter, through the `Disconnect` request
`terminateDebuggee` argument, as described in
[the specification][discon-spec].

This also implies saving the starting command for a debug sessions, in
order to decide which behaviour should be used, as well as validating the
capabilities of the adapter, in order to decide what the disconnect should
do.

An additional change made is handling of the `Exited` event, showing a
message if the exit code is different than `0`, for the user to be aware
off the termination failure.

[discon-spec]: https://microsoft.github.io/debug-adapter-protocol/specification#Requests_Disconnect

Closes: #4674

Signed-off-by: Filip Dutescu <filip.dutescu@gmail.com>
1 year ago
Gokul Soumya 5c7db7aed5 Replace menu::Item::{row, label} with format() 1 year ago
A-Walrus 2f9ca3840a
Add preview for scratch buffers in buffer picker (#3454) 2 years ago
Skyler Hawthorne b530a86d1f remove Callback::Compositor variant
To reduce likelihood of accidental discarding of important callbacks
2 years ago
Skyler Hawthorne aaa1450678 fix write-quit with auto format
write-quit will now save all files successfully even when there is auto
formatting
2 years ago
Frojdholm 4c9f144dac
fix: Recalculate completion when going through prompt history (#3193)
* fix: Recalculate completion when going through prompt history

* Update completion when the prompt line is changed

It should not be possible to update the line without also updating the
completion since the completion holds an index into the line.

* Fix Prompt::with_line recalculate completion

with_line was the last function where recalculate completion had to be
done manually. This function now also recalculates the completion so
that it's impossible to forget.

* Exit selection when recalculating completion

Keeping the selection index when the completion has been recalculated
doesn't make sense. This clears the selection automatically, removing
most needs to manually clear it.

* Remove &mut on save_filter

Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
2 years ago
Danilo Spinella 110eb73045
Add cwd parameter which is not optional anymore (#3240) 2 years ago
Gokul Soumya 6e2aaed5c2
Reuse menu::Item trait in picker (#2814)
* Refactor menu::Item to accomodate external state

Will be useful for storing editor state when reused by pickers.

* Add some type aliases for readability

* Reuse menu::Item trait in picker

This opens the way for merging the menu and picker code in the
future, since a picker is essentially a menu + prompt. More
excitingly, this change will also allow aligning items in the
picker, which would be useful (for example) in the command palette
for aligning the descriptions to the left and the keybinds to
the right in two separate columns.

The item formatting of each picker has been kept as is, even though
there is room for improvement now that we can format the data into
columns, since that is better tackled in a separate PR.

* Rename menu::Item::EditorData to Data

* Call and inline filter_text() in sort_text() completion

* Rename diagnostic picker's Item::Data
2 years ago
Blaž Hrastnik 20cf75dfa1
Strip some more params 2 years ago
Blaž Hrastnik 9a6ee88e66
Split off dap event handlers into helix-view to allow reuse 2 years ago
Blaž Hrastnik 5a60989efe
Bump dependencies 2 years ago
Blaž Hrastnik 7b1d682fe5 dap: fix runInTerminal with lldb-vscode 2 years ago
Blaž Hrastnik 4e1b3b12f3 Refactor symbol picker to share code 2 years ago
Cole Helbling 6118486eb2 helix-term: implement buffer completer
In order to implement this completer, the completion function needs to
be able to access the compositor's context (to allow it to get the
list of buffers currently open in the context's editor).
2 years ago
Blaž Hrastnik d11b652139 Allow static strings in set_status/set_error so API is nicer 2 years ago
Blaž Hrastnik fd0e4b1159 dap: Reduce amount of block_on uses 2 years ago
Blaž Hrastnik 1422449537 .. 2 years ago
Blaž Hrastnik eeb9b39857 Fix build on master 2 years ago
Blaž Hrastnik bd549d8a20 Merge remote-tracking branch 'origin/master' into debug 2 years ago
Blaž Hrastnik 7ad8eaaef0 wip 3 years ago
Blaž Hrastnik df3b88387b dap: Improve variables UI 3 years ago
Blaž Hrastnik dac317e620 TODO 3 years ago
Blaž Hrastnik 60c86eff89 dap: Simplify a few more statements that could use the debugger macro 3 years ago
Blaž Hrastnik d8351d35ab dap: Extract a macro that fetches a debugger or returns 3 years ago
Blaž Hrastnik e98993d609 dap: Fix an off-by-one error when jumping 3 years ago
Blaž Hrastnik bf8437d098 clippy lint 3 years ago
Blaž Hrastnik dc8df7ba21 Make thread_picker non-blocking 3 years ago
Blaž Hrastnik d5d1a9b1ae
Apply suggestions from code review
Co-authored-by: Gokul Soumya <gokulps15@gmail.com>
3 years ago
Blaž Hrastnik 43fbb6d965 Make dap_start non-blocking 3 years ago
Blaž Hrastnik 2dbf966293 dap: Start working on runInTerminal support 3 years ago
Blaž Hrastnik d14ca05d6b Simplify some cases that use return None to use ? 3 years ago
Blaž Hrastnik de5e5863aa dap: Use cursor_line over cursor + char_to_line 3 years ago
Blaž Hrastnik 54f8e5c9c3 dap: Fix an off-by-one and move the function over to commands/dap 3 years ago
Blaž Hrastnik 573cb39926 dap: Remove some unwraps 3 years ago
Blaž Hrastnik ffc89e483b Mark some more TODOs as resolved 3 years ago
Blaž Hrastnik b4fd3148e3 These TODOs have been resolved 3 years ago
Blaž Hrastnik 8ffafb826f dap: Rewrite breakpoints so that there's a single set maintained 3 years ago
Blaž Hrastnik 3633f85b38 Pass editor into render_view & gutter, reducing the number of params 3 years ago
Blaž Hrastnik 85b4410703 dap: Toggle breakpoints without changing selection, fix offset calc 3 years ago
Blaž Hrastnik b55ca8fdb8 dap: Always edit breakpoints on the correct document 3 years ago
Blaž Hrastnik 0eadeab8c7 dap: Remove the prompt line parameter, use insert_str instead 3 years ago
Blaž Hrastnik 5f329a22c4 dap: Modify breakpoints in place with no cloning 3 years ago