From cbd46730379c1924a966ea79a1b0a71da1f5fd94 Mon Sep 17 00:00:00 2001 From: RickBarretto <78623871+RickBarretto@users.noreply.github.com> Date: Sun, 26 May 2024 14:10:31 -0300 Subject: [PATCH 01/10] ignore test.art --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index dfacd4d..19eed1a 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -*.vsix \ No newline at end of file +*.vsix +test.art \ No newline at end of file From 4b9ca7c0e1a7e7c160f6484147556aa1a7a34357 Mon Sep 17 00:00:00 2001 From: RickBarretto <78623871+RickBarretto@users.noreply.github.com> Date: Sun, 26 May 2024 14:12:37 -0300 Subject: [PATCH 02/10] add arithmetic function's snippet --- .vscode/arithmetic.arturo.code-snippets | 117 ++++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 .vscode/arithmetic.arturo.code-snippets diff --git a/.vscode/arithmetic.arturo.code-snippets b/.vscode/arithmetic.arturo.code-snippets new file mode 100644 index 0000000..72f6b7b --- /dev/null +++ b/.vscode/arithmetic.arturo.code-snippets @@ -0,0 +1,117 @@ +{ + + "add function": { + "scope": "art", + "prefix": "add", + "body": "add $1 $2" + }, + + "add sign": { + "scope": "art", + "prefix": "add", + "body": "$1 + $2" + }, + + "dec function": { + "scope": "art", + "prefix": "dec", + "body": "dec $1" + }, + + "div function": { + "scope": "art", + "prefix": "div", + "body": "div $1 $2" + }, + + "div sign": { + "scope": "art", + "prefix": "div", + "body": "$1 / $2" + }, + + "divmod function": { + "scope": "art", + "prefix": "divmod", + "body": "divmod $1 $2" + }, + + "divmod sign": { + "scope": "art", + "prefix": "divmod", + "body": "$1 /% $2" + }, + + "fdiv function": { + "scope": "art", + "prefix": "fdiv", + "body": "fdiv $1 $2" + }, + + "fdiv sign": { + "scope": "art", + "prefix": "fdiv", + "body": "$1 // $2" + }, + + "inc function": { + "scope": "art", + "prefix": "inc", + "body": "inc $1 $2" + }, + + "mod function": { + "scope": "art", + "prefix": "mod", + "body": "mod $1 $2" + }, + + "mod sign": { + "scope": "art", + "prefix": "mod", + "body": "$1 % $2" + }, + + "mul function": { + "scope": "art", + "prefix": "mul", + "body": "mul $1 $2" + }, + + "mul sign": { + "scope": "art", + "prefix": "mul", + "body": "$1 * $2" + }, + + "neg function": { + "scope": "art", + "prefix": "neg", + "body": "neg $1" + }, + + "power function": { + "scope": "art", + "prefix": "pow", + "body": "pow $1 $2" + }, + + "power sign": { + "scope": "art", + "prefix": "pow", + "body": "$1 ^ $2" + }, + + "sub function": { + "scope": "art", + "prefix": "sub", + "body": "sub $1 $2" + }, + + "sub sign": { + "scope": "art", + "prefix": "sub", + "body": "$1 - $2" + } + +} \ No newline at end of file From 86cb97f46e69222d6a7ac2d138b9bef295c95743 Mon Sep 17 00:00:00 2001 From: RickBarretto <78623871+RickBarretto@users.noreply.github.com> Date: Sun, 26 May 2024 15:13:18 -0300 Subject: [PATCH 03/10] add core function's snippet --- .vscode/core.arturo.code-snippets | 359 ++++++++++++++++++++++++++++++ 1 file changed, 359 insertions(+) create mode 100644 .vscode/core.arturo.code-snippets diff --git a/.vscode/core.arturo.code-snippets b/.vscode/core.arturo.code-snippets new file mode 100644 index 0000000..a74eb79 --- /dev/null +++ b/.vscode/core.arturo.code-snippets @@ -0,0 +1,359 @@ +{ + + "alias function": { + "scope": "art", + "prefix": "alias", + "body": "alias ${1:symbol} ${2:function}" + }, + + "alias.infix function": { + "scope": "art", + "prefix": "alias.infix", + "body": "alias.infix ${1:symbol} ${2:function}" + }, + + "break function": { + "scope": "art", + "prefix": "break", + "body": "break" + }, + + "call function": { + "scope": "art", + "prefix": "call", + "body": "call ${1:function} ${2|params,[],@[]|}" + }, + + "call external function": { + "scope": "art", + "prefix": "call.external", + "body": "call.external: ${0:path} ${1:function} ${2|params,[],@[]|}" + }, + + "call expect function": { + "scope": "art", + "prefix": "call.expect", + "body": "call.expect: ${0:type} ${1:function} ${2|params,[],@[]|}" + }, + + "case function": { + "scope": "art", + "prefix": "case", + "body": [ + "case ${1|predicate,[],@[]|}", + " $2" + ] + }, + + "coalesce function": { + "scope": "art", + "prefix": "coalesce", + "body": "coalesce ${1:variable} ${2:default}" + }, + + "coalesce sign": { + "scope": "art", + "prefix": "coalesce", + "body": "${1:variable} ?? ${2:default}" + }, + + "continue function": { + "scope": "art", + "prefix": "continue", + "body": "continue" + }, + + "do function": { + "scope": "art", + "prefix": "do", + "body": "do ${1|code,\"\",[],-> |}" + }, + + "do.times function": { + "scope": "art", + "prefix": "do.times", + "body": "do.times: $0 ${1|code,\"\",[],-> |}" + }, + + "dup function": { + "scope": "art", + "prefix": "dup", + "body": "dup ${0:value}" + }, + + "dup sign": { + "scope": "art", + "prefix": "dup", + "body": "<= ${0:value}" + }, + + "else function": { + "scope": "art", + "prefix": "else", + "body": "else ${1|block,-> ,[]|}" + }, + + "else multiline function": { + "scope": "art", + "prefix": "else", + "body": [ + "else [", + " $0", + "]" + ] + }, + + "ensure function": { + "scope": "art", + "prefix": "ensure", + "body": "ensure ${1|block,-> ,[]|}" + }, + + "ensure.that function": { + "scope": "art", + "prefix": "ensure.that", + "body": [ + "ensure.that: \"$1\"", + " ${2|block,-> ,[]|}" + ] + }, + + "function function": { + "scope": "art", + "prefix": "function", + "body": [ + "function [${1:args}][", + " $3", + "]" + ] + }, + + "function sign": { + "scope": "art", + "prefix": "function", + "body": [ + "$[${1:args}][", + " $2", + "]" + ] + }, + + "if function": { + "scope": "art", + "prefix": "if", + "body": "if ${1:condition} ${2|block,-> ,[]|}" + }, + + "if multiline function": { + "scope": "art", + "prefix": "if", + "body": [ + "if ${1:condition} [", + " $0", + "]" + ] + }, + + "import function": { + "scope": "art", + "prefix": "import", + "body": "import {${1:package}}" + }, + + "import local function": { + "scope": "art", + "prefix": "import.local", + "body": "import ./{${1:package}}" + }, + + "import.lean function": { + "scope": "art", + "prefix": "import.lean", + "body": "import.lean {${1:package}}" + }, + + "let function": { + "scope": "art", + "prefix": "let", + "body": "let ${1|'variable,\"variable\"|} $0" + }, + + "let sign": { + "scope": "art", + "prefix": "let", + "body": "${1|variable|}: $0" + }, + + "method function": { + "scope": "art", + "prefix": "method", + "body": [ + "method [${1:args}][", + " $0", + "]" + ] + }, + + "new function": { + "scope": "art", + "prefix": "method", + "body": "new $0" + }, + + "return function": { + "scope": "art", + "prefix": "method", + "body": "return $0" + }, + + "switch function": { + "scope": "art", + "prefix": "method", + "body": [ + "switch ${1:condition}", + " -> ${2:action}", + " -> ${3:alternative}" + ] + }, + + "switch multiline function": { + "scope": "art", + "prefix": "method", + "body": [ + "switch ${1:condition} [", + " ${2:action}", + " ][", + " ${3:alternative}", + "]", + ] + }, + + "unless function": { + "scope": "art", + "prefix": "unless", + "body": "unless ${1:condition} ${2|block,-> ,[]|}" + }, + + "unless multiline function": { + "scope": "art", + "prefix": "unless", + "body": [ + "unless ${1:condition} [", + " $0", + "]" + ] + }, + + "unstack function": { + "scope": "art", + "prefix": "unstack", + "body": "unstack ${1:number}" + }, + + "unstack.discard function": { + "scope": "art", + "prefix": "unstack.discard", + "body": "unstack.discard ${1:number}" + }, + + "until function": { + "scope": "art", + "prefix": "until", + "body": [ + "until [", + " $0", + "][${1:condition}]" + ] + }, + + "var function": { + "scope": "art", + "prefix": "var", + "body": "var '${1:symbol}" + }, + + "while function": { + "scope": "art", + "prefix": "while", + "body": [ + "while [${1:condition}][", + " $0", + "]" + ] + }, + + "with function": { + "scope": "art", + "prefix": "with", + "body": [ + "with ${1|embed,[],'embed|}[", + " $0", + "]" + ] + }, + + "if? function": { + "scope": "art", + "prefix": "if?", + "body": [ + "if? ${1:condition} -> ${2:action}}", + "else -> ${3:alternative}", + ] + }, + + "if? multiline function": { + "scope": "art", + "prefix": "if?", + "body": [ + "if? ${1:condition} [", + " ${2:action}", + "] else [", + " ${3:alternative}", + "]", + ] + }, + + "unless? function": { + "scope": "art", + "prefix": "unless?", + "body": [ + "unless? ${1:condition} -> ${2:action}}", + "else -> ${3:alternative}", + ] + }, + + "unless? multiline function": { + "scope": "art", + "prefix": "unless?", + "body": [ + "unless? ${1:condition} [", + " ${2:action}", + "] else [", + " ${3:alternative}", + "]", + ] + }, + + "when? function": { + "scope": "art", + "prefix": "when?", + "body": "when? [${1:condition}] -> $0" + }, + + "when? multiline function": { + "scope": "art", + "prefix": "when?", + "body": [ + "when? ${1:condition} [", + " $0", + "]" + ] + }, + + "null constant": { + "scope": "arturo", + "prefix": "null", + "body": "null" + } + +} \ No newline at end of file From 93a2de4cfc03a686bfb7c037c24b1edb925c1af5 Mon Sep 17 00:00:00 2001 From: RickBarretto <78623871+RickBarretto@users.noreply.github.com> Date: Sun, 26 May 2024 15:34:07 -0300 Subject: [PATCH 04/10] add logic function's snippet --- .vscode/logic.arturo.code-snippets | 117 +++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 .vscode/logic.arturo.code-snippets diff --git a/.vscode/logic.arturo.code-snippets b/.vscode/logic.arturo.code-snippets new file mode 100644 index 0000000..415a3df --- /dev/null +++ b/.vscode/logic.arturo.code-snippets @@ -0,0 +1,117 @@ +{ + + "all? function": { + "scope": "art", + "prefix": "all?", + "body": "all? ${1|conditions,@[]}" + }, + + "and? function": { + "scope": "art", + "prefix": "and?", + "body": "and? $1 $2" + }, + + "and? sign": { + "scope": "art", + "prefix": "and?", + "body": "$1 ∧ $2" + }, + + "any? function": { + "scope": "art", + "prefix": "any?", + "body": "any? ${1|conditions,@[]}" + }, + + "false? function": { + "scope": "art", + "prefix": "false?", + "body": "false? $0" + }, + + "nand? function": { + "scope": "art", + "prefix": "nand?", + "body": "nand? $1 $2" + }, + + "nand? sign": { + "scope": "art", + "prefix": "nand?", + "body": "$1 ⊼ $2" + }, + + "nor? function": { + "scope": "art", + "prefix": "nor?", + "body": "nor? $1 $2" + }, + + "not? function": { + "scope": "art", + "prefix": "not?", + "body": "not? $0" + }, + + "not? sign": { + "scope": "art", + "prefix": "not?", + "body": "¬$0" + }, + + "or? function": { + "scope": "art", + "prefix": "or?", + "body": "or? $1 $2" + }, + + "or? sign": { + "scope": "art", + "prefix": "or?", + "body": "$1 ∨ $2" + }, + + "true? function": { + "scope": "art", + "prefix": "true?", + "body": "true? $0" + }, + + "xor? function": { + "scope": "art", + "prefix": "xor?", + "body": "xor? $1 $2" + }, + + "xor? sign": { + "scope": "art", + "prefix": "xor?", + "body": "$1 ⊻ $2" + }, + + "xnor? function": { + "scope": "art", + "prefix": "xnor?", + "body": "xnor? $1 $2" + }, + + "false constant": { + "scope": "art", + "prefix": "false", + "body": "false" + }, + + "true constant": { + "scope": "art", + "prefix": "true", + "body": "true" + }, + + "maybe constant": { + "scope": "art", + "prefix": "maybe", + "body": "maybe" + }, + +} \ No newline at end of file From 47226268f4f62503917762a18b78ff466536b402 Mon Sep 17 00:00:00 2001 From: RickBarretto <78623871+RickBarretto@users.noreply.github.com> Date: Sun, 26 May 2024 15:45:07 -0300 Subject: [PATCH 05/10] add logic sets's snippet --- .vscode/sets.arturo.code-snippets | 87 +++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 .vscode/sets.arturo.code-snippets diff --git a/.vscode/sets.arturo.code-snippets b/.vscode/sets.arturo.code-snippets new file mode 100644 index 0000000..0db0ff0 --- /dev/null +++ b/.vscode/sets.arturo.code-snippets @@ -0,0 +1,87 @@ +{ + + "difference function": { + "scope": "art", + "prefix": "difference", + "body": "difference ${1|block,@[]} ${2|block,@[]}" + }, + + "intersection function": { + "scope": "art", + "prefix": "intersection", + "body": "intersection ${1|block,@[]} ${2|block,@[]}" + }, + + "intersection sign": { + "scope": "art", + "prefix": "intersection", + "body": "(${1|block,@[]}) ∩ (${2|block,@[]})" + }, + + "powerset function": { + "scope": "art", + "prefix": "powerset", + "body": "powerset ${1|block,@[]}" + }, + + "union function": { + "scope": "art", + "prefix": "union", + "body": "union ${1|block,@[]} ${2|block,@[]}" + }, + + "union sign": { + "scope": "art", + "prefix": "union", + "body": "(${1|block,@[]}) ∪ (${2|block,@[]})" + }, + + "disjoint? function": { + "scope": "art", + "prefix": "disjoint?", + "body": "disjoint? ${1|block,@[]} ${2|block,@[]}" + }, + + "intersect? function": { + "scope": "art", + "prefix": "intersect?", + "body": "intersect? ${1|block,@[]} ${2|block,@[]}" + }, + + "subset? function": { + "scope": "art", + "prefix": "subset?", + "body": "subset? ${1|block,@[]} ${2|block,@[]}" + }, + + "subset?.proper function": { + "scope": "art", + "prefix": "subset?.proper", + "body": "subset?.proper ${1|block,@[]} ${2|block,@[]}" + }, + + "subset? sign": { + "scope": "art", + "prefix": "subset?", + "body": "(${1|block,@[]}) ⊆ (${2|block,@[]})" + }, + + "superset? function": { + "scope": "art", + "prefix": "superset?", + "body": "superset? ${1|block,@[]} ${2|block,@[]}" + }, + + "superset?.proper function": { + "scope": "art", + "prefix": "superset?.proper", + "body": "superset?.proper ${1|block,@[]} ${2|block,@[]}" + }, + + "superset? sign": { + "scope": "art", + "prefix": "superset?", + "body": "(${1|block,@[]}) ⊃ (${2|block,@[]})" + }, + +} \ No newline at end of file From 52f4f4d8e4f54fdfb4f6a459ac5831dc6caeba5f Mon Sep 17 00:00:00 2001 From: RickBarretto <78623871+RickBarretto@users.noreply.github.com> Date: Sun, 26 May 2024 15:54:44 -0300 Subject: [PATCH 06/10] add null sign's snippet --- .vscode/core.arturo.code-snippets | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.vscode/core.arturo.code-snippets b/.vscode/core.arturo.code-snippets index a74eb79..396738a 100644 --- a/.vscode/core.arturo.code-snippets +++ b/.vscode/core.arturo.code-snippets @@ -354,6 +354,12 @@ "scope": "arturo", "prefix": "null", "body": "null" - } + }, + + "null sign": { + "scope": "art", + "prefix": "null", + "body": "∅" + }, } \ No newline at end of file From 086e8f3d2bcd25232739f66ed8e6ff12ff61373b Mon Sep 17 00:00:00 2001 From: RickBarretto <78623871+RickBarretto@users.noreply.github.com> Date: Sun, 26 May 2024 15:54:59 -0300 Subject: [PATCH 07/10] add some number's snippet --- .vscode/numbers.arturo.code-snippets | 39 ++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .vscode/numbers.arturo.code-snippets diff --git a/.vscode/numbers.arturo.code-snippets b/.vscode/numbers.arturo.code-snippets new file mode 100644 index 0000000..e6acaef --- /dev/null +++ b/.vscode/numbers.arturo.code-snippets @@ -0,0 +1,39 @@ +{ + + "product function": { + "scope": "art", + "prefix": "product", + "body": "product ${1|block,@[]}" + }, + + "product sign": { + "scope": "art", + "prefix": "product", + "body": "∏ ${1|block,@[]}" + }, + + "sum function": { + "scope": "art", + "prefix": "sum", + "body": "sum ${1|block,@[]}" + }, + + "sum sign": { + "scope": "art", + "prefix": "sum", + "body": "∑ ${1|block,@[]}" + }, + + "infinite constant": { + "scope": "art", + "prefix": "infinity", + "body": "infinity" + }, + + "infinite sign": { + "scope": "art", + "prefix": "infinity", + "body": "∞" + }, + +} \ No newline at end of file From 55e8bd4b4b62cc64d3b9aacdb5e847efb7ed66c9 Mon Sep 17 00:00:00 2001 From: RickBarretto <78623871+RickBarretto@users.noreply.github.com> Date: Sun, 26 May 2024 16:22:27 -0300 Subject: [PATCH 08/10] move and rename snippets --- .../arithmetic.arturo.code-snippets => snippets/arithmetic.json | 0 .vscode/core.arturo.code-snippets => snippets/core.json | 0 .vscode/logic.arturo.code-snippets => snippets/logic.json | 0 .vscode/numbers.arturo.code-snippets => snippets/numbers.json | 0 .vscode/sets.arturo.code-snippets => snippets/sets.arturo.json | 0 5 files changed, 0 insertions(+), 0 deletions(-) rename .vscode/arithmetic.arturo.code-snippets => snippets/arithmetic.json (100%) rename .vscode/core.arturo.code-snippets => snippets/core.json (100%) rename .vscode/logic.arturo.code-snippets => snippets/logic.json (100%) rename .vscode/numbers.arturo.code-snippets => snippets/numbers.json (100%) rename .vscode/sets.arturo.code-snippets => snippets/sets.arturo.json (100%) diff --git a/.vscode/arithmetic.arturo.code-snippets b/snippets/arithmetic.json similarity index 100% rename from .vscode/arithmetic.arturo.code-snippets rename to snippets/arithmetic.json diff --git a/.vscode/core.arturo.code-snippets b/snippets/core.json similarity index 100% rename from .vscode/core.arturo.code-snippets rename to snippets/core.json diff --git a/.vscode/logic.arturo.code-snippets b/snippets/logic.json similarity index 100% rename from .vscode/logic.arturo.code-snippets rename to snippets/logic.json diff --git a/.vscode/numbers.arturo.code-snippets b/snippets/numbers.json similarity index 100% rename from .vscode/numbers.arturo.code-snippets rename to snippets/numbers.json diff --git a/.vscode/sets.arturo.code-snippets b/snippets/sets.arturo.json similarity index 100% rename from .vscode/sets.arturo.code-snippets rename to snippets/sets.arturo.json From fa24926ecedb1af3d5a176390f85b461d7fa16b8 Mon Sep 17 00:00:00 2001 From: RickBarretto <78623871+RickBarretto@users.noreply.github.com> Date: Sun, 26 May 2024 16:24:02 -0300 Subject: [PATCH 09/10] fix json syntax --- snippets/core.json | 12 ++++++------ snippets/logic.json | 2 +- snippets/numbers.json | 2 +- snippets/sets.arturo.json | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/snippets/core.json b/snippets/core.json index 396738a..e3909ff 100644 --- a/snippets/core.json +++ b/snippets/core.json @@ -224,7 +224,7 @@ " ${2:action}", " ][", " ${3:alternative}", - "]", + "]" ] }, @@ -297,7 +297,7 @@ "prefix": "if?", "body": [ "if? ${1:condition} -> ${2:action}}", - "else -> ${3:alternative}", + "else -> ${3:alternative}" ] }, @@ -309,7 +309,7 @@ " ${2:action}", "] else [", " ${3:alternative}", - "]", + "]" ] }, @@ -318,7 +318,7 @@ "prefix": "unless?", "body": [ "unless? ${1:condition} -> ${2:action}}", - "else -> ${3:alternative}", + "else -> ${3:alternative}" ] }, @@ -330,7 +330,7 @@ " ${2:action}", "] else [", " ${3:alternative}", - "]", + "]" ] }, @@ -360,6 +360,6 @@ "scope": "art", "prefix": "null", "body": "∅" - }, + } } \ No newline at end of file diff --git a/snippets/logic.json b/snippets/logic.json index 415a3df..180f655 100644 --- a/snippets/logic.json +++ b/snippets/logic.json @@ -112,6 +112,6 @@ "scope": "art", "prefix": "maybe", "body": "maybe" - }, + } } \ No newline at end of file diff --git a/snippets/numbers.json b/snippets/numbers.json index e6acaef..ed3a3fa 100644 --- a/snippets/numbers.json +++ b/snippets/numbers.json @@ -34,6 +34,6 @@ "scope": "art", "prefix": "infinity", "body": "∞" - }, + } } \ No newline at end of file diff --git a/snippets/sets.arturo.json b/snippets/sets.arturo.json index 0db0ff0..c16d1c8 100644 --- a/snippets/sets.arturo.json +++ b/snippets/sets.arturo.json @@ -82,6 +82,6 @@ "scope": "art", "prefix": "superset?", "body": "(${1|block,@[]}) ⊃ (${2|block,@[]})" - }, + } } \ No newline at end of file From 1281f80890d131284dafbf7435827d8764bda953 Mon Sep 17 00:00:00 2001 From: RickBarretto <78623871+RickBarretto@users.noreply.github.com> Date: Sun, 26 May 2024 16:24:17 -0300 Subject: [PATCH 10/10] index snippets --- package.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/package.json b/package.json index 33713b3..82a68f5 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,12 @@ "extensions": [".art"], "configuration": "./language-configuration.json" }], + "snippets": [ + { + "language": "arturo", + "path": "./snippets/*.json" + } + ], "grammars": [{ "language": "art", "scopeName": "source.arturo",