From aa7f9fdda5846b05c037b9deab9c5841295d31e0 Mon Sep 17 00:00:00 2001 From: katauber Date: Thu, 27 Apr 2023 09:07:13 +0200 Subject: [PATCH 1/4] Update vsc extension to new fix #291 --- metafix-vsc/fix.configuration.json | 2 +- metafix-vsc/fix.tmLanguage | 46 ++++++++++++------------------ metafix-vsc/package.json | 2 +- 3 files changed, 20 insertions(+), 30 deletions(-) diff --git a/metafix-vsc/fix.configuration.json b/metafix-vsc/fix.configuration.json index 1f69dcac..69347af5 100644 --- a/metafix-vsc/fix.configuration.json +++ b/metafix-vsc/fix.configuration.json @@ -1,6 +1,6 @@ { "comments": { - "blockComment": [ "\\*", "*/" ] + "lineComment": "#" }, "brackets": [ ["{", "}"], diff --git a/metafix-vsc/fix.tmLanguage b/metafix-vsc/fix.tmLanguage index b8a757b7..c729ad7a 100644 --- a/metafix-vsc/fix.tmLanguage +++ b/metafix-vsc/fix.tmLanguage @@ -14,51 +14,41 @@ name keyword.control.fix match - \b(do|if|elsif|else|end)\b + \b(do|if|elsif|else|end|unless)\b + comment + The fix grammar can be found here: https://github.com/metafacture/metafacture-fix/blob/master/metafix/src/main/java/org/metafacture/metafix/Fix.xtext name - entity.name.function.morph-collectors + entity.name.function.fix-method match - \b(all|any|combine|choose|group|concat|none|tuples|square|range|equalsFilter|entity)\b + \b(include|nothing|put_filemap|put_map|put_rdfmap|put_var|put_vars|add_field|array|call_macro|copy_field|format|hash|move_field|parse_text|paste|print_record|random|reject|rename|retain|set_array|set_field|set_hash|timestamp|vacuum|append|capitalize|count|downcase|filter|flatten|from_json|index|isbn|json_field|lookup|prepend|replace_all|reverse|sort_field|split_field|substring|sum|to_json|trim|uniq|upcase)\b + comment + The method names are taken from https://github.com/metafacture/metafacture-fix/blob/master/metafix/src/main/java/org/metafacture/metafix/FixMethod.java name - entity.name.function.morph-functions + entity.name.function.fix-conditional match - \b(regexp|substring|compose|lookup|whitelist|blacklist|replace|isbn|equals|not_equals|contains|not_contains|case|htmlanchor|trim|normalize_utf8|urlencode|split|occurence|constant|count|buffer|switch_name_value|unique|script|setreplace|timestamp|dateformat)\b + \b(all_contain|any_contain|none_contain|str_contain|all_equal|any_equal|none_equal|str_equal|exists|in|is_contained_in|is_array|is_empty|is_false|is_hash|is_number|is_object|is_sring|is_true|all_match|any_match|none_match|str_match)\b + comment + The names of the conditionals are taken from https://github.com/metafacture/metafacture-fix/blob/master/metafix/src/main/java/org/metafacture/metafix/FixMethod.java name - entity.name.function.morph-maps + entity.name.function.fix-bind match - \b(filemap|restmap|sqlmap|jndisqlmap)\b + \b(list|list_as|once|put_macro)\b + comment + The names of the fix binds are taken from https://github.com/metafacture/metafacture-fix/blob/master/metafix/src/main/java/org/metafacture/metafix/FixBind.java name - entity.name.function.fix-functions - match - \b(map|add_field|lookup|array|replace_all)\b - - - name - variable.parameter.morph-collector-parameters - match - \b(flushWith|reset|sameEntity|delimiter|name|prefix|postfix|minN|pattern|in|with): - - - name - entity.name.type.fix - match - \b(type|string|int|boolean)\b - - - name - comment.block + comment.line.number-sign begin - /\* + # end - \*/ + \n name diff --git a/metafix-vsc/package.json b/metafix-vsc/package.json index 1d3d7c5d..e9fcb972 100644 --- a/metafix-vsc/package.json +++ b/metafix-vsc/package.json @@ -2,7 +2,7 @@ "name": "fix", "displayName": "fix", "description": "Language Support for Metafacture Fix (Xtext Language Server for Metafacture Fix). For more information, visit https://metafacture.org", - "version": "0.1.1", + "version": "0.2.0", "publisher": "metafacture", "license": "Apache-2.0", "engines": { From df677cc40b08482dee69763bcdb5800607303785 Mon Sep 17 00:00:00 2001 From: katauber Date: Mon, 8 May 2023 09:49:34 +0200 Subject: [PATCH 2/4] Fix link to fix conditionals #291 --- metafix-vsc/fix.tmLanguage | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metafix-vsc/fix.tmLanguage b/metafix-vsc/fix.tmLanguage index c729ad7a..ac27f018 100644 --- a/metafix-vsc/fix.tmLanguage +++ b/metafix-vsc/fix.tmLanguage @@ -32,7 +32,7 @@ match \b(all_contain|any_contain|none_contain|str_contain|all_equal|any_equal|none_equal|str_equal|exists|in|is_contained_in|is_array|is_empty|is_false|is_hash|is_number|is_object|is_sring|is_true|all_match|any_match|none_match|str_match)\b comment - The names of the conditionals are taken from https://github.com/metafacture/metafacture-fix/blob/master/metafix/src/main/java/org/metafacture/metafix/FixMethod.java + The names of the conditionals are taken from https://github.com/metafacture/metafacture-fix/blob/master/metafix/src/main/java/org/metafacture/metafix/FixConditional.java name From 7d2d8c2a635a1a505192de847b68a5e53e43c394 Mon Sep 17 00:00:00 2001 From: katauber Date: Mon, 8 May 2023 10:59:08 +0200 Subject: [PATCH 3/4] Change scope selectors to style methods, binds and conditionals different #291 --- metafix-vsc/fix.tmLanguage | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/metafix-vsc/fix.tmLanguage b/metafix-vsc/fix.tmLanguage index ac27f018..7614cbb2 100644 --- a/metafix-vsc/fix.tmLanguage +++ b/metafix-vsc/fix.tmLanguage @@ -20,15 +20,15 @@ name - entity.name.function.fix-method + entity.name.function.fix match - \b(include|nothing|put_filemap|put_map|put_rdfmap|put_var|put_vars|add_field|array|call_macro|copy_field|format|hash|move_field|parse_text|paste|print_record|random|reject|rename|retain|set_array|set_field|set_hash|timestamp|vacuum|append|capitalize|count|downcase|filter|flatten|from_json|index|isbn|json_field|lookup|prepend|replace_all|reverse|sort_field|split_field|substring|sum|to_json|trim|uniq|upcase)\b + \b(include|nothing|put_filemap|put_map|put_rdfmap|put_var|put_vars|add_field|array|call_macro|copy_field|format|hash|move_field|parse_text|paste|print_record|random|reject|rename|retain|set_array|set_field|set_hash|timestamp|vacuum|append|capitalize|count|downcase|filter|flatten|from_json|index|isbn|join_field|lookup|prepend|replace_all|reverse|sort_field|split_field|substring|sum|to_json|trim|uniq|upcase)\b comment The method names are taken from https://github.com/metafacture/metafacture-fix/blob/master/metafix/src/main/java/org/metafacture/metafix/FixMethod.java name - entity.name.function.fix-conditional + keyword.operator.fix match \b(all_contain|any_contain|none_contain|str_contain|all_equal|any_equal|none_equal|str_equal|exists|in|is_contained_in|is_array|is_empty|is_false|is_hash|is_number|is_object|is_sring|is_true|all_match|any_match|none_match|str_match)\b comment @@ -36,7 +36,7 @@ name - entity.name.function.fix-bind + storage.type.fix match \b(list|list_as|once|put_macro)\b comment @@ -44,7 +44,7 @@ name - comment.line.number-sign + comment.line.number-sign.fix begin # end @@ -52,7 +52,7 @@ name - string.quoted.single + string.quoted.single.fix begin ' end @@ -60,7 +60,7 @@ name - string.quoted.double + string.quoted.double.fix begin " end From b7540b6493aeb0376d2fd11cba2351b9cf21bb83 Mon Sep 17 00:00:00 2001 From: katauber Date: Thu, 11 May 2023 13:06:55 +0200 Subject: [PATCH 4/4] Adapt group names after review #291 --- metafix-vsc/fix.tmLanguage | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/metafix-vsc/fix.tmLanguage b/metafix-vsc/fix.tmLanguage index 7614cbb2..e2f5ffba 100644 --- a/metafix-vsc/fix.tmLanguage +++ b/metafix-vsc/fix.tmLanguage @@ -20,7 +20,7 @@ name - entity.name.function.fix + entity.name.function.method.fix match \b(include|nothing|put_filemap|put_map|put_rdfmap|put_var|put_vars|add_field|array|call_macro|copy_field|format|hash|move_field|parse_text|paste|print_record|random|reject|rename|retain|set_array|set_field|set_hash|timestamp|vacuum|append|capitalize|count|downcase|filter|flatten|from_json|index|isbn|join_field|lookup|prepend|replace_all|reverse|sort_field|split_field|substring|sum|to_json|trim|uniq|upcase)\b comment @@ -28,7 +28,7 @@ name - keyword.operator.fix + support.function.conditional.fix match \b(all_contain|any_contain|none_contain|str_contain|all_equal|any_equal|none_equal|str_equal|exists|in|is_contained_in|is_array|is_empty|is_false|is_hash|is_number|is_object|is_sring|is_true|all_match|any_match|none_match|str_match)\b comment @@ -36,7 +36,7 @@ name - storage.type.fix + storage.type.bind.fix match \b(list|list_as|once|put_macro)\b comment