Skip to content

Commit

Permalink
Add snippets support for the Visual Studio Code text editor
Browse files Browse the repository at this point in the history
  • Loading branch information
pmoura committed Mar 24, 2017
1 parent 3edbd2d commit 79e2af4
Show file tree
Hide file tree
Showing 3 changed files with 166 additions and 0 deletions.
2 changes: 2 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ IDEs, text editors, and syntax highlighters support

* UPDATED: IntelliJ IDEA plug-in. Contributed by Sergio Castro.

* ADDED: Snippets support for the Visual Studio Code text editor.

* FIXED: Renamed Visual Studio Code directory to `vscode`.


Expand Down
6 changes: 6 additions & 0 deletions coding/vscode/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ To install, copy the `pmoura.logtalk-0.0` folder to the following folder:

(create the folder if it does not exist).

The `logtalk.json` file defines snippets for defining entities and predicates.
To install it, select the `Preferences > User Snippets` menu item and choose
`Logtalk` in the resulting menu. This will open a `logtalk.json` file in the
correct location. Replace or update the contents of this file with the file
provided here.

Logtalk source files (including the library entities and the programming
examples) are formatted using tabs (the recommended setting is a tab width
equivalent to 4 spaces); you may set the tab width on the editor preference
Expand Down
158 changes: 158 additions & 0 deletions coding/vscode/logtalk.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
{
"category": {
"prefix": "category",
"body": "\n:- category(${1:Category},\n\timplements(${2:Protocol})).\n\n\t:- info([\n\t\tversion is 1.0,\n\t\tauthor is '$TM_FULLNAME',\n\t\tdate is `date +%Y/%m/%d`,\n\t\tcomment is '${3:Description}'\n\t]).\n\n$0\n\n:- end_category.\n",
"description": "Category with protocol",
"scope": "source.logtalk"
},
"category1": {
"prefix": "category",
"body": "\n:- category(${1:Category}).\n\n\t:- info([\n\t\tversion is 1.0,\n\t\tauthor is '$TM_FULLNAME',\n\t\tdate is `date +%Y/%m/%d`,\n\t\tcomment is '${2:Description}'\n\t]).\n\n$0\n\n:- end_category.\n",
"description": "Category",
"scope": "source.logtalk"
},
"class": {
"prefix": "class",
"body": "\n:- object(${1:Class},\n\timplements(${2:Protocol}),\n\timports(${3:Category}),\n\tinstantiates(${4:Metaclass}),\n\tspecializes(${5:Superclass})).\n\n\t:- info([\n\t\tversion is 1.0,\n\t\tauthor is '$TM_FULLNAME',\n\t\tdate is `date +%Y/%m/%d`,\n\t\tcomment is '${6:Description}'\n\t]).\n\n$0\n\n:- end_object.\n",
"description": "Class with all",
"scope": "source.logtalk"
},
"class1": {
"prefix": "class",
"body": "\n:- object(${1:Class},\n\timports(${2:Category}),\n\tspecializes(${3:Superclass})).\n\n\t:- info([\n\t\tversion is 1.0,\n\t\tauthor is '$TM_FULLNAME',\n\t\tdate is `date +%Y/%m/%d`,\n\t\tcomment is '${4:Description}'\n\t]).\n\n$0\n\n:- end_object.\n",
"description": "Class with category",
"scope": "source.logtalk"
},
"class2": {
"prefix": "class",
"body": "\n:- object(${1:Class},\n\tinstantiates(${2:Metaclass}),\n\tspecializes(${3:Superclass})).\n\n\t:- info([\n\t\tversion is 1.0,\n\t\tauthor is '$TM_FULLNAME',\n\t\tdate is `date +%Y/%m/%d`,\n\t\tcomment is '${4:Description}'\n\t]).\n\n$0\n\n:- end_object.\n",
"description": "Class with metaclass",
"scope": "source.logtalk"
},
"class3": {
"prefix": "class",
"body": "\n:- object(${1:Class},\n\timplements(${2:Protocol}),\n\tspecializes(${3:Superclass})).\n\n\t:- info([\n\t\tversion is 1.0,\n\t\tauthor is '$TM_FULLNAME',\n\t\tdate is `date +%Y/%m/%d`,\n\t\tcomment is '${4:Description}'\n\t]).\n\n$0\n\n:- end_object.\n",
"description": "Class with protocol",
"scope": "source.logtalk"
},
"class4": {
"prefix": "class",
"body": "\n:- object(${1:Class},\n\tspecializes(${2:Superclass})).\n\n\t:- info([\n\t\tversion is 1.0,\n\t\tauthor is '$TM_FULLNAME',\n\t\tdate is `date +%Y/%m/%d`,\n\t\tcomment is '${3:Description}'\n\t]).\n\n$0\n\n:- end_object.\n",
"description": "Class",
"scope": "source.logtalk"
},
"category2": {
"prefix": "category",
"body": "\n:- category(${1:Category},\n\tcomplements(${2:Object})).\n\n\t:- info([\n\t\tversion is 1.0,\n\t\tauthor is '$TM_FULLNAME',\n\t\tdate is `date +%Y/%m/%d`,\n\t\tcomment is '${3:Description}'\n\t]).\n\n$0\n\n:- end_category.\n",
"description": "Complementing category",
"scope": "source.logtalk"
},
"category3": {
"prefix": "category",
"body": "\n:- category(${1:ExtendedCategory},\n\textends(${2:MinimalCategory})).\n\n\t:- info([\n\t\tversion is 1.0,\n\t\tauthor is '$TM_FULLNAME',\n\t\tdate is `date +%Y/%m/%d`,\n\t\tcomment is '${3:Description}'\n\t]).\n\n$0\n\n:- end_category.\n",
"description": "Extended category",
"scope": "source.logtalk"
},
"protocol": {
"prefix": "protocol",
"body": "\n:- protocol(${1:Extended},\n\textends(${2:Minimal})).\n\n\t:- info([\n\t\tversion is 1.0,\n\t\tauthor is '$TM_FULLNAME',\n\t\tdate is `date +%Y/%m/%d`,\n\t\tcomment is '${3:Description}'\n\t]).\n\n$0\n\n:- end_protocol.\n",
"description": "Extended protocol",
"scope": "source.logtalk"
},
"instance": {
"prefix": "instance",
"body": "\n:- object(${1:Instance},\n\timplements(${2:Protocol}),\n\timports(${3:Category}),\n\tinstantiates(${4:Class})).\n\n\t:- info([\n\t\tversion is 1.0,\n\t\tauthor is '$TM_FULLNAME',\n\t\tdate is `date +%Y/%m/%d`,\n\t\tcomment is '${5:Description}'\n\t]).\n\n$0\n\n:- end_object.\n",
"description": "Instance with all",
"scope": "source.logtalk"
},
"instance1": {
"prefix": "instance",
"body": "\n:- object(${1:Instance},\n\timports(${2:Category}),\n\tinstantiates(${3:Class})).\n\n\t:- info([\n\t\tversion is 1.0,\n\t\tauthor is '$TM_FULLNAME',\n\t\tdate is `date +%Y/%m/%d`,\n\t\tcomment is '${4:Description}'\n\t]).\n\n$0\n\n:- end_object.\n",
"description": "Instance with category",
"scope": "source.logtalk"
},
"instance2": {
"prefix": "instance",
"body": "\n:- object(${1:Instance},\n\timplements(${2:Protocol}),\n\tinstantiates(${3:Class})).\n\n\t:- info([\n\t\tversion is 1.0,\n\t\tauthor is '$TM_FULLNAME',\n\t\tdate is `date +%Y/%m/%d`,\n\t\tcomment is '${4:Description}'\n\t]).\n\n$0\n\n:- end_object.\n",
"description": "Instance with protocol",
"scope": "source.logtalk"
},
"instance3": {
"prefix": "instance",
"body": "\n:- object(${1:Instance},\n\tinstantiates(${2:Class})).\n\n\t:- info([\n\t\tversion is 1.0,\n\t\tauthor is '$TM_FULLNAME',\n\t\tdate is `date +%Y/%m/%d`,\n\t\tcomment is '${3:Description}'\n\t]).\n\n$0\n\n:- end_object.\n",
"description": "Instance",
"scope": "source.logtalk"
},
"private": {
"prefix": "private",
"body": "\t:- private(${1:Functor}/0).\n\t:- mode(${1:Functor}, ${2:Solutions}).\n\t:- info(${1:Functor}/0, [\n\t\tcomment is '${3:Description}'\n\t]).\n\n$0",
"description": "Private predicate (with no arguments)",
"scope": "source.logtalk"
},
"private1": {
"prefix": "private",
"body": "\t:- private(${1:Functor}/${2:Arity}).\n\t:- mode(${1:Functor}(${3:Arguments}), ${4:Solutions}).\n\t:- info(${1:Functor}/${2:Arity}, [\n\t\tcomment is '${5:Description}',\n\t\targuments is ['$6'-'$7']\n\t]).\n\n$0",
"description": "Private predicate",
"scope": "source.logtalk"
},
"protected": {
"prefix": "protected",
"body": "\t:- protected(${1:Functor}/0).\n\t:- mode(${1:Functor}, ${2:Solutions}).\n\t:- info(${1:Functor}/0, [\n\t\tcomment is '${3:Description}'\n\t]).\n\n$0",
"description": "Protected predicate (with no arguments)",
"scope": "source.logtalk"
},
"protected1": {
"prefix": "protected",
"body": "\t:- protected(${1:Functor}/${2:Arity}).\n\t:- mode(${1:Functor}(${3:Arguments}), ${4:Solutions}).\n\t:- info(${1:Functor}/${2:Arity}, [\n\t\tcomment is '${5:Description}',\n\t\targuments is ['$6'-'$7']\n\t]).\n\n$0",
"description": "Protected predicate",
"scope": "source.logtalk"
},
"protocol1": {
"prefix": "protocol",
"body": "\n:- protocol(${1:Protocol}).\n\n\t:- info([\n\t\tversion is 1.0,\n\t\tauthor is '$TM_FULLNAME',\n\t\tdate is `date +%Y/%m/%d`,\n\t\tcomment is '${2:Description}'\n\t]).\n\n$0\n\n:- end_protocol.\n",
"description": "Protocol",
"scope": "source.logtalk"
},
"object": {
"prefix": "object",
"body": "\n:- object(${1:Prototype},\n\timplements(${2:Protocol}),\n\timports(${3:Category}),\n\textends(${4:Parent})).\n\n\t:- info([\n\t\tversion is 1.0,\n\t\tauthor is '$TM_FULLNAME',\n\t\tdate is `date +%Y/%m/%d`,\n\t\tcomment is '${5:Description}'\n\t]).\n\n$0\n\n:- end_object.\n",
"description": "Prototype with all",
"scope": "source.logtalk"
},
"object1": {
"prefix": "object",
"body": "\n:- object(${1:Prototype},\n\timports(${2:Category})).\n\n\t:- info([\n\t\tversion is 1.0,\n\t\tauthor is '$TM_FULLNAME',\n\t\tdate is `date +%Y/%m/%d`,\n\t\tcomment is '${3:Description}'\n\t]).\n\n$0\n\n:- end_object.\n",
"description": "Prototype with category",
"scope": "source.logtalk"
},
"object2": {
"prefix": "object",
"body": "\n:- object(${1:Prototype},\n\textends(${2:Parent})).\n\n\t:- info([\n\t\tversion is 1.0,\n\t\tauthor is '$TM_FULLNAME',\n\t\tdate is `date +%Y/%m/%d`,\n\t\tcomment is '${3:Description}'\n\t]).\n\n$0\n\n:- end_object.\n",
"description": "Prototype with parent",
"scope": "source.logtalk"
},
"object3": {
"prefix": "object",
"body": "\n:- object(${1:Prototype},\n\timplements(${2:Protocol})).\n\n\t:- info([\n\t\tversion is 1.0,\n\t\tauthor is '$TM_FULLNAME',\n\t\tdate is `date +%Y/%m/%d`,\n\t\tcomment is '${3:Description}'\n\t]).\n\n$0\n\n:- end_object.\n",
"description": "Prototype with protocol",
"scope": "source.logtalk"
},
"object4": {
"prefix": "object",
"body": "\n:- object(${1:Object}).\n\n\t:- info([\n\t\tversion is 1.0,\n\t\tauthor is '$TM_FULLNAME',\n\t\tdate is `date +%Y/%m/%d`,\n\t\tcomment is '${2:Description}'\n\t]).\n\n$0\n\n:- end_object.\n",
"description": "Prototype",
"scope": "source.logtalk"
},
"public": {
"prefix": "public",
"body": "\t:- public(${1:Functor}/0).\n\t:- mode(${1:Functor}, ${2:Solutions}).\n\t:- info(${1:Functor}/0, [\n\t\tcomment is '${3:Description}'\n\t]).\n\n$0",
"description": "Public predicate (with no arguments)",
"scope": "source.logtalk"
},
"public1": {
"prefix": "public",
"body": "\t:- public(${1:Functor}/${2:Arity}).\n\t:- mode(${1:Functor}(${3:Arguments}), ${4:Solutions}).\n\t:- info(${1:Functor}/${2:Arity}, [\n\t\tcomment is '${5:Description}',\n\t\targuments is ['$6'-'$7']\n\t]).\n\n$0",
"description": "Public predicate",
"scope": "source.logtalk"
}
}

0 comments on commit 79e2af4

Please sign in to comment.