Allow for variable expansion in configuration
We expand environment variables, ~ and workspaceRoot. The latter is to match vscode and typical launch configs. As we don't know what the workspeace root might be, we use the location of the .vimspector.json.
This commit is contained in:
parent
3f9bc6f921
commit
79b25c0860
2 changed files with 32 additions and 0 deletions
|
|
@ -133,9 +133,17 @@ class DebugSession( object ):
|
|||
if not configuration:
|
||||
return
|
||||
|
||||
utils.ExpandReferencesInDict( launch_config[ configuration ], {
|
||||
'workspaceRoot': os.path.dirname( launch_config_file )
|
||||
} )
|
||||
|
||||
adapter = launch_config[ configuration ].get( 'adapter' )
|
||||
if isinstance( adapter, str ):
|
||||
adapter = adapters.get( adapter )
|
||||
utils.ExpandReferencesInDict( adapter, {
|
||||
'workspaceRoot': os.path.dirname( launch_config_file )
|
||||
} )
|
||||
|
||||
|
||||
self._StartWithConfiguration( launch_config[ configuration ],
|
||||
adapter )
|
||||
|
|
@ -144,6 +152,11 @@ class DebugSession( object ):
|
|||
self._configuration = configuration
|
||||
self._adapter = adapter
|
||||
|
||||
self._logger.info( 'Configuration: {0}'.format( json.dumps(
|
||||
self._configuration ) ) )
|
||||
self._logger.info( 'Adapter: {0}'.format( json.dumps(
|
||||
self._adapter ) ) )
|
||||
|
||||
def start():
|
||||
self._StartDebugAdapter()
|
||||
self._Initialise()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue