Pre-calculate the gadgetDir, as this is likely used every time

This commit is contained in:
Ben Jackson 2020-07-09 18:57:28 +01:00
commit 9f6caadc40

View file

@ -181,12 +181,11 @@ class DebugSession( object ):
'dollar': '$', # HACK. Hote '$$' also works.
'workspaceRoot': self._workspace_root,
'workspaceFolder': self._workspace_root,
'gadgetDir': install.GetGadgetDir( VIMSPECTOR_HOME, install.GetOS() ),
'file': current_file,
}
calculus = {
'gadgetDir': lambda: install.GetGadgetDir( VIMSPECTOR_HOME,
install.GetOS() ),
'relativeFile': lambda: relpath( current_file,
self._workspace_root ),
'fileBasename': lambda: os.path.basename( current_file ),