Browse Source

Upgrade packages, modify syntaxes and snippets for constructor

also modifying constant for view, adding public on snippets
Juan Blanco 2 years ago
parent
commit
27f6247d42
5 changed files with 1051 additions and 1319 deletions
  1. 1019 1306
      package-lock.json
  2. 10 9
      package.json
  3. 8 4
      snippets/solidity.json
  4. BIN
      solidity-0.0.41.vsix
  5. 14 0
      syntaxes/solidity.json

File diff suppressed because it is too large
+ 1019 - 1306
package-lock.json


+ 10 - 9
package.json

@@ -8,7 +8,7 @@
     "compiler",
     "solhint"
   ],
-  "version": "0.0.40",
+  "version": "0.0.41",
   "publisher": "JuanBlanco",
   "engines": {
     "vscode": "^1.21.0"
@@ -46,24 +46,25 @@
   },
   "dependencies": {
     "abi-code-gen": "0.0.3",
-    "ajv": "^6.3.0",
+    "ajv": "^6.4.0",
     "fs-extra": "^4.0.3",
+    "minipass": "^2.2.4",
     "nethereum-codegen": "^1.0.1",
     "read-yaml": "^1.1.0",
     "solc": "^0.4.23",
     "solhint": "^1.1.10",
-    "solium": "^1.1.6",
-    "solparse": "^2.2.4",
+    "solium": "^1.1.7",
+    "solparse": "^2.2.5",
     "truffle-artifactor": "^2.1.4",
-    "vscode-languageclient": "^4.0.0",
-    "vscode-languageserver": "^4.0.0",
+    "vscode-languageclient": "^4.1.3",
+    "vscode-languageserver": "^4.1.2",
     "vscode-uri": "^1.0.3"
   },
   "devDependencies": {
-    "@types/node": "^9.6.1",
+    "@types/node": "^9.6.7",
     "tslint": "^5.9.1",
-    "typescript": "^2.8.1",
-    "vscode": "^1.1.14"
+    "typescript": "^2.8.3",
+    "vscode": "^1.1.16"
   },
   "contributes": {
     "configuration": {

+ 8 - 4
snippets/solidity.json

@@ -27,7 +27,11 @@
         "mapping declaration":{
             "prefix": "map",
 			"body": "mapping (${1:type1}=>${2:type2}) ${3:name};"
-        },
+		},
+		"constructor declaration": {
+			"prefix": "const",
+			"body": "constructor (${1:type} ${2:name}) public {\n\t$0\n}"
+		},
         "function declaration": {
 			"prefix": "func",
 			"body": "function ${1:name}(${2:type} ${3:name}) {\n\t$0\n}"
@@ -37,9 +41,9 @@
 			"body": "function ${1:name}(${2:type} ${3:name}) returns (${4:type} ${5:name}) {\n\t$0\n}"
 		}
         ,
-        "function constant declaration": {
-			"prefix": "funcrc",
-			"body": "function ${1:name}(${2:type} ${3:name}) constant returns (${4:type} ${5:name}) {\n\t$0\n}"
+        "function view declaration": {
+			"prefix": "funcrview",
+			"body": "function ${1:name}(${2:type} ${3:name}) view public returns (${4:type} ${5:name}) {\n\t$0\n}"
         },
         "event declaration": {
 			"prefix": "ev",

BIN
solidity-0.0.41.vsix


+ 14 - 0
syntaxes/solidity.json

@@ -291,6 +291,9 @@
                 {
                     "include": "#declaration-function"
                 },
+                {
+                    "include": "#declaration-constructor"
+                },
                 {
                     "include": "#declaration-modifier"
                 },
@@ -362,6 +365,17 @@
                 }
             }
         },
+        "declaration-constructor": {
+                "match": "\\b(constructor)(\\s+([A-Za-z_]\\w*))?\\b",
+                "captures": {
+                    "1": {
+                        "name": "storage.type.constructor.solidity"
+                    },
+                    "2": {
+                        "name": "entity.name.constructor.solidity"
+                    }
+                }
+        },
         "declaration-enum": {
             "match": "\\b(enum)(\\s+([A-Za-z_]\\w*))?\\b",
             "captures": {