Commit graph

52 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
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
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
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
05bbafd60c Close the intaller output when complete 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
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
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
355f0f0e0c Implement command line completion for watch/eval 2020-01-17 00:02:24 +00:00
Ben Jackson
c898eb47b2 Fix filtering VimspectorShowOutput 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
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
3092c06cd7 Rudimentary support for listing breakpoints using the quickfix window 2019-02-12 22:41:10 +00:00
Ben Jackson
1905556edd Allow mappings to specify variables 2019-02-02 10:49:00 +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
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
5ed9a06ed5 Move the thread handling into the stack frame handling
This shows stack traces as children of a thread, removing one of the
UI splits. However, we still have the somewhat awkward concepts of
"current" thread and "current" stack frame. These are messy and
incredibly fiddly. And in any case, probably wrong _most_ of the time.
2018-05-28 02:34:05 +01:00
Ben Jackson
7600e1e652 Add a reset command to undo all the UI and reset everything 2018-05-27 21:40:31 +01:00
Ben Jackson
3f73d1c2f8 Allow deleting watches and improve expansion
Now scopes and watch results can be expanded/collapsed. Locals still
default to being expanded, but watches do not.
2018-05-27 18:19:07 +01:00
Ben Jackson
533b2aa0d5 Very basic support for watch expressions
You can currently only add them, not remoove them and you have to pass
the expression in the function call, but once added the variable
breakdown works nicely.
2018-05-27 16:59:06 +01:00
Ben Jackson
dbef05b9a5 support restarting via calling Launch again (todo: restart button doesn't work) 2018-05-27 00:04:56 +01:00
Ben Jackson
c9a45b3bdc First attempt to make breakpoints work. Doesn't. Python at least responds with the breakpoints. MS CPP does not, and native debug just throws an error 2018-05-22 23:59:15 +01:00
Ben Jackson
269d09b73e Very basic support for launch configuration
This change refactors the way we launch the job and puts it all in an
internal namespace. Having done that, we are able to launch the job from
the python side. This allows us to neatly load a json file, simlar in
format to .vscode's launch.json, but sufficiently different that users
won't just expect the launch.json to work.

This change allows selecting between 2 different adapters to debug the
same c program.
2018-05-21 23:44:06 +01:00
Ben Jackson
fa627712e2 Support jumping up/down the stack
Split out stack trace view into its own thing. Support jumping to code
location.
2018-05-20 21:38:11 +01:00
Ben Jackson
0650b5a514 Refactor: Split VariablesView into own file
This also moves all handling of message dispatch to the connection
object. That seems fine and the requirements of a "handler" are:

- implement OnEvent_<event> for any unsolicited events

Otherwise, requests are handled still by callbacks.
2018-05-20 20:50:48 +01:00
Ben Jackson
a535d65b26 Hierarchical variables and scopes
Maintain the variables in a simple tree and allow the user to
expand/collapse in the dumbest way possible. This means we don't
recursively consume all of the possible variable scopes.
2018-05-20 19:07:44 +01:00
Ben Jackson
a5c773932e Add Pause command 2018-05-20 18:09:19 +01:00
Ben Jackson
f55dc8cd8e StepOut and Continue 2018-05-20 16:18:40 +01:00