Compare commits
31 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7c12519b9d | ||
|
|
2bb8561eb6 |
||
|
|
a868102b5e |
||
|
|
dc862fe565 | ||
|
|
b4bcfca932 |
||
|
|
3df0602a69 |
||
|
|
1c2dda4a6a |
||
|
|
db5ed8e802 | ||
|
|
17ca1522f8 | ||
|
|
561a5b9aa2 | ||
|
|
46cfdc678d | ||
|
|
51d78fce5f |
||
|
|
14f34ea6d1 |
||
|
|
a720d0e1d5 | ||
|
|
7c7e3f9c3f | ||
|
|
57ce099280 | ||
|
|
27eb464b8e |
||
|
|
f1e2c12e5b | ||
|
|
26cd7c5c7e |
||
|
|
59c9cd10ab | ||
|
|
9c806d2a01 |
||
|
|
3af97f1928 |
||
|
|
da39c4955c |
||
|
|
21ebb22fd4 | ||
|
|
aa0cddc0da |
||
|
|
5075f3a11a | ||
|
|
bab81953d7 |
||
|
|
0500e41429 |
||
|
|
1cbb400d42 |
||
|
|
5ea1f0d9d4 | ||
|
|
a51b8b23c9 |
21 changed files with 246 additions and 34 deletions
8
.github/workflows/build.yaml
vendored
8
.github/workflows/build.yaml
vendored
|
|
@ -13,7 +13,7 @@ defaults:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
PythonLint:
|
PythonLint:
|
||||||
runs-on: ubuntu-16.04
|
runs-on: ubuntu-18.04
|
||||||
container: 'puremourning/vimspector:test'
|
container: 'puremourning/vimspector:test'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
@ -22,7 +22,7 @@ jobs:
|
||||||
- name: 'Run flake8'
|
- name: 'Run flake8'
|
||||||
run: '$HOME/.local/bin/flake8 python3/ *.py'
|
run: '$HOME/.local/bin/flake8 python3/ *.py'
|
||||||
VimscriptLint:
|
VimscriptLint:
|
||||||
runs-on: 'ubuntu-16.04'
|
runs-on: 'ubuntu-18.04'
|
||||||
container: 'puremourning/vimspector:test'
|
container: 'puremourning/vimspector:test'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
@ -32,7 +32,7 @@ jobs:
|
||||||
run: $HOME/.local/bin/vint autoload/ compiler/ plugin/ tests/ syntax/
|
run: $HOME/.local/bin/vint autoload/ compiler/ plugin/ tests/ syntax/
|
||||||
|
|
||||||
Linux:
|
Linux:
|
||||||
runs-on: 'ubuntu-16.04'
|
runs-on: 'ubuntu-18.04'
|
||||||
container:
|
container:
|
||||||
image: 'puremourning/vimspector:test'
|
image: 'puremourning/vimspector:test'
|
||||||
options: --cap-add=SYS_PTRACE --security-opt seccomp=unconfined
|
options: --cap-add=SYS_PTRACE --security-opt seccomp=unconfined
|
||||||
|
|
@ -156,7 +156,7 @@ jobs:
|
||||||
# SSH_PASS: ${{ secrets.SSH_PASS }} # [V]imspector
|
# SSH_PASS: ${{ secrets.SSH_PASS }} # [V]imspector
|
||||||
|
|
||||||
PublishRelease:
|
PublishRelease:
|
||||||
runs-on: 'ubuntu-16.04'
|
runs-on: 'ubuntu-18.04'
|
||||||
needs:
|
needs:
|
||||||
- Linux
|
- Linux
|
||||||
- MacOS
|
- MacOS
|
||||||
|
|
|
||||||
45
README.md
45
README.md
|
|
@ -61,9 +61,10 @@ For detailed explanation of the `.vimspector.json` format, see the
|
||||||
* [Closing debugger](#closing-debugger)
|
* [Closing debugger](#closing-debugger)
|
||||||
* [Terminate debuggee](#terminate-debuggee)
|
* [Terminate debuggee](#terminate-debuggee)
|
||||||
* [Debug profile configuration](#debug-profile-configuration)
|
* [Debug profile configuration](#debug-profile-configuration)
|
||||||
* [C, C , Rust, etc.](#c-c-rust-etc)
|
* [C, C++, Rust, etc.](#c-c-rust-etc)
|
||||||
* [C Remote debugging](#c-remote-debugging)
|
* [Data visualization / pretty printing](#data-visualization--pretty-printing)
|
||||||
* [C Remote launch and attach](#c-remote-launch-and-attach)
|
* [C++ Remote debugging](#c-remote-debugging)
|
||||||
|
* [C++ Remote launch and attach](#c-remote-launch-and-attach)
|
||||||
* [Rust](#rust)
|
* [Rust](#rust)
|
||||||
* [Python](#python)
|
* [Python](#python)
|
||||||
* [Python Remote Debugging](#python-remote-debugging)
|
* [Python Remote Debugging](#python-remote-debugging)
|
||||||
|
|
@ -290,7 +291,7 @@ If you just want to try out vimspector without changing your vim config, there
|
||||||
are example projects for a number of languages in `support/test`, including:
|
are example projects for a number of languages in `support/test`, including:
|
||||||
|
|
||||||
* Python (`support/test/python/simple_python`)
|
* Python (`support/test/python/simple_python`)
|
||||||
* Go (`support/test/go/hello_world`)
|
* Go (`support/test/go/hello_world` and `support/test/go/name-starts-with-vowel`)
|
||||||
* Nodejs (`support/test/node/simple`)
|
* Nodejs (`support/test/node/simple`)
|
||||||
* Chrome (`support/test/chrome/`)
|
* Chrome (`support/test/chrome/`)
|
||||||
* etc.
|
* etc.
|
||||||
|
|
@ -1176,6 +1177,38 @@ licensing.
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Data visualization / pretty printing
|
||||||
|
|
||||||
|
Depending on the backend you need to enable pretty printing of complex types manually.
|
||||||
|
|
||||||
|
* LLDB: Pretty printing is enabled by default
|
||||||
|
|
||||||
|
* GDB: To enable gdb pretty printers, consider the snippet below.
|
||||||
|
It is not enough to have `set print pretty on` in your .gdbinit!
|
||||||
|
|
||||||
|
```
|
||||||
|
{
|
||||||
|
"configurations": {
|
||||||
|
"Launch": {
|
||||||
|
"adapter": "vscode-cpptools",
|
||||||
|
"configuration": {
|
||||||
|
"request": "launch",
|
||||||
|
"program": "<path to binary>",
|
||||||
|
...
|
||||||
|
"MIMode": "gdb"
|
||||||
|
"setupCommands": [
|
||||||
|
{
|
||||||
|
"description": "Enable pretty-printing for gdb",
|
||||||
|
"text": "-enable-pretty-printing",
|
||||||
|
"ignoreFailures": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
### C++ Remote debugging
|
### C++ Remote debugging
|
||||||
|
|
||||||
The cpptools documentation describes how to attach cpptools to gdbserver using
|
The cpptools documentation describes how to attach cpptools to gdbserver using
|
||||||
|
|
@ -1368,6 +1401,8 @@ Requires:
|
||||||
* [Delve][delve-install] installed, e.g. `go get -u github.com/go-delve/delve/cmd/dlv`
|
* [Delve][delve-install] installed, e.g. `go get -u github.com/go-delve/delve/cmd/dlv`
|
||||||
* Delve to be in your PATH, or specify the `dlvToolPath` launch option
|
* Delve to be in your PATH, or specify the `dlvToolPath` launch option
|
||||||
|
|
||||||
|
NOTE: Vimspector uses the ["legacy" vscode-go debug adapter](https://github.com/golang/vscode-go/blob/master/docs/debugging-legacy.md) rather than the "built-in" DAP support in Delve. You can track https://github.com/puremourning/vimspector/issues/186 for that.
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"configurations": {
|
"configurations": {
|
||||||
|
|
@ -1385,7 +1420,7 @@ Requires:
|
||||||
```
|
```
|
||||||
|
|
||||||
See the vscode-go docs for
|
See the vscode-go docs for
|
||||||
[troubleshooting information](https://github.com/golang/vscode-go/blob/master/docs/debugging.md#troubleshooting)
|
[troubleshooting information](https://github.com/golang/vscode-go/blob/master/docs/debugging-legacy.md#troubleshooting)
|
||||||
|
|
||||||
## PHP
|
## PHP
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ GEM
|
||||||
minitest (~> 5.1)
|
minitest (~> 5.1)
|
||||||
tzinfo (~> 1.1)
|
tzinfo (~> 1.1)
|
||||||
zeitwerk (~> 2.2, >= 2.2.2)
|
zeitwerk (~> 2.2, >= 2.2.2)
|
||||||
addressable (2.7.0)
|
addressable (2.8.0)
|
||||||
public_suffix (>= 2.0.2, < 5.0)
|
public_suffix (>= 2.0.2, < 5.0)
|
||||||
coffee-script (2.4.1)
|
coffee-script (2.4.1)
|
||||||
coffee-script-source
|
coffee-script-source
|
||||||
|
|
|
||||||
|
|
@ -722,7 +722,7 @@ Vimspector then orchestrates the various tools to set you up.
|
||||||
"variables": {
|
"variables": {
|
||||||
// Just an example of how to specify a variable manually rather than
|
// Just an example of how to specify a variable manually rather than
|
||||||
// vimspector asking for input from the user
|
// vimspector asking for input from the user
|
||||||
"ServiceName": "${fileBasenameNoExtention}"
|
"ServiceName": "${fileBasenameNoExtension}"
|
||||||
},
|
},
|
||||||
|
|
||||||
"adapter": "python-remote",
|
"adapter": "python-remote",
|
||||||
|
|
|
||||||
|
|
@ -30,12 +30,12 @@ GADGETS = {
|
||||||
root,
|
root,
|
||||||
gadget ),
|
gadget ),
|
||||||
'all': {
|
'all': {
|
||||||
'version': '0.27.0',
|
'version': '1.6.0',
|
||||||
"adapters": {
|
"adapters": {
|
||||||
"vscode-cpptools": {
|
"vscode-cpptools": {
|
||||||
"name": "cppdbg",
|
"name": "cppdbg",
|
||||||
"command": [
|
"command": [
|
||||||
"${gadgetDir}/vscode-cpptools/debugAdapters/OpenDebugAD7"
|
"${gadgetDir}/vscode-cpptools/debugAdapters/bin/OpenDebugAD7"
|
||||||
],
|
],
|
||||||
"attach": {
|
"attach": {
|
||||||
"pidProperty": "processId",
|
"pidProperty": "processId",
|
||||||
|
|
@ -53,17 +53,17 @@ GADGETS = {
|
||||||
'linux': {
|
'linux': {
|
||||||
'file_name': 'cpptools-linux.vsix',
|
'file_name': 'cpptools-linux.vsix',
|
||||||
'checksum':
|
'checksum':
|
||||||
'3695202e1e75a03de18049323b66d868165123f26151f8c974a480eaf0205435',
|
'c25299bcfb46b22d41aa3f125df7184e6282a35ff9fb69c47def744cb4778f55',
|
||||||
},
|
},
|
||||||
'macos': {
|
'macos': {
|
||||||
'file_name': 'cpptools-osx.vsix',
|
'file_name': 'cpptools-osx-arm64.vsix',
|
||||||
'checksum':
|
'checksum':
|
||||||
'cb061e3acd7559a539e5586f8d3f535101c4ec4e8a48195856d1d39380b5cf3c',
|
'ceb3e8cdaa2b5bb45af50913ddd8402089969748af8d70f5d46480408287ba6f',
|
||||||
},
|
},
|
||||||
'windows': {
|
'windows': {
|
||||||
'file_name': 'cpptools-win32.vsix',
|
'file_name': 'cpptools-win32.vsix',
|
||||||
'checksum':
|
'checksum':
|
||||||
'aa294368ed16d48c59e49c8000e146eae5a19ad07b654efed5db8ec93b24229e',
|
'ef7ac5831874a3c7dbf0feb826bfda2be579aff9b6d990622fff1d0d4ede00d1',
|
||||||
"adapters": {
|
"adapters": {
|
||||||
"vscode-cpptools": {
|
"vscode-cpptools": {
|
||||||
"name": "cppdbg",
|
"name": "cppdbg",
|
||||||
|
|
@ -323,10 +323,10 @@ GADGETS = {
|
||||||
'${version}/${file_name}',
|
'${version}/${file_name}',
|
||||||
},
|
},
|
||||||
'all': {
|
'all': {
|
||||||
'version': 'v1.15.1',
|
'version': 'v1.17.0',
|
||||||
'file_name': 'php-debug-1.15.1.vsix',
|
'file_name': 'php-debug-1.17.0.vsix',
|
||||||
'checksum':
|
'checksum':
|
||||||
'10222655d4179c7d109b1f951d88034eba772b45bf6141dcdb4e9b4477d2e2ab',
|
'd0fff272503414b6696cc737bc2e18e060fdd5e5dc4bcaf38ae7373afd8d8bc9',
|
||||||
},
|
},
|
||||||
'adapters': {
|
'adapters': {
|
||||||
'vscode-php-debug': {
|
'vscode-php-debug': {
|
||||||
|
|
@ -394,12 +394,12 @@ GADGETS = {
|
||||||
'${version}/${file_name}',
|
'${version}/${file_name}',
|
||||||
},
|
},
|
||||||
'all': {
|
'all': {
|
||||||
'version': 'v1.6.1',
|
'version': 'v1.6.6',
|
||||||
},
|
},
|
||||||
'macos': {
|
'macos': {
|
||||||
'file_name': 'codelldb-x86_64-darwin.vsix',
|
'file_name': 'codelldb-aarch64-darwin.vsix',
|
||||||
'checksum':
|
'checksum':
|
||||||
'b1c998e7421beea9f3ba21aa5706210bb2249eba93c99b809247ee831075262f',
|
'5adc3b9139eabdafd825bd5efc55df4424a203fb2b6087b425cd434956e7ec58',
|
||||||
'make_executable': [
|
'make_executable': [
|
||||||
'adapter/codelldb',
|
'adapter/codelldb',
|
||||||
'lldb/bin/debugserver',
|
'lldb/bin/debugserver',
|
||||||
|
|
@ -410,7 +410,7 @@ GADGETS = {
|
||||||
'linux': {
|
'linux': {
|
||||||
'file_name': 'codelldb-x86_64-linux.vsix',
|
'file_name': 'codelldb-x86_64-linux.vsix',
|
||||||
'checksum':
|
'checksum':
|
||||||
'f2a36cb6971fd95a467cf1a7620e160914e8f11bf82929932ee0aa5afbf6ae6a',
|
'eda2cd9b3089dcc0524c273e91ffb5875fe08c930bf643739a2cd1846e1f98d6',
|
||||||
'make_executable': [
|
'make_executable': [
|
||||||
'adapter/codelldb',
|
'adapter/codelldb',
|
||||||
'lldb/bin/lldb',
|
'lldb/bin/lldb',
|
||||||
|
|
@ -421,7 +421,7 @@ GADGETS = {
|
||||||
'windows': {
|
'windows': {
|
||||||
'file_name': 'codelldb-x86_64-windows.vsix',
|
'file_name': 'codelldb-x86_64-windows.vsix',
|
||||||
'checksum':
|
'checksum':
|
||||||
'ca6a6525bf7719dc95265dc630b3cc817a8c0393b756fd242b710805ffdfb940',
|
'8ddebe8381a3d22dc3d95139c3797fda06b5cc34aadf300e13b1c516b9da95fe',
|
||||||
'make_executable': []
|
'make_executable': []
|
||||||
},
|
},
|
||||||
'adapters': {
|
'adapters': {
|
||||||
|
|
|
||||||
|
|
@ -358,7 +358,8 @@ def InstallCppTools( name, root, gadget ):
|
||||||
# It's hilarious, but the execute bits aren't set in the vsix. So they
|
# It's hilarious, but the execute bits aren't set in the vsix. So they
|
||||||
# actually have javascript code which does this. It's just a horrible horrible
|
# actually have javascript code which does this. It's just a horrible horrible
|
||||||
# hack that really is not funny.
|
# hack that really is not funny.
|
||||||
MakeExecutable( os.path.join( extension, 'debugAdapters', 'OpenDebugAD7' ) )
|
MakeExecutable(
|
||||||
|
os.path.join( extension, 'debugAdapters', 'bin', 'OpenDebugAD7' ) )
|
||||||
with open( os.path.join( extension, 'package.json' ) ) as f:
|
with open( os.path.join( extension, 'package.json' ) ) as f:
|
||||||
package = json.load( f )
|
package = json.load( f )
|
||||||
runtime_dependencies = package[ 'runtimeDependencies' ]
|
runtime_dependencies = package[ 'runtimeDependencies' ]
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ class TabBuffer( object ):
|
||||||
BUFFER_MAP = {
|
BUFFER_MAP = {
|
||||||
'console': 'Console',
|
'console': 'Console',
|
||||||
'stdout': 'Console',
|
'stdout': 'Console',
|
||||||
|
'output': 'Console',
|
||||||
'stderr': 'stderr',
|
'stderr': 'stderr',
|
||||||
'telemetry': None,
|
'telemetry': None,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -560,7 +560,8 @@ class StackTraceView( object ):
|
||||||
source[ 'name' ],
|
source[ 'name' ],
|
||||||
frame[ 'line' ] ) )
|
frame[ 'line' ] ) )
|
||||||
|
|
||||||
if self._current_frame[ 'id' ] == frame[ 'id' ]:
|
if ( self._current_frame is not None and
|
||||||
|
self._current_frame[ 'id' ] == frame[ 'id' ] ):
|
||||||
signs.PlaceSign( self._current_frame_sign_id,
|
signs.PlaceSign( self._current_frame_sign_id,
|
||||||
'VimspectorStackTrace',
|
'VimspectorStackTrace',
|
||||||
'vimspectorCurrentFrame',
|
'vimspectorCurrentFrame',
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ out_fd=1
|
||||||
|
|
||||||
while [ -n "$1" ]; do
|
while [ -n "$1" ]; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
"--basedir")
|
"--basedir"|"--base-dir"|"--test-base")
|
||||||
shift
|
shift
|
||||||
SetBaseDir $1
|
SetBaseDir $1
|
||||||
shift
|
shift
|
||||||
|
|
@ -36,7 +36,7 @@ while [ -n "$1" ]; do
|
||||||
INSTALL=$1
|
INSTALL=$1
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
"--update")
|
"--update"|"--upgrade")
|
||||||
UPDATE=1
|
UPDATE=1
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ function s:SetUpTerminal()
|
||||||
let padding = 4
|
let padding = 4
|
||||||
let cols = max( [ min( [ &columns - left_bar - code - padding, 80 ] ), 10 ] )
|
let cols = max( [ min( [ &columns - left_bar - code - padding, 80 ] ), 10 ] )
|
||||||
call win_gotoid( terminal_win )
|
call win_gotoid( terminal_win )
|
||||||
execute cols . 'wincmd |'
|
execute string(cols) . 'wincmd |'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:CustomiseWinBar()
|
function! s:CustomiseWinBar()
|
||||||
|
|
|
||||||
8
support/gadget_upgrade/README.md
Normal file
8
support/gadget_upgrade/README.md
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
# Manually updating shipped gadgets
|
||||||
|
|
||||||
|
Download the gadget files manuall from their official source into this dir.
|
||||||
|
Run `./checksum.py <list of files>` to get the checksums.
|
||||||
|
|
||||||
|
Update ../../python3/vimspector/gadgets.py with the new version and the
|
||||||
|
checksums.
|
||||||
|
|
||||||
13
support/gadget_upgrade/checksum.py
Executable file
13
support/gadget_upgrade/checksum.py
Executable file
|
|
@ -0,0 +1,13 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
import hashlib
|
||||||
|
import sys
|
||||||
|
|
||||||
|
|
||||||
|
def GetChecksumSHA254( file_path ):
|
||||||
|
with open( file_path, 'rb' ) as existing_file:
|
||||||
|
return hashlib.sha256( existing_file.read() ).hexdigest()
|
||||||
|
|
||||||
|
|
||||||
|
for arg in sys.argv[ 1: ]:
|
||||||
|
print( f"{ arg } = { GetChecksumSHA254( arg ) }" )
|
||||||
15
support/test/bash/.vimspector.json
Normal file
15
support/test/bash/.vimspector.json
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
{
|
||||||
|
"$schema": "https://puremourning.github.io/vimspector/schema/vimspector.schema.json",
|
||||||
|
"configurations": {
|
||||||
|
"Run Current Script": {
|
||||||
|
"adapter": "vscode-bash",
|
||||||
|
"autoselect": false,
|
||||||
|
"configuration": {
|
||||||
|
"request": "launch",
|
||||||
|
"program": "${file}",
|
||||||
|
"cwd": "${fileDirname}",
|
||||||
|
"args": [ "*${args}" ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
29
support/test/go/name-starts-with-vowel/.vimspector.json
Normal file
29
support/test/go/name-starts-with-vowel/.vimspector.json
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
{
|
||||||
|
"configurations": {
|
||||||
|
"run-cmd": {
|
||||||
|
"adapter": "vscode-go",
|
||||||
|
"configuration": {
|
||||||
|
"request": "launch",
|
||||||
|
"program": "${workspaceRoot}/cmd/namestartswithvowel/main.go",
|
||||||
|
"mode": "debug",
|
||||||
|
"dlvToolPath": "$HOME/go/bin/dlv",
|
||||||
|
"dlvLoadConfig": {
|
||||||
|
"maxArrayValues": 1000,
|
||||||
|
"maxStringLen": 1000
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"test-current-file": {
|
||||||
|
"adapter": "vscode-go",
|
||||||
|
"configuration": {
|
||||||
|
"request": "launch",
|
||||||
|
"mode": "test",
|
||||||
|
"program": "${fileDirname}",
|
||||||
|
"cwd": "${fileDirname}",
|
||||||
|
"dlvToolPath": "$GOPATH/bin/dlv",
|
||||||
|
"env": {},
|
||||||
|
"args": []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
33
support/test/go/name-starts-with-vowel/README.md
Normal file
33
support/test/go/name-starts-with-vowel/README.md
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
# Purpose
|
||||||
|
|
||||||
|
This example comes with two example vimspector configs for the Go programming language.
|
||||||
|
|
||||||
|
1) `run-cmd` will launch the main programme under `cmd/namestartswithvowel`.
|
||||||
|
1) `test-current-file` will run the tests in the current file in debug mode.
|
||||||
|
|
||||||
|
## Example use-cases
|
||||||
|
|
||||||
|
### run-cmd
|
||||||
|
|
||||||
|
* Open `cmd/namestartswithvowel/main.go`
|
||||||
|
* Add a breakpoint somewhere within the programme
|
||||||
|
* Start the debugger (`:call vimspector#Continue()` or your relevant keymapping)
|
||||||
|
* Select the first launch configuration (`1: run-cmd`)
|
||||||
|
|
||||||
|
### test-current-file
|
||||||
|
|
||||||
|
* Open `internal/vowels/vowels_test.go`
|
||||||
|
* Add a breakpoint somewhere within the test
|
||||||
|
* Start the debugger (`:call vimspector#Continue()` or your relevant keymapping)
|
||||||
|
* Select the second launch configuration (`2: test-current-file`)
|
||||||
|
|
||||||
|
## Additional Configuration
|
||||||
|
|
||||||
|
There are two additional configuration options specified under `run-cmd`; these parameters configure the maximum string/array size to be shown while debugging.
|
||||||
|
|
||||||
|
```
|
||||||
|
"dlvLoadConfig": {
|
||||||
|
"maxArrayValues": 1000,
|
||||||
|
"maxStringLen": 1000
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"example.com/internal/vowels"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
names := []string{"Simon", "Bob", "Jennifer", "Amy", "Duke", "Elizabeth"}
|
||||||
|
|
||||||
|
for _, n := range names {
|
||||||
|
if vowels.NameStartsWithVowel(n) {
|
||||||
|
fmt.Printf("%s starts with a vowel!\n", n)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
fmt.Printf("%s does not start with a vowel!\n", n)
|
||||||
|
}
|
||||||
|
}
|
||||||
3
support/test/go/name-starts-with-vowel/go.mod
Normal file
3
support/test/go/name-starts-with-vowel/go.mod
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
module example.com
|
||||||
|
|
||||||
|
go 1.16
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
package vowels
|
||||||
|
|
||||||
|
import "strings"
|
||||||
|
|
||||||
|
func NameStartsWithVowel(name string) bool {
|
||||||
|
s := strings.Split(strings.ToLower(name), "")
|
||||||
|
|
||||||
|
return s[0] == "a" || s[0] == "e" || s[0] == "i" || s[0] == "o" || s[0] == "u"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
package vowels
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"testing"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestNameStartsWithVowel(t *testing.T) {
|
||||||
|
testCases := []struct {
|
||||||
|
input string
|
||||||
|
expectedOutput bool
|
||||||
|
}{
|
||||||
|
{
|
||||||
|
input: "Simon",
|
||||||
|
expectedOutput: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: "Andy",
|
||||||
|
expectedOutput: true,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
for _, tt := range testCases {
|
||||||
|
t.Run(fmt.Sprintf("%s should product %t", tt.input, tt.expectedOutput), func(t *testing.T) {
|
||||||
|
out := NameStartsWithVowel(tt.input)
|
||||||
|
if out != tt.expectedOutput {
|
||||||
|
t.Errorf("%s produced %t, when %t was expected", tt.input, out, tt.expectedOutput)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
8
tests/testdata/cpp/simple/.vimspector.json
vendored
8
tests/testdata/cpp/simple/.vimspector.json
vendored
|
|
@ -12,7 +12,7 @@
|
||||||
"externalConsole": false,
|
"externalConsole": false,
|
||||||
"stopAtEntry": true,
|
"stopAtEntry": true,
|
||||||
"stopOnEntry": true,
|
"stopOnEntry": true,
|
||||||
"MImode": "${VIMSPECTOR_MIMODE}"
|
"MIMode": "${VIMSPECTOR_MIMODE}"
|
||||||
},
|
},
|
||||||
"breakpoints": {
|
"breakpoints": {
|
||||||
"exception": {
|
"exception": {
|
||||||
|
|
@ -33,7 +33,7 @@
|
||||||
"externalConsole": false,
|
"externalConsole": false,
|
||||||
"stopAtEntry": false,
|
"stopAtEntry": false,
|
||||||
"stopOnEntry": false,
|
"stopOnEntry": false,
|
||||||
"MImode": "${VIMSPECTOR_MIMODE}"
|
"MIMode": "${VIMSPECTOR_MIMODE}"
|
||||||
},
|
},
|
||||||
"breakpoints": {
|
"breakpoints": {
|
||||||
"exception": {
|
"exception": {
|
||||||
|
|
@ -55,7 +55,7 @@
|
||||||
"externalConsole": false,
|
"externalConsole": false,
|
||||||
"stopAtEntry": false,
|
"stopAtEntry": false,
|
||||||
"stopOnEntry": false,
|
"stopOnEntry": false,
|
||||||
"MImode": "${VIMSPECTOR_MIMODE}"
|
"MIMode": "${VIMSPECTOR_MIMODE}"
|
||||||
},
|
},
|
||||||
"breakpoints": {
|
"breakpoints": {
|
||||||
"exception": {
|
"exception": {
|
||||||
|
|
@ -82,7 +82,7 @@
|
||||||
"configuration": {
|
"configuration": {
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"program": "${workspaceRoot}/${fileBasenameNoExtension}",
|
"program": "${workspaceRoot}/${fileBasenameNoExtension}",
|
||||||
"MImode": "${VIMSPECTOR_MIMODE}",
|
"MIMode": "${VIMSPECTOR_MIMODE}",
|
||||||
"externalConsole": false,
|
"externalConsole": false,
|
||||||
"args": [
|
"args": [
|
||||||
"CALCULATED_LIST", "${CALCULATED_LIST}",
|
"CALCULATED_LIST", "${CALCULATED_LIST}",
|
||||||
|
|
|
||||||
|
|
@ -194,6 +194,7 @@ function! Test_ExpandVariables()
|
||||||
\ [
|
\ [
|
||||||
\ '- Scope: Locals',
|
\ '- Scope: Locals',
|
||||||
\ ' *+ t (Test): {...}',
|
\ ' *+ t (Test): {...}',
|
||||||
|
\ '+ Scope: Registers',
|
||||||
\ ],
|
\ ],
|
||||||
\ getbufline( winbufnr( g:vimspector_session_windows.variables ),
|
\ getbufline( winbufnr( g:vimspector_session_windows.variables ),
|
||||||
\ 1,
|
\ 1,
|
||||||
|
|
@ -219,6 +220,7 @@ function! Test_ExpandVariables()
|
||||||
\ ' \*- c (char): 0 ''\\0\{1,3}''',
|
\ ' \*- c (char): 0 ''\\0\{1,3}''',
|
||||||
\ ' \*- fffff (float): 0',
|
\ ' \*- fffff (float): 0',
|
||||||
\ ' \*+ another_test (AnotherTest):\( {...}\)\?',
|
\ ' \*+ another_test (AnotherTest):\( {...}\)\?',
|
||||||
|
\ '+ Scope: Registers',
|
||||||
\ ],
|
\ ],
|
||||||
\ getbufline( winbufnr( g:vimspector_session_windows.variables ),
|
\ getbufline( winbufnr( g:vimspector_session_windows.variables ),
|
||||||
\ 1,
|
\ 1,
|
||||||
|
|
@ -237,6 +239,7 @@ function! Test_ExpandVariables()
|
||||||
\ ' - c (char): 0 ''\\0\{1,3}''',
|
\ ' - c (char): 0 ''\\0\{1,3}''',
|
||||||
\ ' - fffff (float): 0',
|
\ ' - fffff (float): 0',
|
||||||
\ ' + another_test (AnotherTest):\( {...}\)\?',
|
\ ' + another_test (AnotherTest):\( {...}\)\?',
|
||||||
|
\ '+ Scope: Registers',
|
||||||
\ ],
|
\ ],
|
||||||
\ getbufline( winbufnr( g:vimspector_session_windows.variables ),
|
\ getbufline( winbufnr( g:vimspector_session_windows.variables ),
|
||||||
\ 1,
|
\ 1,
|
||||||
|
|
@ -253,6 +256,7 @@ function! Test_ExpandVariables()
|
||||||
\ [
|
\ [
|
||||||
\ '- Scope: Locals',
|
\ '- Scope: Locals',
|
||||||
\ ' + t (Test): {...}',
|
\ ' + t (Test): {...}',
|
||||||
|
\ '+ Scope: Registers',
|
||||||
\ ],
|
\ ],
|
||||||
\ getbufline( winbufnr( g:vimspector_session_windows.variables ),
|
\ getbufline( winbufnr( g:vimspector_session_windows.variables ),
|
||||||
\ 1,
|
\ 1,
|
||||||
|
|
@ -267,6 +271,7 @@ function! Test_ExpandVariables()
|
||||||
\ [
|
\ [
|
||||||
\ '- Scope: Locals',
|
\ '- Scope: Locals',
|
||||||
\ ' + t (Test): {...}',
|
\ ' + t (Test): {...}',
|
||||||
|
\ '+ Scope: Registers',
|
||||||
\ ],
|
\ ],
|
||||||
\ getbufline( winbufnr( g:vimspector_session_windows.variables ),
|
\ getbufline( winbufnr( g:vimspector_session_windows.variables ),
|
||||||
\ 1,
|
\ 1,
|
||||||
|
|
@ -286,6 +291,7 @@ function! Test_ExpandVariables()
|
||||||
\ ' \*- c (char): 99 ''c''',
|
\ ' \*- c (char): 99 ''c''',
|
||||||
\ ' \*- fffff (float): 0',
|
\ ' \*- fffff (float): 0',
|
||||||
\ ' \*+ another_test (AnotherTest):\( {...}\)\?',
|
\ ' \*+ another_test (AnotherTest):\( {...}\)\?',
|
||||||
|
\ '+ Scope: Registers',
|
||||||
\ ],
|
\ ],
|
||||||
\ getbufline( winbufnr( g:vimspector_session_windows.variables ),
|
\ getbufline( winbufnr( g:vimspector_session_windows.variables ),
|
||||||
\ 1,
|
\ 1,
|
||||||
|
|
@ -302,6 +308,7 @@ function! Test_ExpandVariables()
|
||||||
\ assert_equal(
|
\ assert_equal(
|
||||||
\ [
|
\ [
|
||||||
\ '+ Scope: Locals',
|
\ '+ Scope: Locals',
|
||||||
|
\ '+ Scope: Registers',
|
||||||
\ ],
|
\ ],
|
||||||
\ getbufline( winbufnr( g:vimspector_session_windows.variables ),
|
\ getbufline( winbufnr( g:vimspector_session_windows.variables ),
|
||||||
\ 1,
|
\ 1,
|
||||||
|
|
@ -316,6 +323,7 @@ function! Test_ExpandVariables()
|
||||||
\ assert_equal(
|
\ assert_equal(
|
||||||
\ [
|
\ [
|
||||||
\ '+ Scope: Locals',
|
\ '+ Scope: Locals',
|
||||||
|
\ '+ Scope: Registers',
|
||||||
\ ],
|
\ ],
|
||||||
\ getbufline( winbufnr( g:vimspector_session_windows.variables ),
|
\ getbufline( winbufnr( g:vimspector_session_windows.variables ),
|
||||||
\ 1,
|
\ 1,
|
||||||
|
|
@ -331,6 +339,7 @@ function! Test_ExpandVariables()
|
||||||
\ assert_equal(
|
\ assert_equal(
|
||||||
\ [
|
\ [
|
||||||
\ '+ Scope: Locals',
|
\ '+ Scope: Locals',
|
||||||
|
\ '+ Scope: Registers',
|
||||||
\ ],
|
\ ],
|
||||||
\ getbufline( winbufnr( g:vimspector_session_windows.variables ),
|
\ getbufline( winbufnr( g:vimspector_session_windows.variables ),
|
||||||
\ 1,
|
\ 1,
|
||||||
|
|
@ -846,6 +855,7 @@ function! Test_SetVariableValue_Local()
|
||||||
\ [
|
\ [
|
||||||
\ '- Scope: Locals',
|
\ '- Scope: Locals',
|
||||||
\ ' *+ t (Test): {...}',
|
\ ' *+ t (Test): {...}',
|
||||||
|
\ '+ Scope: Registers',
|
||||||
\ ],
|
\ ],
|
||||||
\ getbufline( winbufnr( g:vimspector_session_windows.variables ),
|
\ getbufline( winbufnr( g:vimspector_session_windows.variables ),
|
||||||
\ 1,
|
\ 1,
|
||||||
|
|
@ -871,6 +881,7 @@ function! Test_SetVariableValue_Local()
|
||||||
\ ' \*- c (char): 0 ''\\0\{1,3}''',
|
\ ' \*- c (char): 0 ''\\0\{1,3}''',
|
||||||
\ ' \*- fffff (float): 0',
|
\ ' \*- fffff (float): 0',
|
||||||
\ ' \*+ another_test (AnotherTest):\( {...}\)\?',
|
\ ' \*+ another_test (AnotherTest):\( {...}\)\?',
|
||||||
|
\ '+ Scope: Registers',
|
||||||
\ ],
|
\ ],
|
||||||
\ getbufline( winbufnr( g:vimspector_session_windows.variables ),
|
\ getbufline( winbufnr( g:vimspector_session_windows.variables ),
|
||||||
\ 1,
|
\ 1,
|
||||||
|
|
@ -897,6 +908,7 @@ EOF
|
||||||
\ ' \*- c (char): 0 ''\\0\{1,3}''',
|
\ ' \*- c (char): 0 ''\\0\{1,3}''',
|
||||||
\ ' \*- fffff (float): 0',
|
\ ' \*- fffff (float): 0',
|
||||||
\ ' \*+ another_test (AnotherTest):\( {...}\)\?',
|
\ ' \*+ another_test (AnotherTest):\( {...}\)\?',
|
||||||
|
\ '+ Scope: Registers',
|
||||||
\ ],
|
\ ],
|
||||||
\ getbufline( winbufnr( g:vimspector_session_windows.variables ),
|
\ getbufline( winbufnr( g:vimspector_session_windows.variables ),
|
||||||
\ 1,
|
\ 1,
|
||||||
|
|
@ -916,6 +928,7 @@ EOF
|
||||||
\ ' \*- c (char): 0 ''\\0\{1,3}''',
|
\ ' \*- c (char): 0 ''\\0\{1,3}''',
|
||||||
\ ' \*- fffff (float): 0',
|
\ ' \*- fffff (float): 0',
|
||||||
\ ' \*+ another_test (AnotherTest):\( {...}\)\?',
|
\ ' \*+ another_test (AnotherTest):\( {...}\)\?',
|
||||||
|
\ '+ Scope: Registers',
|
||||||
\ ],
|
\ ],
|
||||||
\ getbufline( winbufnr( g:vimspector_session_windows.variables ),
|
\ getbufline( winbufnr( g:vimspector_session_windows.variables ),
|
||||||
\ 1,
|
\ 1,
|
||||||
|
|
@ -935,6 +948,7 @@ EOF
|
||||||
\ ' \*- c (char): 0 ''\\0\{1,3}''',
|
\ ' \*- c (char): 0 ''\\0\{1,3}''',
|
||||||
\ ' \*- fffff (float): 0',
|
\ ' \*- fffff (float): 0',
|
||||||
\ ' \*+ another_test (AnotherTest):\( {...}\)\?',
|
\ ' \*+ another_test (AnotherTest):\( {...}\)\?',
|
||||||
|
\ '+ Scope: Registers',
|
||||||
\ ],
|
\ ],
|
||||||
\ getbufline( winbufnr( g:vimspector_session_windows.variables ),
|
\ getbufline( winbufnr( g:vimspector_session_windows.variables ),
|
||||||
\ 1,
|
\ 1,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue