Alow env and cwd to be specified for the _adapter_

This commit is contained in:
Ben Jackson 2019-02-01 10:05:16 +00:00
commit f1859639d7
2 changed files with 11 additions and 0 deletions

View file

@ -368,6 +368,15 @@ class DebugSession( object ):
port = utils.AskForInput( 'Enter port to connect to: ' )
self._adapter[ 'port' ] = port
# TODO: Do we actually need to copy and update or does Vim do that?
env = os.environ.copy()
if 'env' in self._adapter:
env.update( self._adapter[ 'env' ] )
self._adapter[ 'env' ] = env
if 'cwd' not in self._adapter:
self._adapter[ 'cwd' ] = os.getcwd()
channel_send_func = vim.bindeval(
"vimspector#internal#{}#StartDebugSession( {} )".format(
self._connection_type,