Merge pull request #64 from puremourning/python-ptvsd

Demo of python attach
This commit is contained in:
mergify[bot] 2019-10-26 14:54:54 +00:00 committed by GitHub
commit c26fe1ddd2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 49 additions and 6 deletions

View file

@ -42,8 +42,13 @@ stages:
go get -u github.com/go-delve/delve/cmd/dlv
displayName: 'Install Delve for Go'
# TODO: Use cache to store the download directory
- bash: python3 install_gadget.py --all --force-all
- task: CacheBeta@0
inputs:
key: v1 | gadgets | $(Agent.OS) | install_gadget.py
path: gadgets/linux/download
displayName: Cache gadgets
- bash: python3 install_gadget.py --all
displayName: 'Install gadgets - python3'
- bash: vim --version
@ -78,7 +83,13 @@ stages:
- bash: go get -u github.com/go-delve/delve/cmd/dlv
displayName: 'Install Delve for Go'
- bash: python3 install_gadget.py --all --force-all
- task: CacheBeta@0
inputs:
key: v1 | gadgets | $(Agent.OS) | install_gadget.py
path: gadgets/macos/download
displayName: Cache gadgets
- bash: python3 install_gadget.py --all
displayName: 'Install gadgets - python3'
- bash: vim --version

View file

@ -111,7 +111,7 @@ GADGETS = {
'language': 'tcl',
'repo': {
'url': 'https://github.com/puremourning/TclProDebug',
'ref': 'master',
'ref': 'f5c56b7067661ce84e205765060224076569ae0e', # master 26/10/2019
},
'do': lambda name, root: InstallTclProDebug( name, root )
},

View file

@ -94,7 +94,9 @@ class DebugSession( object ):
adapters.update( database.get( 'adapters' ) or {} )
if len( configurations ) == 1:
if 'configuration' in launch_variables:
configuration_name = launch_variables.pop( 'configuration' )
elif len( configurations ) == 1:
configuration_name = next( iter( configurations.keys() ) )
else:
configuration_name = utils.SelectFromList(

View file

@ -0,0 +1 @@
env/

View file

@ -10,6 +10,15 @@
"stopOnEntry": true,
"console": "integratedTerminal"
}
},
"attach": {
"adapter": "vscode-python",
"configuration": {
"request": "attach",
"type": "python",
"host": "localhost",
"port": "5678"
}
}
}
}

View file

@ -0,0 +1 @@
ptvsd==4.3.2

View file

@ -0,0 +1,19 @@
#!/usr/bin/env bash
PYTHON=python3
if [ -n "$1" ]; then
PYTHON=$1
fi
pushd $(dirname $0)
if [ ! -d env ]; then
virtualenv -p $PYTHON env
fi
. env/bin/activate
pip install -r requirements.txt
python -m ptvsd --wait --host localhost --port 5678 main.py
popd

View file

@ -34,7 +34,7 @@ with patch( 'vimspector.utils.SelectFromList',
return_value=None ) as p:
with patch( 'vimspector.utils.AskForInput',
return_value=None ) as p:
vim.eval( 'feedkeys( "\<F5>", "xt" )' )
vim.eval( 'vimspector#LaunchWithSettings( { "configuration": "run" } )' )
vim.eval( 'vimspector#test#signs#AssertCursorIsAtLineInBuffer( fn, 6, 1 )' )
p.assert_called()
EOF