Commit graph

112 commits

Author SHA1 Message Date
Ben Jackson
8e2d352eb8 Fix local adapter specs
Somehow we lost the ability to define adapters in the local
.vimspector.json, I think when GetConfigurations was added.

Put that feature back.
2020-11-30 10:19:02 +00:00
Ben Jackson
c769e8a479 Fix up the tests to work in linux container too 2020-11-22 14:13:14 +00:00
Ben Jackson
53b1d12447 Allow setting the current thread, use a sign to highlight the line with the current thread 2020-11-22 14:13:14 +00:00
Ben Jackson
f0785c11f2 Allow pausing individual threads (in theory) 2020-11-22 14:13:14 +00:00
Emmanuel Thompson
d5b9411256 Add a GetConfigurations function 2020-11-06 12:05:14 -05:00
Ben Jackson
80985148e7 Add "run to cursor" support
We add a 'temporary' option to line breakpionts and try and clear any
temporary breakpionts on the line we end up stopping on. This might not
be art, but _probably_ works in almost all cases that matter.

it's a bit hacky the way we have to push the reason around, but we don't
know where we stopped until we actually get the stack trace response and
SetCurrentFrame

Move temporary breakpionts to match server response

Also delete any existing ones when adding a new one and add tests for
run-to-cursor.

Only continue after we successfully set the breakpoints. This makes it
work in go
2020-10-23 22:53:04 +01:00
Ben Jackson
0d112d70a0 Add SetLineBreakpoint and ClaerLineBreakpoint APIs
These are useful for running tests (i.e. ensure there's a breakpiont at
the start of the test) and/or other programmatic usages.

They will also be needed for setting temporary breakpionts.
2020-10-17 22:40:08 +01:00
Ben Jackson
1b9763a4fc Minor improvements to console usage
Display failures and stop adding random text which makes the (very
useful) CodeLLDB interface look messy
2020-10-10 16:20:55 +01:00
Ben Jackson
4e5011fe1b Make command line completion work too 2020-09-04 01:18:59 +01:00
Ben Jackson
45f0b68d87 Remove slow debugging code 2020-09-04 00:52:36 +01:00
Ben Jackson
1ace7b648e FixUp: vint 2020-09-04 00:49:37 +01:00
Ben Jackson
0867edd81c FixUp: Correct return values from omnifunc 2020-09-04 00:37:39 +01:00
Ben Jackson
2710ee2bfa When the start parameter is missing, the behabiour is arbitary
It seems that the behaviour of the start parameter being missing is
server (or perhaps a specific client) dependent. The specification
clearely says that it should be inserted at the column of the original
request, but the servers clearly expect either for that column to be the
beginning of an identifier or for the client to ignore the spec and
request from that position anyway.

Reading the VSCode code, we see that the 'word' before the cursor is
guessed, and if only if BOTH 'start' AND 'length' are supplied, then
they are used to determine where insertion starts, otherwise the current
'word' is used. Unclear what 'word' means in the specific contexts, but
we're relying on iskeyword.
2020-09-04 00:29:39 +01:00
Ben Jackson
97bdb0d0cc Show launch failure reason in the splash 2020-09-03 22:09:22 +01:00
Ben Jackson
733843a6d4 Support completion for console and watches.
Add omnifunc for prompt buffers

This synchronous completion can be used with any completion system
including built-in CTRL-X CTRL-O.

The filetype of the prompt buffers is set to VimspectorPrompt so that it
can be identified by completion systems. For example, this works well
with YCM:

let g:ycm_semantic_triggers =  {
  \   'VimspectorPrompt': [ '.', '->', ':', '<' ]
  \ }
2020-09-03 17:48:46 +01:00
Ben Jackson
51cc6c4d3a Add VimspectorToggleLog 2020-08-28 14:32:17 +01:00
Ben Jackson
d86b42bf5b Allow VimspectorShowOutput with no argument 2020-07-31 22:19:10 +01:00
Ben Jackson
8f5b928e4b Allow a statically configured list of gadgets
Useful for storing config in source control
2020-07-23 16:37:03 +01:00
Ben Jackson
29cb5c914b Add bang versions of install commands to leave the output open 2020-07-22 22:18:19 +01:00
Ben Jackson
26d7e95adc Fix windows installer issues - use symlinks not junctions and fix dumb use of PIPE with check_call 2020-07-22 19:27:42 +01:00
Ben Jackson
000f7a9232 Prettify the output with some syntax and quiet option 2020-07-22 14:40:23 +01:00
Ben Jackson
4144631d03 Add :VimspectorUpdate 2020-07-22 12:50:44 +01:00
Ben Jackson
98bef3db03 Fix - don't switch windows/buffers to create a new hidden buffer 2020-07-22 10:54:06 +01:00
Ben Jackson
cd5ca37ce1 Neovim support 2020-07-22 10:52:48 +01:00
Ben Jackson
05bbafd60c Close the intaller output when complete 2020-07-22 10:52:48 +01:00
Ben Jackson
0140a607b1 Raise autocommand when installer completes. use this in testing 2020-07-22 10:52:48 +01:00
Ben Jackson
23e5f6bbf4 Switch to running the actual install_gadget.py
This re-uses the OutputView code to run the installer script. Refactor
to remove connection from the base OutputView (and other places, it
wasn't used - only used after ConnectionUp).

This also consolidates the stdout and stderr buffers for running jobs.
The distinction was always arbitrary and probably an error, based on the
fact that they were separate in the APIs not based on usability.
2020-07-22 10:52:48 +01:00
Ben Jackson
025d193493 Add VimspectorInstall command with sort-of completion 2020-07-22 10:48:12 +01:00
Ben Jackson
99b582378a Allow ctrl-c to cancel when asked for a variable 2020-07-18 14:39:54 +01:00
Ben Jackson
7a9f75a06e Don't change the value of equalalways
We were trying to avoid equalalways from changing the UI layout by
unsetting it and resetting it after changes. However, re-setting
equalalways actually resizes all the windows, so this never worked.

Instead we judiciously use rightbelow, leftabove, etc. and specify the
exact window sizes we want.

As a side-effect we make the terminal sizing a little more pleasant by
default, ensuring that it is no wider than 80 chars, and tries to use
any remianing vertical space after reserving 80 chars for the code
window.
2020-07-16 16:05:04 +01:00
Ben Jackson
a4f3fd9c5e Disable relativenumber in utility windows; disable textwidth in neovim too 2020-07-16 08:13:27 +01:00
Ben Jackson
0de023e3c4 Re-raise errors that aren't expectd 2020-07-11 14:42:35 +01:00
Ben Jackson
7c943c2ed7 Fix the terminal window to 80 columns 2020-07-11 14:08:45 +01:00
Ben Jackson
43dd282702 Fix handling data after exit - channels and neovim 2020-07-11 14:07:28 +01:00
Ben Jackson
3643c2effd Only respond to data events for the _current_ job, not buffered data for old jobs 2020-07-11 11:43:28 +01:00
Ben Jackson
6cfc313234 Do a better job of tidying up on test failure; note: We can still receive data callbacks after _OnExit, so just ignore that data 2020-07-10 22:49:30 +01:00
Ben Jackson
32c7960b5f Support channel-based adapters with jobs in neovim
Again, the neovim API is lacking - we have to hack around our own retry
loop (where vim offers 'waittime').

Note neovim documentation says that it returns 0 on connection failure,
but actually it throws an error, so we catch that. There are probably a
ton of other problems with error handling, but i'll rely on user
testing/feedback for that.
2020-07-06 10:44:14 +01:00
Ben Jackson
b322a2e89c Allow 'channel' based transports to also start a job 2020-07-06 10:38:53 +01:00
Ben Jackson
c6d6c7f876 Support "multi-session" mode properly
Document remote debugging and add a test
2020-05-17 14:07:56 +01:00
Ben Jackson
abd8ba7d38 Stabilise some tests 2020-05-08 11:50:38 +01:00
Ben Jackson
4586aa36ff Improve UI for watch window
Add a WinBar as the whole prompt buffer thing is not that well
undersood. Also allow you to delete a watch from any part of the
expression result too.
2020-04-26 21:31:22 +01:00
Ben Jackson
c25e9256aa Fix restart command in neovim when terminal in use
Neovim doesn't allow you to replace a terminal buffer if the buffer has
received some output, so we tell it that the buffer is not modified as a
hackaround.

Fixes #154
2020-04-26 10:21:24 +01:00
Ben Jackson
b20f61bcff Sigh, neovim doesn't support default method arguments 2020-04-25 20:07:03 +01:00
Ben Jackson
7a70519b03 Add basic support for conditional breakpoints
This is the minimal required for a user to use conditional breakpoint -
we add an options dict to each breakpoint (line and function) and allow
the condition to be supplied. We add a plug mapping and a default
shortcut (<leader><F9>) to add one where we ask the user to enter the
condition and hit expression. This isn't great but it works.

We don't check the capabilities, so they would just be ignored if used
on a server that doesn't support them. We also ask for a hit expression
which most users won't understand so this isn't ideal either.

No tests yet.
2020-04-25 19:57:42 +01:00
Ben Jackson
1003cdc0b2 Add a splash popup while starting up
Sometimes it can take quite a while to start up and initialise the debug
adapter. So we use popup/float to display the status as we start up and
shut down.

This increases minimum Vim version to 8.2, but that's been out for ages
now and I intend to agressively require latest/later vim/neovim
versions.
2020-03-26 23:25:50 +00:00
Ben Jackson
c1283a292c When creating a terminal window in neovim, use a new buffer
neovim's termopen() replaces the buffer object in the current window
with a terminal, internally, this completely breaks the buffer list.

Repro:
* Create test.vim:

```
vsplit
call termopen( '/bin/bash', { 'cwd': getcwd() } )
call bufload( expand( '<sfile>' ) )
```

Then:
* `nvim -Nu NONE test.vim`
* `:source %`

Error is "Invald buffer name 'test.vim'"

Anyway, the correct thing to do is to create a _new_ buffer before
making it into a terminal (vnew, new) rather than a split of the current
one. This was only working before because the CodeView window never had
any buffer in it and was broken by the change to use the current buffer
when staring debugging.

Fixes #131
2020-03-09 20:52:34 +00:00
Ben Jackson
0aba8e0179 Work around neovim bug where environ() crashes 2020-02-16 20:15:41 +00:00
Ben Jackson
37fefafe35 Fix tracebacks when the debug adapter dies very quickly 2020-02-16 20:15:41 +00:00
Ben Jackson
896b20f490 Hackaround for missing 'env' in termopen and jobstart in neovim 2020-02-02 17:37:53 +00:00
Ben Jackson
ab56d2cef4 Import the vim module
In Vim, the vim module is always imported by magic in the global scope,
but the docs suggest that you're supposed to import it anyway.

In NeoVim it's never imported so we were relying on some other plugins
having already imported it.
2020-01-28 20:52:33 +00:00