diff --git a/CHANGELOG.md b/CHANGELOG.md index 038878c..41910d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,21 @@ # Change Log -## Pre-Release (1.3.1) +## Pre-Release (1.3.2) + +- Allow changing the editor layout through the UI +- Improve the behavior of the information side panel +- Allow closing the information side panel +- Zoom to affected nodes when selecting a transformation +- Allow the minimap to be disabled through the UI +- Group transformations by type +- Allow all transformations of a certain type to be applied at once +- Fix a number of bugs related to property editing +- Allow configuring of default custom transformation directories +- Fix and improve Go-To-Source and Go-To-Generated-Code functionality + +## 1.2 + +### 1.2.1 - Allow offline editing of SDFGs (adding / deleting elements etc.) - Add auto-opening SDFG and instrumentation report preference to the extension @@ -10,8 +25,6 @@ - Improved error reporting from the DaCe daemon - Various bugfixes and improvements -## 1.2 - ### 1.2.0 - Allow loading of custom transformations diff --git a/backend/dace_vscode/transformations.py b/backend/dace_vscode/transformations.py index 517e83f..5f37b16 100644 --- a/backend/dace_vscode/transformations.py +++ b/backend/dace_vscode/transformations.py @@ -128,7 +128,7 @@ def reapply_history_until(sdfg_json, index): } -def apply_transformation(sdfg_json, transformation_json): +def apply_transformations(sdfg_json, transformation_json_list): old_meta = utils.disable_save_metadata() loaded = utils.load_sdfg_from_json(sdfg_json) @@ -136,34 +136,35 @@ def apply_transformation(sdfg_json, transformation_json): return loaded['error'] sdfg = loaded['sdfg'] - try: - transformation = serialize.from_json(transformation_json) - except Exception as e: - print(traceback.format_exc(), file=sys.stderr) - sys.stderr.flush() - return { - 'error': { - 'message': 'Failed to parse the applied transformation', - 'details': utils.get_exception_message(e), - }, - } - try: - target_sdfg = sdfg.sdfg_list[transformation.sdfg_id] - transformation._sdfg = target_sdfg - if isinstance(transformation, SubgraphTransformation): - sdfg.append_transformation(transformation) - transformation.apply(target_sdfg) - else: - transformation.apply_pattern(target_sdfg) - except Exception as e: - print(traceback.format_exc(), file=sys.stderr) - sys.stderr.flush() - return { - 'error': { - 'message': 'Failed to apply the transformation to the SDFG', - 'details': utils.get_exception_message(e), - }, - } + for transformation_json in transformation_json_list: + try: + transformation = serialize.from_json(transformation_json) + except Exception as e: + print(traceback.format_exc(), file=sys.stderr) + sys.stderr.flush() + return { + 'error': { + 'message': 'Failed to parse the applied transformation', + 'details': utils.get_exception_message(e), + }, + } + try: + target_sdfg = sdfg.sdfg_list[transformation.sdfg_id] + transformation._sdfg = target_sdfg + if isinstance(transformation, SubgraphTransformation): + sdfg.append_transformation(transformation) + transformation.apply(target_sdfg) + else: + transformation.apply_pattern(target_sdfg) + except Exception as e: + print(traceback.format_exc(), file=sys.stderr) + sys.stderr.flush() + return { + 'error': { + 'message': 'Failed to apply the transformation to the SDFG', + 'details': utils.get_exception_message(e), + }, + } new_sdfg = sdfg.to_json() utils.restore_save_metadata(old_meta) diff --git a/backend/run_dace.py b/backend/run_dace.py index 3ebde79..0102f05 100644 --- a/backend/run_dace.py +++ b/backend/run_dace.py @@ -383,11 +383,12 @@ def _add_transformations(): request_json = request.get_json() return transformations.add_custom_transformations(request_json['paths']) - @daemon.route('/apply_transformation', methods=['POST']) - def _apply_transformation(): + @daemon.route('/apply_transformations', methods=['POST']) + def _apply_transformations(): request_json = request.get_json() - return transformations.apply_transformation( - request_json['sdfg'], request_json['transformation']) + return transformations.apply_transformations( + request_json['sdfg'], request_json['transformations'] + ) @daemon.route('/expand_library_node', methods=['POST']) def _expand_library_node(): diff --git a/media/components/sdfv/index.html b/media/components/sdfv/index.html index 2fc684c..2b7b945 100644 --- a/media/components/sdfv/index.html +++ b/media/components/sdfv/index.html @@ -12,8 +12,8 @@ @@ -152,46 +152,54 @@ -