Skip to content

Commit e5fd613

Browse files
authored
Merge pull request #505 from puremourning/delve-output
Make output visible for delve
2 parents 9e833b2 + 3831a94 commit e5fd613

File tree

22 files changed

+406
-198
lines changed

22 files changed

+406
-198
lines changed

Makefile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
.PHONY: check vim-docs schema-docs docs
2+
3+
check:
4+
@echo "Running flake8..."
5+
flake8 python3/ *.py
6+
@echo "Running vint..."
7+
vint autoload/ compiler/ plugin/ tests/ syntax/
8+
9+
vim-docs: README.md
10+
$(CURDIR)/update-vim-docs
11+
12+
schema-docs: docs/*.md docs/schema/*.json
13+
$(CURDIR)/update-schema-docs
14+
15+
docs: vim-docs schema-docs

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1512,6 +1512,9 @@ Use Variables to configure the following:
15121512

15131513
* `dlvFlags`: (string) additional command line arguments to pass to delve
15141514

1515+
The debugger (delve) is launched in a terminal window so that you can see its
1516+
output and pass input to the debuggee.
1517+
15151518
See [vscode-go docs](https://github.com/golang/vscode-go/blob/master/docs/debugging.md#launchjson-attributes) for full launch options.
15161519
Yes, it seems that's the only place they are documented (apparently, they are
15171520
not documented by delve itself).

autoload/vimspector/internal/balloon.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ function! s:MatchKey( key, candidates ) abort
137137
" is a single key (anyway), and so we assume any string starting with < is a
138138
" special key (which will be the common case) and try and map it. If it
139139
" fails... it fails.
140-
if candidate[ 0 ] == '<'
140+
if candidate[ 0 ] ==# '<'
141141
try
142142
execute 'let candidate = "\' . candidate . '"'
143143
endtry

autoload/vimspector/internal/channel.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function! vimspector#internal#channel#StartDebugSession( config ) abort
4949

5050
" If we _also_ have a command line, then start the actual job. This allows for
5151
" servers which start up and listen on some port
52-
if has_key( a:config, 'command' )
52+
if has_key( a:config, 'command' ) && !get( a:config, 'tty', 0 )
5353
let s:job = job_start( a:config[ 'command' ],
5454
\ {
5555
\ 'in_mode': 'raw',

autoload/vimspector/internal/neochannel.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function! vimspector#internal#neochannel#StartDebugSession( config ) abort
4949

5050
" If we _also_ have a command line, then start the actual job. This allows for
5151
" servers which start up and listen on some port
52-
if has_key( a:config, 'command' )
52+
if has_key( a:config, 'command' ) && !get( a:config, 'tty', 0 )
5353
let old_env={}
5454
try
5555
let old_env = vimspector#internal#neoterm#PrepareEnvironment(

autoload/vimspector/internal/neopopup.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ function! vimspector#internal#neopopup#Confirm( confirm_id,
107107
" in popup.vim), i.e.:
108108
" - 1-based index of selected item, or
109109
" - -1 or 0 for cancellation
110-
if result == ''
110+
if result ==# ''
111111
" User pressed ESC/ctrl-c
112112
let result = -1
113113
else

doc/vimspector.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1782,6 +1782,9 @@ Use Variables to configure the following:
17821782

17831783
- 'dlvFlags': (string) additional command line arguments to pass to delve
17841784

1785+
The debugger (delve) is launched in a terminal window so that you can see its
1786+
output and pass input to the debuggee.
1787+
17851788
See vscode-go docs [38] for full launch options. Yes, it seems that's the only
17861789
place they are documented (apparently, they are not documented by delve
17871790
itself).

docs/schema-doc/gadgets.schema.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

docs/schema-doc/vimspector.schema.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

docs/schema/vimspector.schema.json

Lines changed: 109 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -173,54 +173,56 @@
173173
}
174174
},
175175
"adapter": {
176-
"oneOf": [
176+
"allOf": [
177+
{ "type": "object" },
178+
{ "$ref": "#/definitions/variables" },
177179
{
178-
"allOf": [
179-
{ "type": "object" },
180-
{ "$ref": "#/definitions/variables" },
181-
{
182-
"properties": {
183-
"name": {
184-
"type": "string",
185-
"description": "Passed to the adapter in the initialization request. Some adapters are particularly picky about what value goes here. Usually it can be omitted and Vimspector will send a generic value"
186-
},
187-
"configuration": {
188-
"type": "object",
189-
"description": "Base debug configuration. Can be used to set default values for all debug configurations. When reading individual debug configurations from 'configurations', those configurations are merged with this object. Definitions in the debug configuration override anything in this object. Typical usage for this is to set the 'type' parameter, which some debug adapters are very picky about, or to set e.g. the path to an underlying debugger."
190-
}
191-
}
192-
},
193-
{ "$ref": "#/definitions/adapter-launchattach" },
194-
{
195-
"anyOf": [
196-
{ "required": [ "command" ] },
197-
{ "required": [ "port" ] },
198-
{ "required": [ "command", "port" ] }
199-
]
180+
"properties": {
181+
"name": {
182+
"type": "string",
183+
"description": "Passed to the adapter in the initialization request. Some adapters are particularly picky about what value goes here. Usually it can be omitted and Vimspector will send a generic value"
200184
},
185+
"configuration": {
186+
"type": "object",
187+
"description": "Base debug configuration. Can be used to set default values for all debug configurations. When reading individual debug configurations from 'configurations', those configurations are merged with this object. Definitions in the debug configuration override anything in this object. Typical usage for this is to set the 'type' parameter, which some debug adapters are very picky about, or to set e.g. the path to an underlying debugger."
188+
}
189+
}
190+
},
191+
{ "$ref": "#/definitions/adapter-launchattach" },
192+
{
193+
"anyOf": [
194+
{ "required": [ "command" ] },
195+
{ "required": [ "port" ] },
201196
{
197+
"required": [ "command", "port" ],
202198
"properties": {
203-
"host": {
204-
"type": "string",
205-
"default": "127.0.0.1",
206-
"description": "Connect to this host in multi-session mode"
207-
},
208-
"port": {
209-
"oneOf": [
210-
{ "type": "string" },
211-
{ "type": "integer" }
212-
],
213-
"description": "If supplied, indicates that a socket connection should be made to this port on 'host'. If the value is 'ask', then the user is asked to enter the port number to connect to."
199+
"tty": {
200+
"type": "boolean",
201+
"description": "Set to True to launch 'command' in a terminal. Only valid when both 'command' and 'port' are supplied."
214202
}
215203
}
216-
}
204+
},
205+
{ "required": [ "extends" ] }
217206
]
218207
},
219208
{
220-
"type": "object",
221-
"required": [ "extends" ],
222209
"properties": {
223-
"extends": { "type": "string" }
210+
"host": {
211+
"type": "string",
212+
"default": "127.0.0.1",
213+
"description": "Connect to this host in multi-session mode"
214+
},
215+
"port": {
216+
"oneOf": [
217+
{ "type": "string" },
218+
{ "type": "integer" }
219+
],
220+
"description": "If supplied, indicates that a socket connection should be made to this port on 'host'. If the value is 'ask', then the user is asked to enter the port number to connect to."
221+
},
222+
"extends": {
223+
"type": "string",
224+
"description": "Name of another adapter from which to inherit all properties"
225+
}
224226
}
225227
}
226228
]
@@ -236,89 +238,86 @@
236238
"configurations": {
237239
"type": "object",
238240
"additionalProperties": {
239-
"oneOf": [
241+
"allOf": [
242+
{ "$ref": "#/definitions/variables" },
243+
{
244+
"oneOf": [
245+
{ "required": [ "adapter", "configuration" ] },
246+
{ "required": [ "extends" ] }
247+
]
248+
},
240249
{
241-
"allOf": [
242-
{ "$ref": "#/definitions/variables" },
243-
{
250+
"type": "object",
251+
"properties": {
252+
"adapter": {
253+
"description": "Adapter configuration to use for this debug session",
254+
"oneOf": [
255+
{ "$ref": "#/definitions/adapter" },
256+
{
257+
"type": "string",
258+
"description": "Name of an adapter in the 'adapters' mapping"
259+
}
260+
]
261+
},
262+
"extends": {
263+
"type": "string",
264+
"description": "Name of another configuration to inherit properties from."
265+
},
266+
"remote-request": {
267+
"enum": [ "launch", "attach" ],
268+
"description": "When the 'remote' block is defined in the adapter configuration, this can be used to override the actual action taken (remotely). Usually the actual 'configuration' will contain 'request' of 'attach', but in order to remotely 'launch' the process (e.g. under gdbserver or equivalent), use remote-attach set to 'launch'"
269+
},
270+
"remote-cmdLine": {
271+
"type": [ "string", "array" ],
272+
"description": "Defines the value of the special token %CMD% in remote-launch 'runCommand(s)'. The value is inserted into the command line where an entry matching '%CMD%' is found in 'runCommand(s)' command array."
273+
},
274+
"default": {
275+
"type": "boolean",
276+
"description": "When true, this configuration is picked by default"
277+
},
278+
"autoselect": {
279+
"type": "boolean",
280+
"description": "When false, this configuration is _never_ picked by default"
281+
},
282+
"filetypes": {
283+
"type": "array",
284+
"description": "List of Vim filetypes that this configuration applies to. The configuraiton is only used if one of the current filetypes appears in this list, or if this list is not supplied,"
285+
},
286+
"configuration": {
244287
"type": "object",
288+
"required": [ "request" ],
245289
"properties": {
246-
"adapter": {
247-
"description": "Adapter configuration to use for this debug session",
248-
"oneOf": [
249-
{ "$ref": "#/definitions/adapter" },
250-
{
251-
"type": "string",
252-
"description": "Name of an adapter in the 'adapters' mapping"
253-
}
254-
]
255-
},
256-
"remote-request": {
290+
"request": {
257291
"enum": [ "launch", "attach" ],
258-
"description": "When the 'remote' block is defined in the adapter configuration, this can be used to override the actual action taken (remotely). Usually the actual 'configuration' will contain 'request' of 'attach', but in order to remotely 'launch' the process (e.g. under gdbserver or equivalent), use remote-attach set to 'launch'"
259-
},
260-
"remote-cmdLine": {
261-
"type": [ "string", "array" ],
262-
"description": "Defines the value of the special token %CMD% in remote-launch 'runCommand(s)'. The value is inserted into the command line where an entry matching '%CMD%' is found in 'runCommand(s)' command array."
263-
},
264-
"default": {
265-
"type": "boolean",
266-
"description": "When true, this configuration is picked by default"
267-
},
268-
"autoselect": {
269-
"type": "boolean",
270-
"description": "When false, this configuration is _never_ picked by default"
271-
},
272-
"filetypes": {
273-
"type": "array",
274-
"description": "List of Vim filetypes that this configuration applies to. The configuraiton is only used if one of the current filetypes appears in this list, or if this list is not supplied,"
275-
},
276-
"configuration": {
292+
"description": "Type of session - launch process or attach to process"
293+
}
294+
},
295+
"additionalProperties": {
296+
"description": "Additional properties are passed to the debug adapter in the 'launch' or 'attach' request and are specific to the debug adapter."
297+
}
298+
},
299+
"breakpoints": {
300+
"type": "object",
301+
"properties": {
302+
"exception": {
277303
"type": "object",
278-
"required": [ "request" ],
279-
"properties": {
280-
"request": {
281-
"enum": [ "launch", "attach" ],
282-
"description": "Type of session - launch process or attach to process"
283-
}
284-
},
304+
"description": "Exception breakpoints configuration, mapping the server's exception filter to enabled/disable/default flag",
285305
"additionalProperties": {
286-
"description": "Additional properties are passed to the debug adapter in the 'launch' or 'attach' request and are specific to the debug adapter."
287-
}
288-
},
289-
"breakpoints": {
290-
"type": "object",
291-
"properties": {
292-
"exception": {
293-
"type": "object",
294-
"description": "Exception breakpoints configuration, mapping the server's exception filter to enabled/disable/default flag",
295-
"additionalProperties": {
296-
"oneOf": [
297-
{
298-
"type": "boolean",
299-
"description": "true = enable, false = disable"
300-
},
301-
{
302-
"type": "string",
303-
"enum": [ "Y", "N", "" ],
304-
"description": "Y = enable, N = disable, '' = default"
305-
}
306-
]
306+
"oneOf": [
307+
{
308+
"type": "boolean",
309+
"description": "true = enable, false = disable"
310+
},
311+
{
312+
"type": "string",
313+
"enum": [ "Y", "N", "" ],
314+
"description": "Y = enable, N = disable, '' = default"
307315
}
308-
}
316+
]
309317
}
310318
}
311319
}
312320
}
313-
]
314-
},
315-
{
316-
"type": "object",
317-
"required": [ "extends" ],
318-
"properties": {
319-
"extends": {
320-
"type": "string"
321-
}
322321
}
323322
}
324323
]

0 commit comments

Comments
 (0)