Commit graph

68 commits

Author SHA1 Message Date
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
Ben Jackson
5ee8ffc3f6 Catch E325 in neovim 2020-01-19 20:16:52 +00:00
Ben Jackson
6cf4f9f9ab FixUp: Some comments 2020-01-19 20:07:18 +00:00
Ben Jackson
ef4a6fc10c FixUp: use normal! to avoid user mappings, thanks vint! 2020-01-19 10:28:34 +00:00
Ben Jackson
355f0f0e0c Implement command line completion for watch/eval 2020-01-17 00:02:24 +00:00
Ben Jackson
099ffc2af9 Disable swap files in the neovim buffers too 2020-01-15 23:17:15 +00:00
Ben Jackson
c2b0cc8f18 Attempt to make the output windows a little less rubbish on neovim 2020-01-15 23:17:15 +00:00
Ben Jackson
149d48b688 Scroll the output buffer when visible 2020-01-15 23:17:15 +00:00
Ben Jackson
c898eb47b2 Fix filtering VimspectorShowOutput 2020-01-15 23:17:15 +00:00
Ben Jackson
a00e6a19d6 Fix output buffers. bufnr creates an _unloaded_ buffer, so we have to load it 2020-01-15 23:17:15 +00:00
Ben Jackson
7456c26c2a Add some :commands for basic usages 2020-01-15 23:17:15 +00:00
Ben Jackson
04bb03da0a Add channel support for neovim 2020-01-15 23:17:15 +00:00
Ben Jackson
29c26996fb Add neovim job/terminal APIs 2020-01-15 23:17:15 +00:00
Ben Jackson
18627b9244 Add a way to have multiple vim API layers 2020-01-15 23:17:15 +00:00
Ben Jackson
5aa33c19f7 Remove unused ForceRead function 2020-01-15 23:17:15 +00:00
Ben Jackson
ee1bb009ea Wrap the terminal API in vimscript layer 2020-01-15 23:17:15 +00:00
Ben Jackson
dcdab63516 Remove use of bindeval() as it is not suported in neovim 2020-01-15 23:17:15 +00:00
tinmarino
1e153910fa Fix: Remove balloon '...' in windows != code_window
Problem: In non-code window, user see a '...' balloon even if python
knows it does not need to work
Solution: use pyeval in vim so that python's knowledge is getting back
from the stack as return value
2020-01-09 20:37:03 -03:00
Ben Jackson
82e351454d Wait for up to 10s to attach to socket 2019-10-13 18:39:54 +01:00
Ben Jackson
90ecd905d9 Fix shutdown sequence for channel-based servers 2019-10-01 22:25:48 +01:00
Ben Jackson
d458d06bc5 Use the same version as the current macvim 2019-06-08 10:49:26 +01:00
Ben Jackson
fc802b61bd Run flake8 and vint in azure 2019-05-09 00:24:06 +01:00
Ben Jackson
470c64603a Add ClearBreakpoints API
Add a test which actually triggers the mappings and fires up vimspector
with the cpptools debugger.
2019-04-28 10:51:15 +01:00
Ben Jackson
88bac786ba Merge branch 'breakpoints-list' into remote-bp 2019-03-30 10:13:26 +00:00
Ben Jackson
541686712c Use a list comprehension and try and catch some nasites 2019-02-26 15:24:07 +00:00
Ben Jackson
2d7c67968a Be more forceful when closing th ejob 2019-02-21 16:13:51 +00:00
Ben Jackson
75851e0652 Move the vimscript into vimscript; it's so much easier. Support multiple commands and jobs 2019-02-21 16:12:58 +00:00
Ben Jackson
3092c06cd7 Rudimentary support for listing breakpoints using the quickfix window 2019-02-12 22:41:10 +00:00
Ben Jackson
bb3909c16f Improve output view; use jobs to display logs and remote commands 2019-02-12 09:04:52 +00:00
Ben Jackson
e006b15100 More improvements to startup and closedown stability. Remove some hack code 2019-02-12 09:01:09 +00:00
Ben Jackson
1ca88ad332 WIP: Support remote startup commands, e.g. gdbserver 2019-02-02 15:49:41 +00:00
Ben Jackson
32e16d9daf WIP: Try and remember that the server quit 2019-02-02 15:49:22 +00:00
Ben Jackson
1905556edd Allow mappings to specify variables 2019-02-02 10:49:00 +00:00
Ben Jackson
f1859639d7 Alow env and cwd to be specified for the _adapter_ 2019-02-01 10:05:59 +00:00
Ben Jackson
e573c2fd9f Print server stderr to the GUI 2019-01-12 15:14:06 +00:00
Ben Jackson
ea1962e11b Use a short timeout for closedown 2018-12-20 16:54:55 +00:00
Ben Jackson
af338669f3 Add timeout for requests. 2018-12-20 15:10:24 +00:00
Ben Jackson
14603ae72f Support java debugging
The java architecture is a little different:

- the debugger is a jdt.ls extension bundle.
- to start the server, you send a startDebugSession command to jdt.ls
- this returns a tcl port to connect to for DAP

Loading of jdt.ls and the extension are out of scope for vimspector
currently and instead you can tell it to ask you for a port to connect
to.

After connexting to that port, vimspector works as normal.

To support TCP/IP was pretty simple: we provide the same API from
vimscript as the job-based (stdin/out) comms layer, but instead just
directly use a channel.

The only wrinkle was that the java debug adapter broke the protocol on
runInTerminal and didn't return a 'cwd', so we make one up.
2018-12-20 00:29:45 +00:00
Ben Jackson
b72bc7dfbf Use prompt buffer for Console
Like VSCode does, compbine console and stdout, and allow you to enter
commands in the console. It's all a bit janky right now and the
insertion point isn't ideal (as not all output is interactive) and some
output is asynchronous via a somewhat different channel.
2018-06-10 18:32:16 +01:00
Ben Jackson
920db068c6 Use a prompt buffer for adding watches
This very new feature makes it kind of nice to add new watches in the
place where they will appear, keeping the eye in the same screen
location.
2018-06-09 22:33:22 +01:00
Ben Jackson
88ac7f6d55 Marginally improve the hover text
Don't use the default padded display.
When the request fails, say why.
Include the type if known.
2018-06-03 21:43:45 +01:00
Ben Jackson
bd4fa964b0 Only add the log handler once 2018-06-01 19:54:27 +01:00
Ben Jackson
46cdedc648 Trivial support for function breakpoints
You can't see them and you can't disable/cancel them.
2018-05-28 19:36:50 +01:00
Ben Jackson
f9ecf5f05d Move the output window to its own space
And separate all the different channels into their own buffers. Use the
WinBar to select between them.
2018-05-28 15:14:41 +01:00
Ben Jackson
eb11712cc1 Make sure to close down cleanly
This involves some horrible forceful reading on exit to ensure that we
get a response to the disconnect request. This ensures that any debugee
is killed cleanly.
2018-05-28 13:49:40 +01:00