From 72d6cd29dd84dcd3917efea6c0e00322e256eae7 Mon Sep 17 00:00:00 2001 From: sfaray Date: Thu, 28 May 2026 20:01:33 +0700 Subject: [PATCH 1/3] updated the packages --- .vscode/launch.json | 2 - package-lock.json | 2640 +++------------------------------- package.json | 24 +- src/completion.ts | 26 +- src/definitions.ts | 36 +- src/extension.ts | 50 +- src/nodemap.ts | 594 ++++---- src/wordcount.ts | 264 ++-- syntaxes/ink.tmLanguage | 670 --------- syntaxes/ink.tmLanguage.json | 435 ++++++ syntaxes/ink.tmLanguage.yaml | 250 ++++ tsconfig.json | 7 +- 12 files changed, 1374 insertions(+), 3624 deletions(-) delete mode 100644 syntaxes/ink.tmLanguage create mode 100644 syntaxes/ink.tmLanguage.json create mode 100644 syntaxes/ink.tmLanguage.yaml diff --git a/.vscode/launch.json b/.vscode/launch.json index 9eabf9b..65f9da1 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,4 +1,3 @@ -// A launch configuration that launches the extension inside a new window { "version": "0.1.0", "configurations": [ @@ -8,7 +7,6 @@ "request": "launch", "runtimeExecutable": "${execPath}", "args": ["--extensionDevelopmentPath=${workspaceRoot}" ], - "stopOnEntry": false, "sourceMaps": true, "outFiles": [ "${workspaceRoot}/out/**/*.js" ], "preLaunchTask": "npm: watch" diff --git a/package-lock.json b/package-lock.json index 4dbbb98..878f13b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,2564 +1,300 @@ { "name": "ink", - "version": "1.0.0", - "lockfileVersion": 1, + "version": "1.3.1", + "lockfileVersion": 3, "requires": true, - "dependencies": { - "@types/node": { - "version": "8.0.34", - "resolved": "https://registry.npmjs.org/@types/node/-/node-8.0.34.tgz", - "integrity": "sha512-Jnmm57+nHqvJUPwUzt1CLoLzFtF2B2vgG7cWFut+a4nqTp9/L6pL0N+o0Jt3V7AQnCKMsPEqQpLFZYleBCdq3w==", - "dev": true - }, - "ajv": { - "version": "5.2.3", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.2.3.tgz", - "integrity": "sha1-wG9Zh3jETGsWGrr+NGa4GtGBTtI=", - "dev": true, - "requires": { - "co": "4.6.0", - "fast-deep-equal": "1.0.0", - "json-schema-traverse": "0.3.1", - "json-stable-stringify": "1.0.1" - } - }, - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true - }, - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "arr-diff": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", - "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", - "dev": true, - "requires": { - "arr-flatten": "1.1.0" - } - }, - "arr-flatten": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", - "dev": true - }, - "array-differ": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-1.0.0.tgz", - "integrity": "sha1-7/UuN1gknTO+QCuLuOVkuytdQDE=", - "dev": true - }, - "array-union": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", - "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", - "dev": true, - "requires": { - "array-uniq": "1.0.3" - } - }, - "array-uniq": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", - "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", - "dev": true - }, - "array-unique": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", - "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", - "dev": true - }, - "arrify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", - "dev": true - }, - "asn1": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", - "integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y=", - "dev": true - }, - "assert-plus": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz", - "integrity": "sha1-104bh+ev/A24qttwIfP+SBAasjQ=", - "dev": true - }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", - "dev": true - }, - "aws-sign2": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", - "integrity": "sha1-FDQt0428yU0OW4fXY81jYSwOeU8=", - "dev": true - }, - "aws4": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz", - "integrity": "sha1-g+9cqGCysy5KDe7e6MdxudtXRx4=", - "dev": true - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true - }, - "bcrypt-pbkdf": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", - "integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=", - "dev": true, - "optional": true, - "requires": { - "tweetnacl": "0.14.5" - } - }, - "beeper": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/beeper/-/beeper-1.1.1.tgz", - "integrity": "sha1-5tXqjF2tABMEpwsiY4RH9pyy+Ak=", - "dev": true - }, - "block-stream": { - "version": "0.0.9", - "resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz", - "integrity": "sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo=", - "dev": true, - "requires": { - "inherits": "2.0.3" + "packages": { + "": { + "name": "ink", + "version": "1.3.1", + "hasInstallScript": true, + "license": "MIT", + "devDependencies": { + "@types/node": "^25.9.1", + "@types/vscode": "^1.120.0", + "js-yaml": "^4.1.1", + "typescript": "^6.0.3", + "vscode-test": "^1.4.1" + }, + "engines": { + "vscode": "^1.16.0" } }, - "boom": { - "version": "2.10.1", - "resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", - "integrity": "sha1-OciRjO/1eZ+D+UkqhI9iWt0Mdm8=", + "node_modules/@types/node": { + "version": "25.9.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-25.9.1.tgz", + "integrity": "sha512-xfrlY7UD5rMJk3ZVJP8BNzS28J36YJg+xp+LPXV1TdWxr8uMH5A860QNxYDGQe/ylDSgjxE52Q9VnO7p75tJxg==", "dev": true, - "requires": { - "hoek": "2.16.3" + "license": "MIT", + "dependencies": { + "undici-types": ">=7.24.0 <7.24.7" } }, - "brace-expansion": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz", - "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", + "node_modules/@types/vscode": { + "version": "1.120.0", + "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.120.0.tgz", + "integrity": "sha512-feaT4Rst+FkTch5zz/ZbNCxoIvo55YU80Be2kiL7OJcod4+CUYf2lUBPdIJzozNnSEMq1VRTGrWEcCGFB3fBmA==", "dev": true, - "requires": { - "balanced-match": "1.0.0", - "concat-map": "0.0.1" - } + "license": "MIT" }, - "braces": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", - "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", + "node_modules/agent-base": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz", + "integrity": "sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==", "dev": true, - "requires": { - "expand-range": "1.8.2", - "preserve": "0.2.0", - "repeat-element": "1.1.2" + "license": "MIT", + "dependencies": { + "es6-promisify": "^5.0.0" + }, + "engines": { + "node": ">= 4.0.0" } }, - "browser-stdout": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.0.tgz", - "integrity": "sha1-81HTKWnTL6XXpVZxVCY9korjvR8=", - "dev": true - }, - "buffer-crc32": { - "version": "0.2.13", - "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", - "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=", - "dev": true - }, - "caseless": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz", - "integrity": "sha1-cVuW6phBWTzDMGeSP17GDr2k99c=", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true, - "requires": { - "ansi-styles": "2.2.1", - "escape-string-regexp": "1.0.5", - "has-ansi": "2.0.0", - "strip-ansi": "3.0.1", - "supports-color": "2.0.0" - } + "license": "Python-2.0" }, - "clone": { + "node_modules/balanced-match": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.2.tgz", - "integrity": "sha1-Jgt6meux7f4kdTgXX3gyQ8sZ0Uk=", - "dev": true - }, - "clone-buffer": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/clone-buffer/-/clone-buffer-1.0.0.tgz", - "integrity": "sha1-4+JbIHrE5wGvch4staFnksrD3Fg=", - "dev": true - }, - "clone-stats": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-0.0.1.tgz", - "integrity": "sha1-uI+UqCzzi4eR1YBG6kAprYjKmdE=", - "dev": true - }, - "cloneable-readable": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/cloneable-readable/-/cloneable-readable-1.0.0.tgz", - "integrity": "sha1-pikNQT8hemEjL5XkWP84QYz7ARc=", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dev": true, - "requires": { - "inherits": "2.0.3", - "process-nextick-args": "1.0.7", - "through2": "2.0.3" - } - }, - "co": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", - "dev": true + "license": "MIT" }, - "combined-stream": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz", - "integrity": "sha1-k4NwpXtKUd6ix3wV1cX9+JUWQAk=", + "node_modules/brace-expansion": { + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.15.tgz", + "integrity": "sha512-EwOCDEex4quD37XhqM3omwtMoJjr//isUZz1JopUNWms+4Z2ViyM/k1YIRePpoVNnQhENnxtFjLaxNHrT7xIUg==", "dev": true, - "requires": { - "delayed-stream": "1.0.0" + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" } }, - "commander": { - "version": "2.11.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.11.0.tgz", - "integrity": "sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ==", - "dev": true - }, - "concat-map": { + "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true - }, - "convert-source-map": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.5.0.tgz", - "integrity": "sha1-ms1whRxtXf3ZPZKC5e35SgP/RrU=", - "dev": true - }, - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", - "dev": true - }, - "cryptiles": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", - "integrity": "sha1-O9/s3GCBR8HGcgL6KR59ylnqo7g=", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "dev": true, - "requires": { - "boom": "2.10.1" - } + "license": "MIT" }, - "dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", - "dev": true, - "requires": { - "assert-plus": "1.0.0" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "dev": true - } - } - }, - "dateformat": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-2.2.0.tgz", - "integrity": "sha1-QGXiATz5+5Ft39gu+1Bq1MZ2kGI=", - "dev": true - }, - "debug": { + "node_modules/debug": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "deep-assign": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/deep-assign/-/deep-assign-1.0.0.tgz", - "integrity": "sha1-sJJ0O+hCfcYh6gBnzex+cN0Z83s=", - "dev": true, - "requires": { - "is-obj": "1.0.1" - } - }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", - "dev": true - }, - "diff": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.3.1.tgz", - "integrity": "sha512-MKPHZDMB0o6yHyDryUOScqZibp914ksXwAMYMTHj6KO8UeKsRYNJD3oNCKjTqZon+V488P7N/HzXF8t7ZR95ww==", - "dev": true - }, - "duplexer": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", - "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=", - "dev": true - }, - "duplexer2": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.0.2.tgz", - "integrity": "sha1-xhTc9n4vsUmVqRcR5aYX6KYKMds=", - "dev": true, - "requires": { - "readable-stream": "1.1.14" - }, + "license": "MIT", "dependencies": { - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "dev": true - }, - "readable-stream": { - "version": "1.1.14", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", - "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "0.0.1", - "string_decoder": "0.10.31" - } - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", - "dev": true - } - } - }, - "duplexify": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.5.1.tgz", - "integrity": "sha512-j5goxHTwVED1Fpe5hh3q9R93Kip0Bg2KVAt4f8CEYM3UEwYcPSvWbXaUQOzdX/HtiNomipv+gU7ASQPDbV7pGQ==", - "dev": true, - "requires": { - "end-of-stream": "1.4.0", - "inherits": "2.0.3", - "readable-stream": "2.3.3", - "stream-shift": "1.0.0" - } - }, - "ecc-jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", - "integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=", - "dev": true, - "optional": true, - "requires": { - "jsbn": "0.1.1" - } - }, - "end-of-stream": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.0.tgz", - "integrity": "sha1-epDYM+/abPpurA9JSduw+tOmMgY=", - "dev": true, - "requires": { - "once": "1.4.0" - } - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true - }, - "event-stream": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz", - "integrity": "sha1-SrTJoPWlTbkzi0w02Gv86PSzVXE=", - "dev": true, - "requires": { - "duplexer": "0.1.1", - "from": "0.1.7", - "map-stream": "0.1.0", - "pause-stream": "0.0.11", - "split": "0.3.3", - "stream-combiner": "0.0.4", - "through": "2.3.8" - } - }, - "expand-brackets": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", - "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", - "dev": true, - "requires": { - "is-posix-bracket": "0.1.1" + "ms": "2.0.0" } }, - "expand-range": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", - "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", + "node_modules/es6-promise": { + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", + "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==", "dev": true, - "requires": { - "fill-range": "2.2.3" - } + "license": "MIT" }, - "extend": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", - "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=", - "dev": true - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "node_modules/es6-promisify": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", + "integrity": "sha512-C+d6UdsYDk0lMebHNR4S2NybQMMngAOnOwYBQjTOiv0MkoJMP0Myw2mgpDLBcpfCmRLxyFqYhS/CfOENq4SJhQ==", "dev": true, - "requires": { - "is-extendable": "0.1.1" - } - }, - "extglob": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", - "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", - "dev": true, - "requires": { - "is-extglob": "1.0.0" - }, + "license": "MIT", "dependencies": { - "is-extglob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", - "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", - "dev": true - } - } - }, - "extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", - "dev": true - }, - "fancy-log": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/fancy-log/-/fancy-log-1.3.0.tgz", - "integrity": "sha1-Rb4X0Cu5kX1gzP/UmVyZnmyMmUg=", - "dev": true, - "requires": { - "chalk": "1.1.3", - "time-stamp": "1.1.0" + "es6-promise": "^4.0.3" } }, - "fast-deep-equal": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.0.0.tgz", - "integrity": "sha1-liVqO8l1WV6zbYLpkp0GDYk0Of8=", - "dev": true - }, - "fd-slicer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.0.1.tgz", - "integrity": "sha1-i1vL2ewyfFBBv5qwI/1nUPEXfmU=", - "dev": true, - "requires": { - "pend": "1.2.0" - } - }, - "filename-regex": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", - "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=", - "dev": true - }, - "fill-range": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz", - "integrity": "sha1-ULd9/X5Gm8dJJHCWNpn+eoSFpyM=", - "dev": true, - "requires": { - "is-number": "2.1.0", - "isobject": "2.1.0", - "randomatic": "1.1.7", - "repeat-element": "1.1.2", - "repeat-string": "1.6.1" - } - }, - "first-chunk-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/first-chunk-stream/-/first-chunk-stream-1.0.0.tgz", - "integrity": "sha1-Wb+1DNkF9g18OUzT2ayqtOatk04=", - "dev": true - }, - "for-in": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", - "dev": true - }, - "for-own": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", - "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", - "dev": true, - "requires": { - "for-in": "1.0.2" - } - }, - "forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", - "dev": true - }, - "form-data": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.1.4.tgz", - "integrity": "sha1-M8GDrPGTJ27KqYFDpp6Uv+4XUNE=", - "dev": true, - "requires": { - "asynckit": "0.4.0", - "combined-stream": "1.0.5", - "mime-types": "2.1.17" - } - }, - "from": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/from/-/from-0.1.7.tgz", - "integrity": "sha1-g8YK/Fi5xWmXAH7Rp2izqzA6RP4=", - "dev": true - }, - "fs.realpath": { + "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true - }, - "fstream": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz", - "integrity": "sha1-XB+x8RdHcRTwYyoOtLcbPLD9MXE=", - "dev": true, - "requires": { - "graceful-fs": "4.1.11", - "inherits": "2.0.3", - "mkdirp": "0.5.1", - "rimraf": "2.6.2" - } - }, - "generate-function": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz", - "integrity": "sha1-aFj+fAlpt9TpCTM3ZHrHn2DfvnQ=", - "dev": true - }, - "generate-object-property": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz", - "integrity": "sha1-nA4cQDCM6AT0eDYYuTf6iPmdUNA=", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "dev": true, - "requires": { - "is-property": "1.0.2" - } + "license": "ISC" }, - "getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", "dev": true, - "requires": { - "assert-plus": "1.0.0" - }, + "license": "ISC", "dependencies": { - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "dev": true - } - } - }, - "glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", - "dev": true, - "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" - } - }, - "glob-base": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", - "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", - "dev": true, - "requires": { - "glob-parent": "2.0.0", - "is-glob": "2.0.1" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" }, - "dependencies": { - "glob-parent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", - "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", - "dev": true, - "requires": { - "is-glob": "2.0.1" - } - }, - "is-extglob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", - "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", - "dev": true - }, - "is-glob": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", - "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", - "dev": true, - "requires": { - "is-extglob": "1.0.0" - } - } - } - }, - "glob-parent": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", - "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", - "dev": true, - "requires": { - "is-glob": "3.1.0", - "path-dirname": "1.0.2" - } - }, - "glob-stream": { - "version": "5.3.5", - "resolved": "https://registry.npmjs.org/glob-stream/-/glob-stream-5.3.5.tgz", - "integrity": "sha1-pVZlqajM3EGRWofHAeMtTgFvrSI=", - "dev": true, - "requires": { - "extend": "3.0.1", - "glob": "5.0.15", - "glob-parent": "3.1.0", - "micromatch": "2.3.11", - "ordered-read-streams": "0.3.0", - "through2": "0.6.5", - "to-absolute-glob": "0.1.1", - "unique-stream": "2.2.1" + "engines": { + "node": "*" }, - "dependencies": { - "glob": { - "version": "5.0.15", - "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", - "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", - "dev": true, - "requires": { - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" - } - }, - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "dev": true - }, - "readable-stream": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "0.0.1", - "string_decoder": "0.10.31" - } - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", - "dev": true - }, - "through2": { - "version": "0.6.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz", - "integrity": "sha1-QaucZ7KdVyCQcUEOHXp6lozTrUg=", - "dev": true, - "requires": { - "readable-stream": "1.0.34", - "xtend": "4.0.1" - } - } - } - }, - "glogg": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/glogg/-/glogg-1.0.0.tgz", - "integrity": "sha1-f+DxmfV6yQbPUS/urY+Q7kooT8U=", - "dev": true, - "requires": { - "sparkles": "1.0.0" + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "graceful-fs": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", - "dev": true - }, - "growl": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.3.tgz", - "integrity": "sha512-hKlsbA5Vu3xsh1Cg3J7jSmX/WaW6A5oBeqzM88oNbCRQFz+zUaXm6yxS4RVytp1scBoJzSYl4YAEOQIt6O8V1Q==", - "dev": true - }, - "gulp-chmod": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/gulp-chmod/-/gulp-chmod-2.0.0.tgz", - "integrity": "sha1-AMOQuSigeZslGsz2MaoJ4BzGKZw=", - "dev": true, - "requires": { - "deep-assign": "1.0.0", - "stat-mode": "0.2.2", - "through2": "2.0.3" - } - }, - "gulp-filter": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/gulp-filter/-/gulp-filter-5.0.1.tgz", - "integrity": "sha512-5olRzAhFdXB2klCu1lnazP65aO9YdA/5WfC9VdInIc8PrUeDIoZfaA3Edb0yUBGhVdHv4eHKL9Fg5tUoEJ9z5A==", - "dev": true, - "requires": { - "gulp-util": "3.0.8", - "multimatch": "2.1.0", - "streamfilter": "1.0.5" - } - }, - "gulp-gunzip": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/gulp-gunzip/-/gulp-gunzip-1.0.0.tgz", - "integrity": "sha1-FbdBFF6Dqcb1CIYkG1fMWHHxUak=", + "node_modules/http-proxy-agent": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz", + "integrity": "sha512-qwHbBLV7WviBl0rQsOzH6o5lwyOIvwp/BdFnvVxXORldu5TmjFfjzBcWUWS5kWAZhmv+JtiDhSuQCp4sBfbIgg==", "dev": true, - "requires": { - "through2": "0.6.5", - "vinyl": "0.4.6" - }, + "license": "MIT", "dependencies": { - "clone": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/clone/-/clone-0.2.0.tgz", - "integrity": "sha1-xhJqkK1Pctv1rNskPMN3JP6T/B8=", - "dev": true - }, - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "dev": true - }, - "readable-stream": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "0.0.1", - "string_decoder": "0.10.31" - } - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", - "dev": true - }, - "through2": { - "version": "0.6.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz", - "integrity": "sha1-QaucZ7KdVyCQcUEOHXp6lozTrUg=", - "dev": true, - "requires": { - "readable-stream": "1.0.34", - "xtend": "4.0.1" - } - }, - "vinyl": { - "version": "0.4.6", - "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-0.4.6.tgz", - "integrity": "sha1-LzVsh6VQolVGHza76ypbqL94SEc=", - "dev": true, - "requires": { - "clone": "0.2.0", - "clone-stats": "0.0.1" - } - } - } - }, - "gulp-remote-src": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/gulp-remote-src/-/gulp-remote-src-0.4.3.tgz", - "integrity": "sha1-VyjP1kNDPdSEXd7wlp8PlxoqtKE=", - "dev": true, - "requires": { - "event-stream": "3.3.4", - "node.extend": "1.1.6", - "request": "2.79.0", - "through2": "2.0.3", - "vinyl": "2.0.2" + "agent-base": "4", + "debug": "3.1.0" }, - "dependencies": { - "clone-stats": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-1.0.0.tgz", - "integrity": "sha1-s3gt/4u1R04Yuba/D9/ngvh3doA=", - "dev": true - }, - "replace-ext": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.0.tgz", - "integrity": "sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs=", - "dev": true - }, - "request": { - "version": "2.79.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.79.0.tgz", - "integrity": "sha1-Tf5b9r6LjNw3/Pk+BLZVd3InEN4=", - "dev": true, - "requires": { - "aws-sign2": "0.6.0", - "aws4": "1.6.0", - "caseless": "0.11.0", - "combined-stream": "1.0.5", - "extend": "3.0.1", - "forever-agent": "0.6.1", - "form-data": "2.1.4", - "har-validator": "2.0.6", - "hawk": "3.1.3", - "http-signature": "1.1.1", - "is-typedarray": "1.0.0", - "isstream": "0.1.2", - "json-stringify-safe": "5.0.1", - "mime-types": "2.1.17", - "oauth-sign": "0.8.2", - "qs": "6.3.2", - "stringstream": "0.0.5", - "tough-cookie": "2.3.3", - "tunnel-agent": "0.4.3", - "uuid": "3.1.0" - } - }, - "vinyl": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.0.2.tgz", - "integrity": "sha1-CjcT2NTpIhxY8QyhbAEWyeJe2nw=", - "dev": true, - "requires": { - "clone": "1.0.2", - "clone-buffer": "1.0.0", - "clone-stats": "1.0.0", - "cloneable-readable": "1.0.0", - "is-stream": "1.1.0", - "remove-trailing-separator": "1.1.0", - "replace-ext": "1.0.0" - } - } + "engines": { + "node": ">= 4.5.0" } }, - "gulp-sourcemaps": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/gulp-sourcemaps/-/gulp-sourcemaps-1.6.0.tgz", - "integrity": "sha1-uG/zSdgBzrVuHZ59x7vLS33uYAw=", + "node_modules/https-proxy-agent": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz", + "integrity": "sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg==", "dev": true, - "requires": { - "convert-source-map": "1.5.0", - "graceful-fs": "4.1.11", - "strip-bom": "2.0.0", - "through2": "2.0.3", - "vinyl": "1.2.0" - }, + "license": "MIT", "dependencies": { - "vinyl": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-1.2.0.tgz", - "integrity": "sha1-XIgDbPVl5d8FVYv8kR+GVt8hiIQ=", - "dev": true, - "requires": { - "clone": "1.0.2", - "clone-stats": "0.0.1", - "replace-ext": "0.0.1" - } - } - } - }, - "gulp-symdest": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/gulp-symdest/-/gulp-symdest-1.1.0.tgz", - "integrity": "sha1-wWUyBzLRks5W/ZQnH/oSMjS/KuA=", - "dev": true, - "requires": { - "event-stream": "3.3.4", - "mkdirp": "0.5.1", - "queue": "3.1.0", - "vinyl-fs": "2.4.4" - } - }, - "gulp-untar": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/gulp-untar/-/gulp-untar-0.0.6.tgz", - "integrity": "sha1-1r3v3n6ajgVMnxYjhaB4LEvnQAA=", - "dev": true, - "requires": { - "event-stream": "3.3.4", - "gulp-util": "3.0.8", - "streamifier": "0.1.1", - "tar": "2.2.1", - "through2": "2.0.3" - } - }, - "gulp-util": { - "version": "3.0.8", - "resolved": "https://registry.npmjs.org/gulp-util/-/gulp-util-3.0.8.tgz", - "integrity": "sha1-AFTh50RQLifATBh8PsxQXdVLu08=", - "dev": true, - "requires": { - "array-differ": "1.0.0", - "array-uniq": "1.0.3", - "beeper": "1.1.1", - "chalk": "1.1.3", - "dateformat": "2.2.0", - "fancy-log": "1.3.0", - "gulplog": "1.0.0", - "has-gulplog": "0.1.0", - "lodash._reescape": "3.0.0", - "lodash._reevaluate": "3.0.0", - "lodash._reinterpolate": "3.0.0", - "lodash.template": "3.6.2", - "minimist": "1.2.0", - "multipipe": "0.1.2", - "object-assign": "3.0.0", - "replace-ext": "0.0.1", - "through2": "2.0.3", - "vinyl": "0.5.3" - } - }, - "gulp-vinyl-zip": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/gulp-vinyl-zip/-/gulp-vinyl-zip-2.1.0.tgz", - "integrity": "sha1-JOQGhdwFtxSZlSRQmeBZAmO+ja0=", - "dev": true, - "requires": { - "event-stream": "3.3.4", - "queue": "4.4.1", - "through2": "2.0.3", - "vinyl": "2.1.0", - "vinyl-fs": "2.4.4", - "yauzl": "2.8.0", - "yazl": "2.4.2" + "agent-base": "^4.3.0", + "debug": "^3.1.0" }, - "dependencies": { - "clone": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.1.tgz", - "integrity": "sha1-0hfR6WERjjrJpLi7oyhVU79kfNs=", - "dev": true - }, - "clone-stats": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-1.0.0.tgz", - "integrity": "sha1-s3gt/4u1R04Yuba/D9/ngvh3doA=", - "dev": true - }, - "queue": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/queue/-/queue-4.4.1.tgz", - "integrity": "sha512-Lcs97MDk4ewesYBtC6P3hl+klvVmHN2PLzgsQcK29bVQ2+5T0Ef0ZmXhBIINkpJd3LzZK29MWjyTL2lGLYGOPA==", - "dev": true, - "requires": { - "inherits": "2.0.3" - } - }, - "replace-ext": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.0.tgz", - "integrity": "sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs=", - "dev": true - }, - "vinyl": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.1.0.tgz", - "integrity": "sha1-Ah+cLPlR1rk5lDyJ617lrdT9kkw=", - "dev": true, - "requires": { - "clone": "2.1.1", - "clone-buffer": "1.0.0", - "clone-stats": "1.0.0", - "cloneable-readable": "1.0.0", - "remove-trailing-separator": "1.1.0", - "replace-ext": "1.0.0" - } - } - } - }, - "gulplog": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/gulplog/-/gulplog-1.0.0.tgz", - "integrity": "sha1-4oxNRdBey77YGDY86PnFkmIp/+U=", - "dev": true, - "requires": { - "glogg": "1.0.0" - } - }, - "har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", - "dev": true - }, - "har-validator": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-2.0.6.tgz", - "integrity": "sha1-zcvAgYgmWtEZtqWnyKtw7s+10n0=", - "dev": true, - "requires": { - "chalk": "1.1.3", - "commander": "2.11.0", - "is-my-json-valid": "2.16.1", - "pinkie-promise": "2.0.1" + "engines": { + "node": ">= 4.5.0" } }, - "has-ansi": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", - "dev": true, - "requires": { - "ansi-regex": "2.1.1" - } - }, - "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", - "dev": true - }, - "has-gulplog": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/has-gulplog/-/has-gulplog-0.1.0.tgz", - "integrity": "sha1-ZBTIKRNpfaUVkDl9r7EvIpZ4Ec4=", - "dev": true, - "requires": { - "sparkles": "1.0.0" - } - }, - "hawk": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz", - "integrity": "sha1-B4REvXwWQLD+VA0sm3PVlnjo4cQ=", - "dev": true, - "requires": { - "boom": "2.10.1", - "cryptiles": "2.0.5", - "hoek": "2.16.3", - "sntp": "1.0.9" - } - }, - "he": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", - "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", - "dev": true - }, - "hoek": { - "version": "2.16.3", - "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", - "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=", - "dev": true - }, - "http-signature": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz", - "integrity": "sha1-33LiZwZs0Kxn+3at+OE0qPvPkb8=", - "dev": true, - "requires": { - "assert-plus": "0.2.0", - "jsprim": "1.4.1", - "sshpk": "1.13.1" - } - }, - "inflight": { + "node_modules/inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, - "requires": { - "once": "1.4.0", - "wrappy": "1.0.2" - } - }, - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true - }, - "is": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/is/-/is-3.2.1.tgz", - "integrity": "sha1-0Kwq1V63sL7JJqUmb2xmKqqD3KU=", - "dev": true - }, - "is-buffer": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.5.tgz", - "integrity": "sha1-Hzsm72E7IUuIy8ojzGwB2Hlh7sw=", - "dev": true - }, - "is-dotfile": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", - "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=", - "dev": true - }, - "is-equal-shallow": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", - "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", - "dev": true, - "requires": { - "is-primitive": "2.0.0" - } - }, - "is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true - }, - "is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", - "dev": true, - "requires": { - "is-extglob": "2.1.1" - } - }, - "is-my-json-valid": { - "version": "2.16.1", - "resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.16.1.tgz", - "integrity": "sha512-ochPsqWS1WXj8ZnMIV0vnNXooaMhp7cyL4FMSIPKTtnV0Ha/T19G2b9kkhcNsabV9bxYkze7/aLZJb/bYuFduQ==", - "dev": true, - "requires": { - "generate-function": "2.0.0", - "generate-object-property": "1.2.0", - "jsonpointer": "4.0.1", - "xtend": "4.0.1" - } - }, - "is-number": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", - "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", "dev": true, - "requires": { - "kind-of": "3.2.2" - } - }, - "is-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", - "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", - "dev": true - }, - "is-posix-bracket": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", - "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=", - "dev": true - }, - "is-primitive": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", - "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", - "dev": true - }, - "is-property": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", - "integrity": "sha1-V/4cTkhHTt1lsJkR8msc1Ald2oQ=", - "dev": true - }, - "is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", - "dev": true - }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", - "dev": true - }, - "is-utf8": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", - "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", - "dev": true - }, - "is-valid-glob": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/is-valid-glob/-/is-valid-glob-0.3.0.tgz", - "integrity": "sha1-1LVcafUYhvm2XHDWwmItN+KfSP4=", - "dev": true - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "dev": true, - "requires": { - "isarray": "1.0.0" - } - }, - "isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", - "dev": true - }, - "jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", - "dev": true, - "optional": true - }, - "json-schema": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", - "dev": true - }, - "json-schema-traverse": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", - "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=", - "dev": true - }, - "json-stable-stringify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", - "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", - "dev": true, - "requires": { - "jsonify": "0.0.0" - } - }, - "json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", - "dev": true - }, - "jsonify": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", - "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", - "dev": true - }, - "jsonpointer": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-4.0.1.tgz", - "integrity": "sha1-T9kss04OnbPInIYi7PUfm5eMbLk=", - "dev": true - }, - "jsprim": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", - "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", - "dev": true, - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.2.3", - "verror": "1.10.0" - }, + "license": "ISC", "dependencies": { - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "dev": true - } + "once": "^1.3.0", + "wrappy": "1" } }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "1.1.5" - } - }, - "lazystream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.0.tgz", - "integrity": "sha1-9plf4PggOS9hOWvolGJAe7dxaOQ=", - "dev": true, - "requires": { - "readable-stream": "2.3.3" - } - }, - "lodash._basecopy": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz", - "integrity": "sha1-jaDmqHbPNEwK2KVIghEd08XHyjY=", - "dev": true - }, - "lodash._basetostring": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-3.0.1.tgz", - "integrity": "sha1-0YYdh3+CSlL2aYMtyvPuFVZqB9U=", - "dev": true - }, - "lodash._basevalues": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/lodash._basevalues/-/lodash._basevalues-3.0.0.tgz", - "integrity": "sha1-W3dXYoAr3j0yl1A+JjAIIP32Ybc=", - "dev": true - }, - "lodash._getnative": { - "version": "3.9.1", - "resolved": "https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz", - "integrity": "sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U=", - "dev": true - }, - "lodash._isiterateecall": { - "version": "3.0.9", - "resolved": "https://registry.npmjs.org/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz", - "integrity": "sha1-UgOte6Ql+uhCRg5pbbnPPmqsBXw=", - "dev": true - }, - "lodash._reescape": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/lodash._reescape/-/lodash._reescape-3.0.0.tgz", - "integrity": "sha1-Kx1vXf4HyKNVdT5fJ/rH8c3hYWo=", - "dev": true - }, - "lodash._reevaluate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/lodash._reevaluate/-/lodash._reevaluate-3.0.0.tgz", - "integrity": "sha1-WLx0xAZklTrgsSTYBpltrKQx4u0=", - "dev": true - }, - "lodash._reinterpolate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz", - "integrity": "sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0=", - "dev": true - }, - "lodash._root": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/lodash._root/-/lodash._root-3.0.1.tgz", - "integrity": "sha1-+6HEUkwZ7ppfgTa0YJ8BfPTe1pI=", - "dev": true - }, - "lodash.escape": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/lodash.escape/-/lodash.escape-3.2.0.tgz", - "integrity": "sha1-mV7g3BjBtIzJLv+ucaEKq1tIdpg=", - "dev": true, - "requires": { - "lodash._root": "3.0.1" - } - }, - "lodash.isarguments": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", - "integrity": "sha1-L1c9hcaiQon/AGY7SRwdM4/zRYo=", - "dev": true - }, - "lodash.isarray": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz", - "integrity": "sha1-eeTriMNqgSKvhvhEqpvNhRtfu1U=", - "dev": true - }, - "lodash.isequal": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", - "integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA=", - "dev": true - }, - "lodash.keys": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz", - "integrity": "sha1-TbwEcrFWvlCgsoaFXRvQsMZWCYo=", - "dev": true, - "requires": { - "lodash._getnative": "3.9.1", - "lodash.isarguments": "3.1.0", - "lodash.isarray": "3.0.4" - } - }, - "lodash.restparam": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/lodash.restparam/-/lodash.restparam-3.6.1.tgz", - "integrity": "sha1-k2pOMJ7zMKdkXtQUWYbIWuWyCAU=", - "dev": true - }, - "lodash.template": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-3.6.2.tgz", - "integrity": "sha1-+M3sxhaaJVvpCYrosMU9N4kx0U8=", - "dev": true, - "requires": { - "lodash._basecopy": "3.0.1", - "lodash._basetostring": "3.0.1", - "lodash._basevalues": "3.0.0", - "lodash._isiterateecall": "3.0.9", - "lodash._reinterpolate": "3.0.0", - "lodash.escape": "3.2.0", - "lodash.keys": "3.1.2", - "lodash.restparam": "3.6.1", - "lodash.templatesettings": "3.1.1" - } - }, - "lodash.templatesettings": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-3.1.1.tgz", - "integrity": "sha1-+zB4RHU7Zrnxr6VOJix0UwfbqOU=", - "dev": true, - "requires": { - "lodash._reinterpolate": "3.0.0", - "lodash.escape": "3.2.0" - } - }, - "map-stream": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.1.0.tgz", - "integrity": "sha1-5WqpTEyAVaFkBKBnS3jyFffI4ZQ=", - "dev": true - }, - "merge-stream": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-1.0.1.tgz", - "integrity": "sha1-QEEgLVCKNCugAXQAjfDCUbjBNeE=", + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true, - "requires": { - "readable-stream": "2.3.3" - } + "license": "ISC" }, - "micromatch": { - "version": "2.3.11", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", - "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", + "node_modules/js-yaml": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz", + "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==", "dev": true, - "requires": { - "arr-diff": "2.0.0", - "array-unique": "0.2.1", - "braces": "1.8.5", - "expand-brackets": "0.1.5", - "extglob": "0.3.2", - "filename-regex": "2.0.1", - "is-extglob": "1.0.0", - "is-glob": "2.0.1", - "kind-of": "3.2.2", - "normalize-path": "2.1.1", - "object.omit": "2.0.1", - "parse-glob": "3.0.4", - "regex-cache": "0.4.4" - }, + "license": "MIT", "dependencies": { - "is-extglob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", - "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", - "dev": true - }, - "is-glob": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", - "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", - "dev": true, - "requires": { - "is-extglob": "1.0.0" - } - } - } - }, - "mime-db": { - "version": "1.30.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.30.0.tgz", - "integrity": "sha1-dMZD2i3Z1qRTmZY0ZbJtXKfXHwE=", - "dev": true - }, - "mime-types": { - "version": "2.1.17", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.17.tgz", - "integrity": "sha1-Cdejk/A+mVp5+K+Fe3Cp4KsWVXo=", - "dev": true, - "requires": { - "mime-db": "1.30.0" - } - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, - "requires": { - "brace-expansion": "1.1.8" - } - }, - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true - }, - "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "dev": true, - "requires": { - "minimist": "0.0.8" + "argparse": "^2.0.1" }, - "dependencies": { - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true - } + "bin": { + "js-yaml": "bin/js-yaml.js" } }, - "mocha": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-4.0.1.tgz", - "integrity": "sha512-evDmhkoA+cBNiQQQdSKZa2b9+W2mpLoj50367lhy+Klnx9OV8XlCIhigUnn1gaTFLQCa0kdNhEGDr0hCXOQFDw==", + "node_modules/minimatch": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", "dev": true, - "requires": { - "browser-stdout": "1.3.0", - "commander": "2.11.0", - "debug": "3.1.0", - "diff": "3.3.1", - "escape-string-regexp": "1.0.5", - "glob": "7.1.2", - "growl": "1.10.3", - "he": "1.1.1", - "mkdirp": "0.5.1", - "supports-color": "4.4.0" - }, + "license": "ISC", "dependencies": { - "supports-color": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz", - "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==", - "dev": true, - "requires": { - "has-flag": "2.0.0" - } - } + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" } }, - "ms": { + "node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - }, - "multimatch": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-2.1.0.tgz", - "integrity": "sha1-nHkGoi+0wCkZ4vX3UWG0zb1LKis=", - "dev": true, - "requires": { - "array-differ": "1.0.0", - "array-union": "1.0.2", - "arrify": "1.0.1", - "minimatch": "3.0.4" - } - }, - "multipipe": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/multipipe/-/multipipe-0.1.2.tgz", - "integrity": "sha1-Ko8t33Du1WTf8tV/HhoTfZ8FB4s=", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", "dev": true, - "requires": { - "duplexer2": "0.0.2" - } - }, - "node.extend": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/node.extend/-/node.extend-1.1.6.tgz", - "integrity": "sha1-p7iCyC1sk6SGOlUEvV3o7IYli5Y=", - "dev": true, - "requires": { - "is": "3.2.1" - } - }, - "normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "dev": true, - "requires": { - "remove-trailing-separator": "1.1.0" - } - }, - "oauth-sign": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", - "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=", - "dev": true - }, - "object-assign": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-3.0.0.tgz", - "integrity": "sha1-m+3VygiXlJvKR+f/QIBi1Un1h/I=", - "dev": true + "license": "MIT" }, - "object.omit": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", - "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", - "dev": true, - "requires": { - "for-own": "0.1.5", - "is-extendable": "0.1.1" - } - }, - "once": { + "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", "dev": true, - "requires": { - "wrappy": "1.0.2" - } - }, - "ordered-read-streams": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/ordered-read-streams/-/ordered-read-streams-0.3.0.tgz", - "integrity": "sha1-cTfmmzKYuzQiR6G77jiByA4v14s=", - "dev": true, - "requires": { - "is-stream": "1.1.0", - "readable-stream": "2.3.3" - } - }, - "parse-glob": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", - "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", - "dev": true, - "requires": { - "glob-base": "0.3.0", - "is-dotfile": "1.0.3", - "is-extglob": "1.0.0", - "is-glob": "2.0.1" - }, + "license": "ISC", "dependencies": { - "is-extglob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", - "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", - "dev": true - }, - "is-glob": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", - "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", - "dev": true, - "requires": { - "is-extglob": "1.0.0" - } - } + "wrappy": "1" } }, - "path-dirname": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", - "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", - "dev": true - }, - "path-is-absolute": { + "node_modules/path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true - }, - "pause-stream": { - "version": "0.0.11", - "resolved": "https://registry.npmjs.org/pause-stream/-/pause-stream-0.0.11.tgz", - "integrity": "sha1-/lo0sMvOErWqaitAPuLnO2AvFEU=", - "dev": true, - "requires": { - "through": "2.3.8" - } - }, - "pend": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", - "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=", - "dev": true - }, - "performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", - "dev": true - }, - "pinkie": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", - "dev": true - }, - "pinkie-promise": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", - "dev": true, - "requires": { - "pinkie": "2.0.4" - } - }, - "preserve": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", - "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", - "dev": true - }, - "process-nextick-args": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", - "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=", - "dev": true - }, - "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", - "dev": true - }, - "qs": { - "version": "6.3.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.3.2.tgz", - "integrity": "sha1-51vV9uJoEioqDgvaYwslUMFmUCw=", - "dev": true - }, - "querystringify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-1.0.0.tgz", - "integrity": "sha1-YoYkIRLFtxL6ZU5SZlK/ahP/Bcs=", - "dev": true - }, - "queue": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/queue/-/queue-3.1.0.tgz", - "integrity": "sha1-bEnQHwCeIlZ4h4nyv/rGuLmZBYU=", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", "dev": true, - "requires": { - "inherits": "2.0.3" + "license": "MIT", + "engines": { + "node": ">=0.10.0" } }, - "randomatic": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.7.tgz", - "integrity": "sha512-D5JUjPyJbaJDkuAazpVnSfVkLlpeO3wDlPROTMLGKG1zMFNFRgrciKo1ltz/AzNTkqE0HzDx655QOL51N06how==", + "node_modules/rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", "dev": true, - "requires": { - "is-number": "3.0.0", - "kind-of": "4.0.0" - }, + "license": "ISC", "dependencies": { - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "1.1.5" - } - } - } - }, - "kind-of": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", - "dev": true, - "requires": { - "is-buffer": "1.1.5" - } - } - } - }, - "readable-stream": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", - "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "1.0.7", - "safe-buffer": "5.1.1", - "string_decoder": "1.0.3", - "util-deprecate": "1.0.2" - } - }, - "regex-cache": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", - "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", - "dev": true, - "requires": { - "is-equal-shallow": "0.1.3" - } - }, - "remove-trailing-separator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", - "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", - "dev": true - }, - "repeat-element": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", - "integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=", - "dev": true - }, - "repeat-string": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", - "dev": true - }, - "replace-ext": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-0.0.1.tgz", - "integrity": "sha1-KbvZIHinOfC8zitO5B6DeVNSKSQ=", - "dev": true - }, - "request": { - "version": "2.83.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.83.0.tgz", - "integrity": "sha512-lR3gD69osqm6EYLk9wB/G1W/laGWjzH90t1vEa2xuxHD5KUrSzp9pUSfTm+YC5Nxt2T8nMPEvKlhbQayU7bgFw==", - "dev": true, - "requires": { - "aws-sign2": "0.7.0", - "aws4": "1.6.0", - "caseless": "0.12.0", - "combined-stream": "1.0.5", - "extend": "3.0.1", - "forever-agent": "0.6.1", - "form-data": "2.3.1", - "har-validator": "5.0.3", - "hawk": "6.0.2", - "http-signature": "1.2.0", - "is-typedarray": "1.0.0", - "isstream": "0.1.2", - "json-stringify-safe": "5.0.1", - "mime-types": "2.1.17", - "oauth-sign": "0.8.2", - "performance-now": "2.1.0", - "qs": "6.5.1", - "safe-buffer": "5.1.1", - "stringstream": "0.0.5", - "tough-cookie": "2.3.3", - "tunnel-agent": "0.6.0", - "uuid": "3.1.0" + "glob": "^7.1.3" }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "dev": true - }, - "aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", - "dev": true - }, - "boom": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/boom/-/boom-4.3.1.tgz", - "integrity": "sha1-T4owBctKfjiJ90kDD9JbluAdLjE=", - "dev": true, - "requires": { - "hoek": "4.2.0" - } - }, - "caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", - "dev": true - }, - "cryptiles": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-3.1.2.tgz", - "integrity": "sha1-qJ+7Ig9c4l7FboxKqKT9e1sNKf4=", - "dev": true, - "requires": { - "boom": "5.2.0" - }, - "dependencies": { - "boom": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/boom/-/boom-5.2.0.tgz", - "integrity": "sha512-Z5BTk6ZRe4tXXQlkqftmsAUANpXmuwlsF5Oov8ThoMbQRzdGTA1ngYRW160GexgOgjsFOKJz0LYhoNi+2AMBUw==", - "dev": true, - "requires": { - "hoek": "4.2.0" - } - } - } - }, - "form-data": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.1.tgz", - "integrity": "sha1-b7lPvXGIUwbXPRXMSX/kzE7NRL8=", - "dev": true, - "requires": { - "asynckit": "0.4.0", - "combined-stream": "1.0.5", - "mime-types": "2.1.17" - } - }, - "har-validator": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.0.3.tgz", - "integrity": "sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0=", - "dev": true, - "requires": { - "ajv": "5.2.3", - "har-schema": "2.0.0" - } - }, - "hawk": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/hawk/-/hawk-6.0.2.tgz", - "integrity": "sha512-miowhl2+U7Qle4vdLqDdPt9m09K6yZhkLDTWGoUiUzrQCn+mHHSmfJgAyGaLRZbPmTqfFFjRV1QWCW0VWUJBbQ==", - "dev": true, - "requires": { - "boom": "4.3.1", - "cryptiles": "3.1.2", - "hoek": "4.2.0", - "sntp": "2.0.2" - } - }, - "hoek": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/hoek/-/hoek-4.2.0.tgz", - "integrity": "sha512-v0XCLxICi9nPfYrS9RL8HbYnXi9obYAeLbSP00BmnZwCK9+Ih9WOjoZ8YoHCoav2csqn4FOz4Orldsy2dmDwmQ==", - "dev": true - }, - "http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", - "dev": true, - "requires": { - "assert-plus": "1.0.0", - "jsprim": "1.4.1", - "sshpk": "1.13.1" - } - }, - "qs": { - "version": "6.5.1", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz", - "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==", - "dev": true - }, - "sntp": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/sntp/-/sntp-2.0.2.tgz", - "integrity": "sha1-UGQRDwr4X3z9t9a2ekACjOUrSys=", - "dev": true, - "requires": { - "hoek": "4.2.0" - } - }, - "tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "dev": true, - "requires": { - "safe-buffer": "5.1.1" - } - } - } - }, - "requires-port": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", - "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=", - "dev": true - }, - "rimraf": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", - "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", - "dev": true, - "requires": { - "glob": "7.1.2" - } - }, - "safe-buffer": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", - "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==", - "dev": true - }, - "semver": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", - "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==", - "dev": true - }, - "sntp": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz", - "integrity": "sha1-ZUEYTMkK7qbG57NeJlkIJEPGYZg=", - "dev": true, - "requires": { - "hoek": "2.16.3" - } - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - }, - "source-map-support": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.0.tgz", - "integrity": "sha512-vUoN3I7fHQe0R/SJLKRdKYuEdRGogsviXFkHHo17AWaTGv17VLnxw+CFXvqy+y4ORZ3doWLQcxRYfwKrsd/H7Q==", - "dev": true, - "requires": { - "source-map": "0.6.1" - } - }, - "sparkles": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/sparkles/-/sparkles-1.0.0.tgz", - "integrity": "sha1-Gsu/tZJDbRC76PeFt8xvgoFQEsM=", - "dev": true - }, - "split": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/split/-/split-0.3.3.tgz", - "integrity": "sha1-zQ7qXmOiEd//frDwkcQTPi0N0o8=", - "dev": true, - "requires": { - "through": "2.3.8" - } - }, - "sshpk": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.13.1.tgz", - "integrity": "sha1-US322mKHFEMW3EwY/hzx2UBzm+M=", - "dev": true, - "requires": { - "asn1": "0.2.3", - "assert-plus": "1.0.0", - "bcrypt-pbkdf": "1.0.1", - "dashdash": "1.14.1", - "ecc-jsbn": "0.1.1", - "getpass": "0.1.7", - "jsbn": "0.1.1", - "tweetnacl": "0.14.5" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "dev": true - } - } - }, - "stat-mode": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/stat-mode/-/stat-mode-0.2.2.tgz", - "integrity": "sha1-5sgLYjEj19gM8TLOU480YokHJQI=", - "dev": true - }, - "stream-combiner": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.0.4.tgz", - "integrity": "sha1-TV5DPBhSYd3mI8o/RMWGvPXErRQ=", - "dev": true, - "requires": { - "duplexer": "0.1.1" - } - }, - "stream-shift": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", - "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=", - "dev": true - }, - "streamfilter": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/streamfilter/-/streamfilter-1.0.5.tgz", - "integrity": "sha1-h1BxEb644phFFxe1Ec/tjwAqv1M=", - "dev": true, - "requires": { - "readable-stream": "2.3.3" - } - }, - "streamifier": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/streamifier/-/streamifier-0.1.1.tgz", - "integrity": "sha1-l+mNj6TRBdYqJpHR3AfoINuN/E8=", - "dev": true - }, - "string_decoder": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", - "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", - "dev": true, - "requires": { - "safe-buffer": "5.1.1" - } - }, - "stringstream": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", - "integrity": "sha1-TkhM1N5aC7vuGORjB3EKioFiGHg=", - "dev": true - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, - "requires": { - "ansi-regex": "2.1.1" + "bin": { + "rimraf": "bin.js" } }, - "strip-bom": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", - "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", - "dev": true, - "requires": { - "is-utf8": "0.2.1" - } - }, - "strip-bom-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-bom-stream/-/strip-bom-stream-1.0.0.tgz", - "integrity": "sha1-5xRDmFd9Uaa+0PoZlPoF9D/ZiO4=", - "dev": true, - "requires": { - "first-chunk-stream": "1.0.0", - "strip-bom": "2.0.0" - } - }, - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - }, - "tar": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.1.tgz", - "integrity": "sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE=", - "dev": true, - "requires": { - "block-stream": "0.0.9", - "fstream": "1.0.11", - "inherits": "2.0.3" - } - }, - "through": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", - "dev": true - }, - "through2": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", - "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", + "node_modules/typescript": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.3.tgz", + "integrity": "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==", "dev": true, - "requires": { - "readable-stream": "2.3.3", - "xtend": "4.0.1" - } - }, - "through2-filter": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/through2-filter/-/through2-filter-2.0.0.tgz", - "integrity": "sha1-YLxVoNrLdghdsfna6Zq0P4PWIuw=", - "dev": true, - "requires": { - "through2": "2.0.3", - "xtend": "4.0.1" - } - }, - "time-stamp": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/time-stamp/-/time-stamp-1.1.0.tgz", - "integrity": "sha1-dkpaEa9QVhkhsTPztE5hhofg9cM=", - "dev": true - }, - "to-absolute-glob": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/to-absolute-glob/-/to-absolute-glob-0.1.1.tgz", - "integrity": "sha1-HN+kcqnvUMI57maZm2YsoOs5k38=", - "dev": true, - "requires": { - "extend-shallow": "2.0.1" - } - }, - "tough-cookie": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.3.tgz", - "integrity": "sha1-C2GKVWW23qkL80JdBNVe3EdadWE=", - "dev": true, - "requires": { - "punycode": "1.4.1" - } - }, - "tunnel-agent": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz", - "integrity": "sha1-Y3PbdpCf5XDgjXNYM2Xtgop07us=", - "dev": true - }, - "tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", - "dev": true, - "optional": true - }, - "typescript": { - "version": "2.5.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.5.3.tgz", - "integrity": "sha512-ptLSQs2S4QuS6/OD1eAKG+S5G8QQtrU5RT32JULdZQtM1L3WTi34Wsu48Yndzi8xsObRAB9RPt/KhA9wlpEF6w==", - "dev": true - }, - "unique-stream": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/unique-stream/-/unique-stream-2.2.1.tgz", - "integrity": "sha1-WqADz76Uxf+GbE59ZouxxNuts2k=", - "dev": true, - "requires": { - "json-stable-stringify": "1.0.1", - "through2-filter": "2.0.0" - } - }, - "url-parse": { - "version": "1.1.9", - "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.1.9.tgz", - "integrity": "sha1-xn8dd11R8KGJEd17P/rSe7nlvRk=", - "dev": true, - "requires": { - "querystringify": "1.0.0", - "requires-port": "1.0.0" - } - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "dev": true - }, - "uuid": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.1.0.tgz", - "integrity": "sha512-DIWtzUkw04M4k3bf1IcpS2tngXEL26YUD2M0tMDUpnUrz2hgzUBlD55a4FjdLGPvfHxS6uluGWvaVEqgBcVa+g==", - "dev": true - }, - "vali-date": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/vali-date/-/vali-date-1.0.0.tgz", - "integrity": "sha1-G5BKWWCfsyjvB4E4Qgk09rhnCaY=", - "dev": true - }, - "verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", - "dev": true, - "requires": { - "assert-plus": "1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "1.3.0" + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "dev": true - } + "engines": { + "node": ">=14.17" } }, - "vinyl": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-0.5.3.tgz", - "integrity": "sha1-sEVbOPxeDPMNQyUTLkYZcMIJHN4=", + "node_modules/undici-types": { + "version": "7.24.6", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.24.6.tgz", + "integrity": "sha512-WRNW+sJgj5OBN4/0JpHFqtqzhpbnV0GuB+OozA9gCL7a993SmU+1JBZCzLNxYsbMfIeDL+lTsphD5jN5N+n0zg==", "dev": true, - "requires": { - "clone": "1.0.2", - "clone-stats": "0.0.1", - "replace-ext": "0.0.1" - } + "license": "MIT" }, - "vinyl-fs": { - "version": "2.4.4", - "resolved": "https://registry.npmjs.org/vinyl-fs/-/vinyl-fs-2.4.4.tgz", - "integrity": "sha1-vm/zJwy1Xf19MGNkDegfJddTIjk=", + "node_modules/vscode-test": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/vscode-test/-/vscode-test-1.4.1.tgz", + "integrity": "sha512-Ls7+JyC06cUCuomlTYk4aNJI00Rri09hgtkNl3zfQ1bj6meXglpSPpuzJ/RPNetlUHFMm4eGs0Xr/H5pFPVwfQ==", + "deprecated": "This package has been renamed to @vscode/test-electron, please update to the new name", "dev": true, - "requires": { - "duplexify": "3.5.1", - "glob-stream": "5.3.5", - "graceful-fs": "4.1.11", - "gulp-sourcemaps": "1.6.0", - "is-valid-glob": "0.3.0", - "lazystream": "1.0.0", - "lodash.isequal": "4.5.0", - "merge-stream": "1.0.1", - "mkdirp": "0.5.1", - "object-assign": "4.1.1", - "readable-stream": "2.3.3", - "strip-bom": "2.0.0", - "strip-bom-stream": "1.0.0", - "through2": "2.0.3", - "through2-filter": "2.0.0", - "vali-date": "1.0.0", - "vinyl": "1.2.0" - }, + "license": "MIT", "dependencies": { - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "dev": true - }, - "vinyl": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-1.2.0.tgz", - "integrity": "sha1-XIgDbPVl5d8FVYv8kR+GVt8hiIQ=", - "dev": true, - "requires": { - "clone": "1.0.2", - "clone-stats": "0.0.1", - "replace-ext": "0.0.1" - } - } - } - }, - "vinyl-source-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/vinyl-source-stream/-/vinyl-source-stream-1.1.0.tgz", - "integrity": "sha1-RMvlEIIFJ53rDFZTwJSiiHk4sas=", - "dev": true, - "requires": { - "through2": "0.6.5", - "vinyl": "0.4.6" + "http-proxy-agent": "^2.1.0", + "https-proxy-agent": "^2.2.4", + "rimraf": "^2.6.3" }, - "dependencies": { - "clone": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/clone/-/clone-0.2.0.tgz", - "integrity": "sha1-xhJqkK1Pctv1rNskPMN3JP6T/B8=", - "dev": true - }, - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "dev": true - }, - "readable-stream": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "0.0.1", - "string_decoder": "0.10.31" - } - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", - "dev": true - }, - "through2": { - "version": "0.6.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz", - "integrity": "sha1-QaucZ7KdVyCQcUEOHXp6lozTrUg=", - "dev": true, - "requires": { - "readable-stream": "1.0.34", - "xtend": "4.0.1" - } - }, - "vinyl": { - "version": "0.4.6", - "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-0.4.6.tgz", - "integrity": "sha1-LzVsh6VQolVGHza76ypbqL94SEc=", - "dev": true, - "requires": { - "clone": "0.2.0", - "clone-stats": "0.0.1" - } - } + "engines": { + "node": ">=8.9.3" } }, - "vscode": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/vscode/-/vscode-1.1.6.tgz", - "integrity": "sha1-Ru0a+iwbnWifY5TI8WvR1xkPdfs=", - "dev": true, - "requires": { - "glob": "7.1.2", - "gulp-chmod": "2.0.0", - "gulp-filter": "5.0.1", - "gulp-gunzip": "1.0.0", - "gulp-remote-src": "0.4.3", - "gulp-symdest": "1.1.0", - "gulp-untar": "0.0.6", - "gulp-vinyl-zip": "2.1.0", - "mocha": "4.0.1", - "request": "2.83.0", - "semver": "5.4.1", - "source-map-support": "0.5.0", - "url-parse": "1.1.9", - "vinyl-source-stream": "1.1.0" - } - }, - "wrappy": { + "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true - }, - "xtend": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", - "dev": true - }, - "yauzl": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.8.0.tgz", - "integrity": "sha1-eUUK/yKyqcWkHvVOAtuQfM+/nuI=", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", "dev": true, - "requires": { - "buffer-crc32": "0.2.13", - "fd-slicer": "1.0.1" - } - }, - "yazl": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/yazl/-/yazl-2.4.2.tgz", - "integrity": "sha1-FMsZCD4eJacAksFYiqvg9OTdTYg=", - "dev": true, - "requires": { - "buffer-crc32": "0.2.13" - } + "license": "ISC" } } } diff --git a/package.json b/package.json index bdc83f1..2be1b9a 100644 --- a/package.json +++ b/package.json @@ -14,13 +14,10 @@ "license": "MIT", "publisher": "bruno-dias", "engines": { - "vscode": "^1.16.0" + "vscode": "^1.120.0" }, "categories": [ - "Languages" - ], - "activationEvents": [ - "onLanguage:ink" + "Programming Languages" ], "main": "./out/src/extension", "keywords": [ @@ -52,19 +49,20 @@ { "language": "ink", "scopeName": "source.ink", - "path": "./syntaxes/ink.tmLanguage" + "path": "./syntaxes/ink.tmLanguage.json" } ] }, "scripts": { "vscode:prepublish": "npm run compile", - "compile": "tsc -p ./", - "watch": "tsc -watch -p ./", - "postinstall": "node ./node_modules/vscode/bin/install" + "compile": "js-yaml syntaxes/ink.tmLanguage.yaml > syntaxes/ink.tmLanguage.json && tsc -p ./", + "watch": "tsc -watch -p ./" }, "devDependencies": { - "@types/node": "^8.0.34", - "typescript": "^2.5.3", - "vscode": "^1.1.6" + "@types/node": "^25.9.1", + "@types/vscode": "^1.120.0", + "js-yaml": "^4.1.1", + "typescript": "^6.0.3", + "vscode-test": "^1.4.1" } -} \ No newline at end of file +} diff --git a/src/completion.ts b/src/completion.ts index 7e3c9cf..ade32c9 100644 --- a/src/completion.ts +++ b/src/completion.ts @@ -1,16 +1,16 @@ -import { CompletionItemProvider, TextDocument, Position, CancellationToken, CompletionItem, Range, CompletionItemKind, workspace } from "vscode"; -import * as NodeMap from "./nodemap"; -import * as fs from "fs"; +// import { CompletionItemProvider, TextDocument, Position, CancellationToken, CompletionItem, Range, CompletionItemKind, workspace } from "vscode"; +// import * as NodeMap from "./nodemap"; +// import * as fs from "fs"; -export class DivertCompletionProvider implements CompletionItemProvider { +// export class DivertCompletionProvider implements CompletionItemProvider { - public provideCompletionItems (document: TextDocument, position: Position) : CompletionItem[] { - // Make sure we are at the end of a valid divert arrow. - // Ignore a > at the start of a line. - const before = document.getText(new Range(position.with(position.line, 0), position)); - if (!/(->|<-) ?$/.test(before)) return; - if (/-> ?-> ?$/.test(before)) return; - return NodeMap.getDivertCompletionTargets(document.uri.fsPath, position.line); - } +// public provideCompletionItems (document: TextDocument, position: Position) : CompletionItem[] { +// // Make sure we are at the end of a valid divert arrow. +// // Ignore a > at the start of a line. +// const before = document.getText(new Range(position.with(position.line, 0), position)); +// if (!/(->|<-) ?$/.test(before)) return; +// if (/-> ?-> ?$/.test(before)) return; +// return NodeMap.getDivertCompletionTargets(document.uri.fsPath, position.line); +// } -} \ No newline at end of file +// } \ No newline at end of file diff --git a/src/definitions.ts b/src/definitions.ts index 2e18188..d2ff37d 100644 --- a/src/definitions.ts +++ b/src/definitions.ts @@ -1,22 +1,22 @@ -import { DefinitionProvider, Location, TextDocument, Position, Range } from "vscode"; -import { getDefinitionByNameAndScope } from "./nodemap"; +// import { DefinitionProvider, Location, TextDocument, Position, Range } from "vscode"; +// import { getDefinitionByNameAndScope } from "./nodemap"; -export class InkDefinitionProvider implements DefinitionProvider { +// export class InkDefinitionProvider implements DefinitionProvider { - public provideDefinition (document: TextDocument, position: Position) : Location { - const lineStart = new Position(position.line, 0); - const lineEnd = new Position(position.line + 1, 0); - const before = new Range(lineStart, position); - const after = new Range(position, lineEnd); - const beforeText = document.getText(before); - const afterText = document.getText(after); - const beforeMatch = beforeText.match(/(->\s*\w*)$/)[1]; - const afterMatch = afterText.match(/^([\w\.]*)\s*/)[1]; - if (!(beforeMatch && afterMatch)) return; - const name = (beforeMatch + afterMatch).match(/->\s*([\w.]+)/)[1]; - const [target] = name.split("."); - return getDefinitionByNameAndScope(target, document.uri.fsPath, position.line); +// public provideDefinition (document: TextDocument, position: Position) : Location { +// const lineStart = new Position(position.line, 0); +// const lineEnd = new Position(position.line + 1, 0); +// const before = new Range(lineStart, position); +// const after = new Range(position, lineEnd); +// const beforeText = document.getText(before); +// const afterText = document.getText(after); +// const beforeMatch = beforeText.match(/(->\s*\w*)$/)[1]; +// const afterMatch = afterText.match(/^([\w\.]*)\s*/)[1]; +// if (!(beforeMatch && afterMatch)) return; +// const name = (beforeMatch + afterMatch).match(/->\s*([\w.]+)/)[1]; +// const [target] = name.split("."); +// return getDefinitionByNameAndScope(target, document.uri.fsPath, position.line); - } -} \ No newline at end of file +// } +// } \ No newline at end of file diff --git a/src/extension.ts b/src/extension.ts index 83b0232..ec1203c 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -1,33 +1,33 @@ -'use strict'; -/* Ink for VS Code Extension Main File */ +// 'use strict'; +// /* Ink for VS Code Extension Main File */ -import { ExtensionContext, DocumentFilter, ProgressLocation, languages, window } from "vscode"; -import { WordAndNodeCounter, WordNodeCounterController } from "./wordcount"; -import { DivertCompletionProvider } from "./completion"; -import * as NodeMap from "./nodemap"; -import { InkDefinitionProvider } from "./definitions"; +// import { ExtensionContext, DocumentFilter, ProgressLocation, languages, window } from "vscode"; +// import { WordAndNodeCounter, WordNodeCounterController } from "./wordcount"; +// import { DivertCompletionProvider } from "./completion"; +// import * as NodeMap from "./nodemap"; +// import { InkDefinitionProvider } from "./definitions"; -const INK : DocumentFilter = { language: 'ink' }; +// const INK : DocumentFilter = { language: 'ink' }; -export function activate(ctx: ExtensionContext) { +// export function activate(ctx: ExtensionContext) { - // Create a new word counter. - const wordCounter = new WordAndNodeCounter(); - const wcController = new WordNodeCounterController(wordCounter); - const nodeMapController = new NodeMap.NodeController(); +// // Create a new word counter. +// const wordCounter = new WordAndNodeCounter(); +// const wcController = new WordNodeCounterController(wordCounter); +// const nodeMapController = new NodeMap.NodeController(); - // Start generating a node map. - window.withProgress({ location: ProgressLocation.Window, title: "Mapping knots and stitches..." }, NodeMap.generateMaps); +// // Start generating a node map. +// window.withProgress({ location: ProgressLocation.Window, title: "Mapping knots and stitches..." }, NodeMap.generateMaps); - // Add to a list of disposables which are disposed when this extension is - // deactivated again. - ctx.subscriptions.push(wcController); - ctx.subscriptions.push(wordCounter); - ctx.subscriptions.push(nodeMapController); +// // Add to a list of disposables which are disposed when this extension is +// // deactivated again. +// ctx.subscriptions.push(wcController); +// ctx.subscriptions.push(wordCounter); +// ctx.subscriptions.push(nodeMapController); - // Enable the completion provider. - ctx.subscriptions.push(languages.registerCompletionItemProvider(INK, new DivertCompletionProvider(), '>', '-', ' ')); +// // Enable the completion provider. +// ctx.subscriptions.push(languages.registerCompletionItemProvider(INK, new DivertCompletionProvider(), '>', '-', ' ')); - // Enable the definition provider. - ctx.subscriptions.push(languages.registerDefinitionProvider(INK, new InkDefinitionProvider())); -} \ No newline at end of file +// // Enable the definition provider. +// ctx.subscriptions.push(languages.registerDefinitionProvider(INK, new InkDefinitionProvider())); +// } \ No newline at end of file diff --git a/src/nodemap.ts b/src/nodemap.ts index 28d6258..ba0af90 100644 --- a/src/nodemap.ts +++ b/src/nodemap.ts @@ -1,298 +1,298 @@ -import { Uri, Position, CompletionItem, CompletionItemKind, Disposable, - Location, TextDocument, TextDocumentChangeEvent, - workspace } from "vscode"; -import * as fs from "fs"; -import * as path from "path"; - -/* Divert targets that are always valid. */ -const PERMANENT_DIVERTS = [ - new CompletionItem("END", CompletionItemKind.Keyword), - new CompletionItem("DONE", CompletionItemKind.Keyword), - new CompletionItem("->", CompletionItemKind.Keyword) -] - -class DivertTarget { - constructor ( public readonly name : string | null) { } - public line : number; - public readonly parentFile : NodeMap; - public toCompletionItem () : CompletionItem { - return new CompletionItem(this.name, CompletionItemKind.Reference); - } -} - -class LabelNode extends DivertTarget { - - public get line () { - return this._line + this.parentStitch.startLine; - } - - public get parentFile () { - return this.parentStitch.parentKnot.parentFile; - } - - constructor ( - public readonly name : string, - private readonly _line : number, - public readonly parentStitch : StitchNode - ) { - super(name); - } - - -} - -class StitchNode extends DivertTarget { - public readonly labels : LabelNode[] - - public get line () { - return this.startLine; - } - - public get startLine () { - return this.parentKnot.startLine + this._relativeStart; - } - - public get parentFile () { - return this.parentKnot.parentFile; - } - - public get endLine () { - // On the last stich of the last knot in the file, we want the end line to actually be - // the next line after the end of the file. This is why we track whether we're on the - // last line or not when generating the map. - return this.parentKnot.startLine + this._relativeEnd + (this.lastLine ? 1 : 0); - } - - constructor ( - public readonly name : string, - private readonly _relativeStart : number, - private readonly _relativeEnd : number, - public readonly parentKnot : KnotNode, - textContent : string, - private readonly lastLine : boolean = false - ) { - super(name); - this.labels = textContent - .split("\n") - .map((line, index) => ({ found: line.match(/^\s*[-\*\+]\s*\((\w+)\)/), index })) - .filter(({ found }) => found !== null) - .map(({ found, index }) => new LabelNode(found[1], index, this)); - } -} - -class KnotNode extends DivertTarget { - - public readonly stitches; - - public get line () { - return this.startLine; - } - - constructor ( - public readonly name : string | null, - public readonly startLine : number, - public readonly endLine : number, - public readonly parentFile : NodeMap, - textContent : string, - private readonly isFunction : boolean = false, - private readonly lastLine : boolean = false - ) { - super(name); - const lines = textContent.split("\n"); - this.stitches = lines - .reduce(( - {nodes, currentNode, lastStart, lastName} - : { nodes: StitchNode[], currentNode: string[], lastStart : number, lastName : string | null } - , line : string - , index : number) => { - if (line.match(/^\s*={1}\s*(\w+)/)) { - // Found the start of a new stitch. - const newName = line.match(/^\s*={1}\s*(\w+)/)[1]; - const node = new StitchNode(lastName, lastStart, index, this, currentNode.join("\n")); - nodes.push(node); - if (index === lines.length -1) { - // The new stitch is also the last line of the knot. - const node = new StitchNode(newName, index, index + 1, this, currentNode.join("\n"), this.lastLine); - nodes.push(node); - } - return { nodes, currentNode: [line], lastStart: index, lastName: newName }; - } - if (index === lines.length - 1) { - // Found the last line. - const node = new StitchNode(lastName, lastStart, index + 1, this, currentNode.join("\n"), this.lastLine); - nodes.push(node); - return { nodes, currentNode: [line], lastStart: index, lastName: null }; - } - currentNode.push(line); - return { nodes, currentNode, lastStart, lastName }; - }, { nodes: [], currentNode: [], lastStart: 0, lastName: null }) - .nodes; - } - - public toCompletionItem () : CompletionItem { - const itemKind = this.isFunction ? CompletionItemKind.Function : CompletionItemKind.Reference; - return new CompletionItem(this.name, itemKind); - } -} - -class NodeMap { - - public readonly knots : KnotNode[]; - public readonly includes : string[]; - - private constructor (public filePath : string, fileText : string) { - const lines = fileText.split("\n"); - this.knots = lines - .reduce(( - {nodes, currentNode, lastStart, lastName, isFunction} - : { nodes: KnotNode[], currentNode: string[], lastStart : number, lastName : string | null, isFunction } - , line : string - , index : number) => { - if (line.match(/^\s*===(\s*function)?\s*(\w+)/)) { - // Found the start of a new knot. - const match = line.match(/^\s*===(\s*function)?\s*(\w+)/); - const newName = match[2]; - const foundFunction = (!!match[1]); - const node = new KnotNode(lastName, lastStart, index, this, currentNode.join("\n"), isFunction); - nodes.push(node); - return { nodes, currentNode: [line], lastStart: index, lastName: newName, isFunction: foundFunction }; - } - if (index === lines.length - 1) { - // Found the last line - const node = new KnotNode(lastName, lastStart, index + 1, this, currentNode.concat(line).join("\n"), false, true); - nodes.push(node); - return { nodes, currentNode: [line], lastStart: index, lastName: null, isFunction }; - } - currentNode.push(line); - return { nodes, currentNode, lastStart, lastName, isFunction }; - }, { nodes: [], currentNode: [], lastStart: 0, lastName: null, isFunction: false }) - .nodes; - this.includes = lines - .filter(line => line.match(/^\s*INCLUDE\s+(\w+\.ink)/)) - .map(line => { - const filename = line.match(/^\s*INCLUDE\s+(\w+\.ink)/)[1]; - const dirname = path.dirname(filePath); - return path.normalize(dirname + path.sep + filename); - }); - } - - public static from (filePath : string) : Promise { - return new Promise((resolve, reject) => { - fs.readFile(filePath, 'utf8', (err, data : string) => { - if (err) return reject(err); - return resolve(data); - }); - }) - .catch((err) => console.log("Error opening file: ", err)) - .then((data) => new NodeMap(filePath, data ? data : "")); - } - - public static fromDocument (document : TextDocument) : NodeMap { - const { fsPath } = document.uri; - return new NodeMap(fsPath, document.getText()); - } -} - -const nodeMaps : { [key: string]: NodeMap; } = {}; -let mapsDone : boolean = false; - -export function generateMaps () : Thenable { - return workspace.findFiles("**/*.ink") - .then(uris => { - return Promise.all(uris.map(({fsPath}) => NodeMap.from(fsPath))).catch(err => console.log); - }) - .then((maps : NodeMap[]) => { - maps.forEach(map => nodeMaps[map.filePath] = map); - mapsDone = true; - }); -} - -function getIncludeScope (filePath : string, knownScope : string[] = []) : string[] { - const fileMap = nodeMaps[filePath]; - if (!fileMap) return knownScope; - if (knownScope.indexOf(filePath) === -1) knownScope.push(filePath); - const newScope = fileMap.includes.filter(include => knownScope.indexOf(include) === -1); - if (newScope.length < 1) return knownScope; - return getIncludeScope(filePath, getIncludeScope(newScope[0], knownScope)); - -} - -function stitchFor (filePath : string, line : number) : StitchNode | null { - const nodemap = nodeMaps[filePath] - if (!nodemap) return null; - const knot = nodemap.knots.find(knot => knot.startLine <= line && knot.endLine > line); - if (!knot) { - console.log("Can't identify knot for line ", line); - return null; - } - const stitch = knot.stitches.find(stitch => stitch.startLine <= line && stitch.endLine > line); - if (!stitch) { - console.log("Can't identify stitch for line ", line); - return null; - } - return stitch; -} - -/* Gets the divert names that are in scope for a given line and file. */ -function getDivertsInScope (filePath: string, line : number) : DivertTarget[] { - if (nodeMaps[filePath]) { - let targets : DivertTarget[] = []; - const scope = getIncludeScope(filePath); - const knots = scope.map(path => - nodeMaps[path] - .knots - ) - .reduce((a, b) => a.concat(b)); - targets = targets.concat(knots); - const currentStitch = stitchFor(filePath, line); - if (currentStitch) { - const stitches = currentStitch.parentKnot.stitches; - const labels = currentStitch.labels; - targets = targets.concat(stitches); - targets = targets.concat(labels); - } else { - console.log("WARN: Couldn't find current stitch for line ", line); - } +// import { Uri, Position, CompletionItem, CompletionItemKind, Disposable, +// Location, TextDocument, TextDocumentChangeEvent, +// workspace } from "vscode"; +// import * as fs from "fs"; +// import * as path from "path"; + +// /* Divert targets that are always valid. */ +// const PERMANENT_DIVERTS = [ +// new CompletionItem("END", CompletionItemKind.Keyword), +// new CompletionItem("DONE", CompletionItemKind.Keyword), +// new CompletionItem("->", CompletionItemKind.Keyword) +// ] + +// class DivertTarget { +// constructor ( public readonly name : string | null) { } +// public line : number; +// public readonly parentFile : NodeMap; +// public toCompletionItem () : CompletionItem { +// return new CompletionItem(this.name, CompletionItemKind.Reference); +// } +// } + +// class LabelNode extends DivertTarget { + +// public get line () { +// return this._line + this.parentStitch.startLine; +// } + +// public get parentFile () { +// return this.parentStitch.parentKnot.parentFile; +// } + +// constructor ( +// public readonly name : string, +// private readonly _line : number, +// public readonly parentStitch : StitchNode +// ) { +// super(name); +// } + + +// } + +// class StitchNode extends DivertTarget { +// public readonly labels : LabelNode[] + +// public get line () { +// return this.startLine; +// } + +// public get startLine () { +// return this.parentKnot.startLine + this._relativeStart; +// } + +// public get parentFile () { +// return this.parentKnot.parentFile; +// } + +// public get endLine () { +// // On the last stich of the last knot in the file, we want the end line to actually be +// // the next line after the end of the file. This is why we track whether we're on the +// // last line or not when generating the map. +// return this.parentKnot.startLine + this._relativeEnd + (this.lastLine ? 1 : 0); +// } + +// constructor ( +// public readonly name : string, +// private readonly _relativeStart : number, +// private readonly _relativeEnd : number, +// public readonly parentKnot : KnotNode, +// textContent : string, +// private readonly lastLine : boolean = false +// ) { +// super(name); +// this.labels = textContent +// .split("\n") +// .map((line, index) => ({ found: line.match(/^\s*[-\*\+]\s*\((\w+)\)/), index })) +// .filter(({ found }) => found !== null) +// .map(({ found, index }) => new LabelNode(found[1], index, this)); +// } +// } + +// class KnotNode extends DivertTarget { + +// public readonly stitches; + +// public get line () { +// return this.startLine; +// } + +// constructor ( +// public readonly name : string | null, +// public readonly startLine : number, +// public readonly endLine : number, +// public readonly parentFile : NodeMap, +// textContent : string, +// private readonly isFunction : boolean = false, +// private readonly lastLine : boolean = false +// ) { +// super(name); +// const lines = textContent.split("\n"); +// this.stitches = lines +// .reduce(( +// {nodes, currentNode, lastStart, lastName} +// : { nodes: StitchNode[], currentNode: string[], lastStart : number, lastName : string | null } +// , line : string +// , index : number) => { +// if (line.match(/^\s*={1}\s*(\w+)/)) { +// // Found the start of a new stitch. +// const newName = line.match(/^\s*={1}\s*(\w+)/)[1]; +// const node = new StitchNode(lastName, lastStart, index, this, currentNode.join("\n")); +// nodes.push(node); +// if (index === lines.length -1) { +// // The new stitch is also the last line of the knot. +// const node = new StitchNode(newName, index, index + 1, this, currentNode.join("\n"), this.lastLine); +// nodes.push(node); +// } +// return { nodes, currentNode: [line], lastStart: index, lastName: newName }; +// } +// if (index === lines.length - 1) { +// // Found the last line. +// const node = new StitchNode(lastName, lastStart, index + 1, this, currentNode.join("\n"), this.lastLine); +// nodes.push(node); +// return { nodes, currentNode: [line], lastStart: index, lastName: null }; +// } +// currentNode.push(line); +// return { nodes, currentNode, lastStart, lastName }; +// }, { nodes: [], currentNode: [], lastStart: 0, lastName: null }) +// .nodes; +// } + +// public toCompletionItem () : CompletionItem { +// const itemKind = this.isFunction ? CompletionItemKind.Function : CompletionItemKind.Reference; +// return new CompletionItem(this.name, itemKind); +// } +// } + +// class NodeMap { + +// public readonly knots : KnotNode[]; +// public readonly includes : string[]; + +// private constructor (public filePath : string, fileText : string) { +// const lines = fileText.split("\n"); +// this.knots = lines +// .reduce(( +// {nodes, currentNode, lastStart, lastName, isFunction} +// : { nodes: KnotNode[], currentNode: string[], lastStart : number, lastName : string | null, isFunction } +// , line : string +// , index : number) => { +// if (line.match(/^\s*===(\s*function)?\s*(\w+)/)) { +// // Found the start of a new knot. +// const match = line.match(/^\s*===(\s*function)?\s*(\w+)/); +// const newName = match[2]; +// const foundFunction = (!!match[1]); +// const node = new KnotNode(lastName, lastStart, index, this, currentNode.join("\n"), isFunction); +// nodes.push(node); +// return { nodes, currentNode: [line], lastStart: index, lastName: newName, isFunction: foundFunction }; +// } +// if (index === lines.length - 1) { +// // Found the last line +// const node = new KnotNode(lastName, lastStart, index + 1, this, currentNode.concat(line).join("\n"), false, true); +// nodes.push(node); +// return { nodes, currentNode: [line], lastStart: index, lastName: null, isFunction }; +// } +// currentNode.push(line); +// return { nodes, currentNode, lastStart, lastName, isFunction }; +// }, { nodes: [], currentNode: [], lastStart: 0, lastName: null, isFunction: false }) +// .nodes; +// this.includes = lines +// .filter(line => line.match(/^\s*INCLUDE\s+(\w+\.ink)/)) +// .map(line => { +// const filename = line.match(/^\s*INCLUDE\s+(\w+\.ink)/)[1]; +// const dirname = path.dirname(filePath); +// return path.normalize(dirname + path.sep + filename); +// }); +// } + +// public static from (filePath : string) : Promise { +// return new Promise((resolve, reject) => { +// fs.readFile(filePath, 'utf8', (err, data : string) => { +// if (err) return reject(err); +// return resolve(data); +// }); +// }) +// .catch((err) => console.log("Error opening file: ", err)) +// .then((data) => new NodeMap(filePath, data ? data : "")); +// } + +// public static fromDocument (document : TextDocument) : NodeMap { +// const { fsPath } = document.uri; +// return new NodeMap(fsPath, document.getText()); +// } +// } + +// const nodeMaps : { [key: string]: NodeMap; } = {}; +// let mapsDone : boolean = false; + +// export function generateMaps () : Thenable { +// return workspace.findFiles("**/*.ink") +// .then(uris => { +// return Promise.all(uris.map(({fsPath}) => NodeMap.from(fsPath))).catch(err => console.log); +// }) +// .then((maps : NodeMap[]) => { +// maps.forEach(map => nodeMaps[map.filePath] = map); +// mapsDone = true; +// }); +// } + +// function getIncludeScope (filePath : string, knownScope : string[] = []) : string[] { +// const fileMap = nodeMaps[filePath]; +// if (!fileMap) return knownScope; +// if (knownScope.indexOf(filePath) === -1) knownScope.push(filePath); +// const newScope = fileMap.includes.filter(include => knownScope.indexOf(include) === -1); +// if (newScope.length < 1) return knownScope; +// return getIncludeScope(filePath, getIncludeScope(newScope[0], knownScope)); + +// } + +// function stitchFor (filePath : string, line : number) : StitchNode | null { +// const nodemap = nodeMaps[filePath] +// if (!nodemap) return null; +// const knot = nodemap.knots.find(knot => knot.startLine <= line && knot.endLine > line); +// if (!knot) { +// console.log("Can't identify knot for line ", line); +// return null; +// } +// const stitch = knot.stitches.find(stitch => stitch.startLine <= line && stitch.endLine > line); +// if (!stitch) { +// console.log("Can't identify stitch for line ", line); +// return null; +// } +// return stitch; +// } + +// /* Gets the divert names that are in scope for a given line and file. */ +// function getDivertsInScope (filePath: string, line : number) : DivertTarget[] { +// if (nodeMaps[filePath]) { +// let targets : DivertTarget[] = []; +// const scope = getIncludeScope(filePath); +// const knots = scope.map(path => +// nodeMaps[path] +// .knots +// ) +// .reduce((a, b) => a.concat(b)); +// targets = targets.concat(knots); +// const currentStitch = stitchFor(filePath, line); +// if (currentStitch) { +// const stitches = currentStitch.parentKnot.stitches; +// const labels = currentStitch.labels; +// targets = targets.concat(stitches); +// targets = targets.concat(labels); +// } else { +// console.log("WARN: Couldn't find current stitch for line ", line); +// } - return targets; - } - console.log(`Node map missing for file ${filePath}`); - return []; -} - -export function getDefinitionByNameAndScope (name: string, filePath : string, line : number) : Location { - const divert = getDivertsInScope(filePath, line) - .find(target => target.name === name); - return new Location(Uri.file(divert.parentFile.filePath), new Position(divert.line, 0)); -} - -/* Returns completion items for divert target names for a given line and file. */ -export function getDivertCompletionTargets (filePath : string, line : number) : CompletionItem[] { - return getDivertsInScope(filePath, line) - .filter(target => target.name !== null) - .map(target => target.toCompletionItem()) - .concat(PERMANENT_DIVERTS); -} - -export class NodeController { - private _disposable : Disposable; - - constructor () { - let subscriptions : Disposable[] = []; - workspace.onDidChangeTextDocument(this._onEvent, this, subscriptions); - - this._disposable = Disposable.from(...subscriptions); - } - - private _onEvent ({ contentChanges, document } : TextDocumentChangeEvent) { - // Don't rebuild the entire file unless we have a new line or special character - // suggesting the node map actually changed. - if (!contentChanges.find(change => change.text.match(/[\n\*\+\(\)-=]/) !== null)) return; - const { fsPath } = document.uri; - nodeMaps[fsPath] = NodeMap.fromDocument(document); - } - - public dispose () { - this._disposable.dispose(); - } -} \ No newline at end of file +// return targets; +// } +// console.log(`Node map missing for file ${filePath}`); +// return []; +// } + +// export function getDefinitionByNameAndScope (name: string, filePath : string, line : number) : Location { +// const divert = getDivertsInScope(filePath, line) +// .find(target => target.name === name); +// return new Location(Uri.file(divert.parentFile.filePath), new Position(divert.line, 0)); +// } + +// /* Returns completion items for divert target names for a given line and file. */ +// export function getDivertCompletionTargets (filePath : string, line : number) : CompletionItem[] { +// return getDivertsInScope(filePath, line) +// .filter(target => target.name !== null) +// .map(target => target.toCompletionItem()) +// .concat(PERMANENT_DIVERTS); +// } + +// export class NodeController { +// private _disposable : Disposable; + +// constructor () { +// let subscriptions : Disposable[] = []; +// workspace.onDidChangeTextDocument(this._onEvent, this, subscriptions); + +// this._disposable = Disposable.from(...subscriptions); +// } + +// private _onEvent ({ contentChanges, document } : TextDocumentChangeEvent) { +// // Don't rebuild the entire file unless we have a new line or special character +// // suggesting the node map actually changed. +// if (!contentChanges.find(change => change.text.match(/[\n\*\+\(\)-=]/) !== null)) return; +// const { fsPath } = document.uri; +// nodeMaps[fsPath] = NodeMap.fromDocument(document); +// } + +// public dispose () { +// this._disposable.dispose(); +// } +// } \ No newline at end of file diff --git a/src/wordcount.ts b/src/wordcount.ts index 004e29b..fd2853c 100644 --- a/src/wordcount.ts +++ b/src/wordcount.ts @@ -1,137 +1,137 @@ -'use strict'; +// 'use strict'; -import { window, workspace, commands, Disposable, ExtensionContext, StatusBarAlignment, StatusBarItem, TextDocument } from "vscode"; +// import { window, workspace, commands, Disposable, ExtensionContext, StatusBarAlignment, StatusBarItem, TextDocument } from "vscode"; -/* Provides word count functionality. Mostly adapted from the example - word counter extension. -*/ -export class WordAndNodeCounter { - private _statusBarItem: StatusBarItem; +// /* Provides word count functionality. Mostly adapted from the example +// word counter extension. +// */ +// export class WordAndNodeCounter { +// private _statusBarItem: StatusBarItem; - private plural (n: number, word: string) : string { - return `${n} ${n === 1 ? word : `${word}s`}`; - } +// private plural (n: number, word: string) : string { +// return `${n} ${n === 1 ? word : `${word}s`}`; +// } - public updateWordCount () { - // Create this as needed. - if (!this._statusBarItem) - this._statusBarItem = window.createStatusBarItem(StatusBarAlignment.Left); +// public updateWordCount () { +// // Create this as needed. +// if (!this._statusBarItem) +// this._statusBarItem = window.createStatusBarItem(StatusBarAlignment.Left); - // Get the current text editor. - let editor = window.activeTextEditor; - if (!editor) { - this._statusBarItem.hide(); - return; - } - - let doc = editor.document; - - // Only update status if an Ink file. - if (doc.languageId === "ink") { - const docContent = doc.getText(); - const wordCount = this._getWordCount(docContent); - const nodeCount = this._getNodeCount(docContent); - - - // Update the status bar, finally. - this._statusBarItem.text = `$(pencil) ${this.plural(wordCount, "Word")} in ${this.plural(nodeCount, "Node")}`; - this._statusBarItem.show(); - } else { - this._statusBarItem.hide(); - } - } - - private static lineReducer (stack: { scope: string, lines: string[]}, line: string): { scope: string, lines: string[] } { - // Reducer function to remove undesirable lines and inline content. - let { scope, lines } = stack; - if (line.match(/^\s*$/)) return stack; // Empty line - if (scope === "multiline") { // Continuing multiline { block } - if (line.match(/\}/) !== null) { - scope = "root"; - // Add just the part of the line after the }, if anything. - return WordAndNodeCounter.lineReducer({ scope, lines }, (line.match(/}(.*)/)[1])); - } - return stack; - } - if (scope === "comment") { // Continuing multiline comment - if (line.match(/\*\//) !== null) { - scope = "root"; - return WordAndNodeCounter.lineReducer({ scope, lines }, (line.match(/\*\/(.*)/)[1])); - } - return stack; - } - if (line.match(/\{/) !== null) { // Start of { block } - if (line.match(/\}/) !== null) - return WordAndNodeCounter.lineReducer(stack, line.replace(/\{.*\}/, "")); - scope = "multiline"; - return { scope, lines }; - } - if (line.match(/\/\//) !== null) { // // Comment - return WordAndNodeCounter.lineReducer(stack, line.replace(/\/\/.*/, "")); - } - if (line.match(/\/\*/)) { // Start of /* comment - if (line.match(/\*\//)) { - return WordAndNodeCounter.lineReducer(stack, line.replace(/\/\*.*\*\//, "")); - } - scope = "comment"; - return { scope, lines }; - } - // Various single-line directives/statements to ignore in wc - if (line.match(/^\s*(~|=|VAR|EXTERNAL|INCLUDE)/) === null) { - lines.push(line); - } - return { scope, lines }; - } - - public _getWordCount (docContent: string): number { - - // TODO: Write code for accurate word count of Ink document. - // TODO: Add node count. - - /* We want an *accurate* word count, so we want to ignore things like knot identifiers - * as much as possible. Consequently, we must go line by line and identify any lines - * that should not be counted. */ - - - return docContent.split("\n").reduce(WordAndNodeCounter.lineReducer, { scope: 'root', lines: [] }) - .lines - .join(" ") - .split(/\s/) - .filter(word => word.match(/\w/)) - .length; - } - - public _getNodeCount (docContent: string): number { - return docContent.split("\n").filter(line => line.match(/^\s*=/)).length; - } - - public dispose() { - this._statusBarItem.dispose(); - } -} - -export class WordNodeCounterController { - private _wordCounter: WordAndNodeCounter; - private _disposable: Disposable; - - constructor (wordCounter: WordAndNodeCounter) { - this._wordCounter = wordCounter; - this._wordCounter.updateWordCount(); - - // Subscribe to selection change and editor activation events. - let subscriptions: Disposable[] = []; - window.onDidChangeTextEditorSelection(this._onEvent, this, subscriptions); - window.onDidChangeActiveTextEditor(this._onEvent, this, subscriptions); - - // Create a combined disposable from both event subscriptions. - this._disposable = Disposable.from(...subscriptions); - } - - private _onEvent () { - this._wordCounter.updateWordCount(); - } - - public dispose () { - this._disposable.dispose(); - } -} \ No newline at end of file +// // Get the current text editor. +// let editor = window.activeTextEditor; +// if (!editor) { +// this._statusBarItem.hide(); +// return; +// } + +// let doc = editor.document; + +// // Only update status if an Ink file. +// if (doc.languageId === "ink") { +// const docContent = doc.getText(); +// const wordCount = this._getWordCount(docContent); +// const nodeCount = this._getNodeCount(docContent); + + +// // Update the status bar, finally. +// this._statusBarItem.text = `$(pencil) ${this.plural(wordCount, "Word")} in ${this.plural(nodeCount, "Node")}`; +// this._statusBarItem.show(); +// } else { +// this._statusBarItem.hide(); +// } +// } + +// private static lineReducer (stack: { scope: string, lines: string[]}, line: string): { scope: string, lines: string[] } { +// // Reducer function to remove undesirable lines and inline content. +// let { scope, lines } = stack; +// if (line.match(/^\s*$/)) return stack; // Empty line +// if (scope === "multiline") { // Continuing multiline { block } +// if (line.match(/\}/) !== null) { +// scope = "root"; +// // Add just the part of the line after the }, if anything. +// return WordAndNodeCounter.lineReducer({ scope, lines }, (line.match(/}(.*)/)[1])); +// } +// return stack; +// } +// if (scope === "comment") { // Continuing multiline comment +// if (line.match(/\*\//) !== null) { +// scope = "root"; +// return WordAndNodeCounter.lineReducer({ scope, lines }, (line.match(/\*\/(.*)/)[1])); +// } +// return stack; +// } +// if (line.match(/\{/) !== null) { // Start of { block } +// if (line.match(/\}/) !== null) +// return WordAndNodeCounter.lineReducer(stack, line.replace(/\{.*\}/, "")); +// scope = "multiline"; +// return { scope, lines }; +// } +// if (line.match(/\/\//) !== null) { // // Comment +// return WordAndNodeCounter.lineReducer(stack, line.replace(/\/\/.*/, "")); +// } +// if (line.match(/\/\*/)) { // Start of /* comment +// if (line.match(/\*\//)) { +// return WordAndNodeCounter.lineReducer(stack, line.replace(/\/\*.*\*\//, "")); +// } +// scope = "comment"; +// return { scope, lines }; +// } +// // Various single-line directives/statements to ignore in wc +// if (line.match(/^\s*(~|=|VAR|EXTERNAL|INCLUDE)/) === null) { +// lines.push(line); +// } +// return { scope, lines }; +// } + +// public _getWordCount (docContent: string): number { + +// // TODO: Write code for accurate word count of Ink document. +// // TODO: Add node count. + +// /* We want an *accurate* word count, so we want to ignore things like knot identifiers +// * as much as possible. Consequently, we must go line by line and identify any lines +// * that should not be counted. */ + + +// return docContent.split("\n").reduce(WordAndNodeCounter.lineReducer, { scope: 'root', lines: [] }) +// .lines +// .join(" ") +// .split(/\s/) +// .filter(word => word.match(/\w/)) +// .length; +// } + +// public _getNodeCount (docContent: string): number { +// return docContent.split("\n").filter(line => line.match(/^\s*=/)).length; +// } + +// public dispose() { +// this._statusBarItem.dispose(); +// } +// } + +// export class WordNodeCounterController { +// private _wordCounter: WordAndNodeCounter; +// private _disposable: Disposable; + +// constructor (wordCounter: WordAndNodeCounter) { +// this._wordCounter = wordCounter; +// this._wordCounter.updateWordCount(); + +// // Subscribe to selection change and editor activation events. +// let subscriptions: Disposable[] = []; +// window.onDidChangeTextEditorSelection(this._onEvent, this, subscriptions); +// window.onDidChangeActiveTextEditor(this._onEvent, this, subscriptions); + +// // Create a combined disposable from both event subscriptions. +// this._disposable = Disposable.from(...subscriptions); +// } + +// private _onEvent () { +// this._wordCounter.updateWordCount(); +// } + +// public dispose () { +// this._disposable.dispose(); +// } +// } \ No newline at end of file diff --git a/syntaxes/ink.tmLanguage b/syntaxes/ink.tmLanguage deleted file mode 100644 index b505a61..0000000 --- a/syntaxes/ink.tmLanguage +++ /dev/null @@ -1,670 +0,0 @@ - - - - - name - ink - scopeName - source.ink - fileTypes - - ink - ink2 - - uuid - 5a0f60ba-87b8-4fa9-854c-6bf41f74bd98 - patterns - - - include - #comments - - - match - ^\s*(={2,})\s*(function)?\s*(\w+)\s*(\([^)]*\))?\s*(={1,})? - captures - - 1 - - name - markup.punctuation - - 2 - - name - keyword.function - - 3 - - name - entity.name.knot - - 4 - - name - variable.parameter - - 5 - - name - markup.punctuation - - - name - meta.knot.declaration - - - match - ^\s*(=)\s*(\w+)\s*(\([^)\n]*\))?\s*$ - captures - - 1 - - name - markup.punctuation - - 2 - - name - entity.name.stitch - - 3 - - name - variable.parameter - - - name - meta.stitch.declaration - - - include - #choice - - - include - #gather - - - include - #statements - - - repository - - tag - - begin - (#)\s* - end - \s*$\n* - captures - - 1 - - name - keyword.operator.hashtag - - - contentName - entity.name.tag - patterns - - - include - #comments - - - - comments - - patterns - - - begin - /\*\* - captures - - 0 - - name - punctuation.definition.comment.json - - - end - \*/ - name - comment.block.documentation.json - - - begin - /\* - captures - - 0 - - name - punctuation.definition.comment.json - - - end - \*/ - name - comment.block.json - - - captures - - 1 - - name - punctuation.definition.comment.json - - - match - (//).*$\n? - name - comment.line.double-slash.js - - - - TODO - - match - ^\s*(?:(TODO\s*:)|(TODO\b))\s*(.*) - captures - - 1 - - name - comment.todo.TODO - - 2 - - name - comment.todo.TODO - - - end - $\n? - name - comment.todo - - include - - begin - ^\s*((INCLUDE)\s*(\S*))\s* - beginCaptures - - 1 - - name - meta.include - - 2 - - name - keyword.control.include - - 3 - - name - string.other - - - end - $\n? - - external - - begin - ^\s*((EXTERNAL)\s*([\w_0-9]*\(\)))\s* - beginCaptures - - 1 - - name - meta.external - - 2 - - name - keyword.control.external - - 3 - - name - support.function - - - end - $\n? - - globalVAR - - begin - ^\s*((VAR|CONST)\s*(\w+))\s* - beginCaptures - - 1 - - name - meta.variable.declaration - - 2 - - name - storage - - 3 - - name - entity.name.variable - - - end - $\n? - name - meta.variable.assignment - - choice - - begin - ^\s*((?:[\*\+]\s?)+)\s*(\(\s*(\w+)\s*\))? - beginCaptures - - 1 - - name - keyword.operator.weaveBullet.choice - - 2 - - name - meta.label - - 3 - - name - entity.name.label - - - end - $\n? - name - choice - patterns - - - include - #comments - - - match - (\[)([^\]]*)(\]) - captures - - 1 - - name - keyword.operator.weaveBracket - - 2 - - name - string.content - - 3 - - name - keyword.operator.weaveBracket - - - - - include - #divert - - - include - #mixedContent - - - - gather - - match - ^\s*((?:-\s*)+)(?!>)(\(\s*(\w+)\s*\))? - captures - - 1 - - name - keyword.operator.weaveBullet.gather - - 2 - - name - meta.label - - 3 - - name - entity.name.label - - - name - meta.gather - - multiLineLogic - - begin - ^\s*(\{)([\w_\s\*\/\-\+\&\|\%\<\>\.\(\)]+(:))?(?=[^}]+$) - beginCaptures - - 0 - - name - meta.logicBegin - - 1 - - name - keyword.operator.logic - - 3 - - name - keyword.operator.logic - - - end - (\}) - endCaptures - - 1 - - name - keyword.operator - - - contentName - meta.multilineLogicInner - name - meta.multilineLogic - patterns - - - match - ^\s*else\s*\: - name - conditional.else - - - begin - ^\s*(-)\s?[^:]+(:) - beginCaptures - - 1 - - name - keyword.operator - - 2 - - name - keyword.operator - - - end - $\n? - name - conditional.clause - patterns - - - include - #mixedContent - - - - - include - #statements - - - - inlineConditional - - begin - (\{)[^:\|\}]+: - beginCaptures - - 1 - - name - keyword.operator.inlineConditionalStart - - - end - (\}) - endCaptures - - 1 - - name - keyword.operator.inlineConditionalEnd - - - name - entity.inlineConditional - patterns - - - match - \| - name - keyword.operator.inlineConditionalBranchSeparator - - - include - #mixedContent - - - - inlineSequence - - begin - (\{)\s*(~|&|!|\$)?(?=([^\|]*\|(?!\|)[^\}]*)\}) - beginCaptures - - 1 - - name - keyword.operator.inlineSequenceStart - - 2 - - name - keyword.operator.inlineSequenceTypeChar - - - end - \} - endCaptures - - 0 - - name - keyword.operator.inlineSequenceEnd - - - name - entity.inlineSequence - patterns - - - match - \|(?!\|) - name - keyword.operator.inlineSequenceSeparator - - - include - #mixedContent - - - - inlineLogic - - begin - (\{) - beginCaptures - - 1 - - name - keyword.operator.inlineLogicStart - - - end - (\}) - endCaptures - - 1 - - name - keyword.operator.inlineLogicEnd - - - name - meta.logic - - logicLine - - match - \s*(~\s*.*)$ - captures - - 0 - - name - meta.logic - - - - divert - - match - (->|<-)\s*((?:(DONE)|(END)|(\w+))(?:\s*\.\s*(?:\w+))*\s*(?:\([^\)]+\))?)? - name - meta.divert - captures - - 1 - - name - keyword.operator.divert - - 3 - - name - keyword.done - - 4 - - name - keyword.end - - 5 - - name - variable.divertTarget - - - - mixedContent - - patterns - - - include - #inlineConditional - - - include - #inlineSequence - - - include - #inlineLogic - - - include - #divert - - - match - <> - name - constant.glue - - - - statements - - patterns - - - include - #include - - - include - #external - - - include - #comments - - - include - #TODO - - - include - #globalVAR - - - include - #choice - - - include - #gather - - - include - #multiLineLogic - - - include - #endOfSection - - - include - #logicLine - - - include - #mixedContent - - - include - #tag - - - - - - \ No newline at end of file diff --git a/syntaxes/ink.tmLanguage.json b/syntaxes/ink.tmLanguage.json new file mode 100644 index 0000000..0ffb333 --- /dev/null +++ b/syntaxes/ink.tmLanguage.json @@ -0,0 +1,435 @@ +{ + "name": "ink", + "scopeName": "source.ink", + "fileTypes": [ + "ink", + "ink2" + ], + "uuid": "5a0f60ba-87b8-4fa9-854c-6bf41f74bd98", + "patterns": [ + { + "include": "#comments" + }, + { + "include": "#knot" + }, + { + "include": "#stitch" + }, + { + "include": "#choice" + }, + { + "include": "#gather" + }, + { + "include": "#statements" + } + ], + "repository": { + "stitch": { + "match": "^\\s*(=)\\s*(\\w+)\\s*(\\([^)\\n]*\\))?\\s*$", + "captures": { + "1": { + "name": "markup.punctuation" + }, + "2": { + "name": "entity.name.stitch" + }, + "3": { + "name": "variable.parameter" + } + }, + "name": "meta.stitch.declaration" + }, + "knot": { + "match": "^\\s*(={2,})\\s*(function)?\\s*(\\w+)\\s*(\\([^)]*\\))?\\s*(={1,})?", + "captures": { + "1": { + "name": "markup.punctuation" + }, + "2": { + "name": "keyword.function" + }, + "3": { + "name": "entity.name.knot" + }, + "4": { + "name": "variable.parameter" + }, + "5": { + "name": "markup.punctuation" + } + }, + "name": "meta.knot.declaration" + }, + "tag": { + "begin": "(#)\\s*", + "end": "\\s*$\\n*", + "captures": { + "1": { + "name": "keyword.operator.hashtag" + } + }, + "contentName": "entity.name.tag", + "patterns": [ + { + "include": "#comments" + } + ] + }, + "comments": { + "patterns": [ + { + "begin": "/\\*\\*", + "captures": { + "0": { + "name": "punctuation.definition.comment.json" + } + }, + "end": "\\*/", + "name": "comment.block.documentation.json" + }, + { + "begin": "/\\*", + "captures": { + "0": { + "name": "punctuation.definition.comment.json" + } + }, + "end": "\\*/", + "name": "comment.block.json" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.comment.json" + } + }, + "match": "(//).*$\\n?", + "name": "comment.line.double-slash.js" + } + ] + }, + "TODO": { + "match": "^\\s*(?:(TODO\\s*:)|(TODO\\b))\\s*(.*)", + "captures": { + "1": { + "name": "comment.todo.TODO" + }, + "2": { + "name": "comment.todo.TODO" + }, + "3": { + "name": "comment.todo.message" + } + }, + "begin": "^\\s*(?:(TODO\\s*:)|(TODO\\b))\\s*", + "end": "$\\n?", + "name": "comment.todo" + }, + "include": { + "begin": "^\\s*((INCLUDE)\\s*(\\S*))\\s*", + "beginCaptures": { + "1": { + "name": "meta.include" + }, + "2": { + "name": "keyword.control.include" + }, + "3": { + "name": "string.other" + } + }, + "end": "$\\n?" + }, + "external": { + "begin": "^\\s*((EXTERNAL)\\s*([\\w_0-9]*\\(\\)))\\s*", + "beginCaptures": { + "1": { + "name": "meta.external" + }, + "2": { + "name": "keyword.control.external" + }, + "3": { + "name": "support.function" + } + }, + "end": "$\\n?" + }, + "globalVAR": { + "begin": "^\\s*((VAR|CONST)\\s*(\\w+))\\s*", + "beginCaptures": { + "1": { + "name": "meta.variable.declaration" + }, + "2": { + "name": "storage" + }, + "3": { + "name": "entity.name.variable" + } + }, + "end": "$\\n?", + "name": "meta.variable.assignment" + }, + "choice": { + "begin": "^\\s*((?:[\\*\\+]\\s?)+)\\s*(\\(\\s*(\\w+)\\s*\\))?", + "beginCaptures": { + "1": { + "name": "keyword.operator.weaveBullet.choice" + }, + "2": { + "name": "meta.label" + }, + "3": { + "name": "entity.name.label" + } + }, + "end": "$\\n?", + "name": "choice", + "patterns": [ + { + "include": "#comments" + }, + { + "match": "(\\[)([^\\]]*)(\\])", + "captures": { + "1": { + "name": "keyword.operator.weaveBracket" + }, + "2": { + "name": "string.content" + }, + "3": { + "name": "keyword.operator.weaveBracket" + } + } + }, + { + "include": "#divert" + }, + { + "include": "#mixedContent" + } + ] + }, + "gather": { + "match": "^\\s*((?:-\\s*)+)(?!>)(\\(\\s*(\\w+)\\s*\\))?", + "captures": { + "1": { + "name": "keyword.operator.weaveBullet.gather" + }, + "2": { + "name": "meta.label" + }, + "3": { + "name": "entity.name.label" + } + }, + "name": "meta.gather" + }, + "multiLineLogic": { + "begin": "^\\s*(\\{)([\\w_\\s\\*\\/\\-\\+\\&\\|\\%\\<\\>\\.\\(\\)]+(:))?(?=[^}]+$)", + "beginCaptures": { + "0": { + "name": "meta.logicBegin" + }, + "1": { + "name": "keyword.operator.logic" + }, + "3": { + "name": "keyword.operator.logic" + } + }, + "end": "(\\})", + "endCaptures": { + "1": { + "name": "keyword.operator" + } + }, + "contentName": "meta.multilineLogicInner", + "name": "meta.multilineLogic", + "patterns": [ + { + "match": "^\\s*else\\s*\\:", + "name": "conditional.else" + }, + { + "begin": "^\\s*(-)\\s?[^:]+(:)", + "beginCaptures": { + "1": { + "name": "keyword.operator" + }, + "2": { + "name": "keyword.operator" + } + }, + "end": "$\\n?", + "name": "conditional.clause", + "patterns": [ + { + "include": "#mixedContent" + } + ] + }, + { + "include": "#statements" + } + ] + }, + "inlineConditional": { + "begin": "(\\{)[^:\\|\\}]+:", + "beginCaptures": { + "1": { + "name": "keyword.operator.inlineConditionalStart" + } + }, + "end": "(\\})", + "endCaptures": { + "1": { + "name": "keyword.operator.inlineConditionalEnd" + } + }, + "name": "entity.inlineConditional", + "patterns": [ + { + "match": "\\|", + "name": "keyword.operator.inlineConditionalBranchSeparator" + }, + { + "include": "#mixedContent" + } + ] + }, + "inlineSequence": { + "begin": "(\\{)\\s*(~|&|!|\\$)?(?=([^\\|]*\\|(?!\\|)[^\\}]*)\\})", + "beginCaptures": { + "1": { + "name": "keyword.operator.inlineSequenceStart" + }, + "2": { + "name": "keyword.operator.inlineSequenceTypeChar" + } + }, + "end": "\\}", + "endCaptures": { + "0": { + "name": "keyword.operator.inlineSequenceEnd" + } + }, + "name": "entity.inlineSequence", + "patterns": [ + { + "match": "\\|(?!\\|)", + "name": "keyword.operator.inlineSequenceSeparator" + }, + { + "include": "#mixedContent" + } + ] + }, + "inlineLogic": { + "begin": "(\\{)", + "beginCaptures": { + "1": { + "name": "keyword.operator.inlineLogicStart" + } + }, + "end": "(\\})", + "endCaptures": { + "1": { + "name": "keyword.operator.inlineLogicEnd" + } + }, + "name": "meta.logic" + }, + "logicLine": { + "match": "\\s*(~\\s*.*)$", + "captures": { + "0": { + "name": "meta.logic" + } + } + }, + "divert": { + "match": "(->|<-)\\s*((?:(DONE)|(END)|(\\w+))(?:\\s*\\.\\s*(?:\\w+))*\\s*(?:\\([^\\)]+\\))?)?", + "name": "meta.divert", + "captures": { + "1": { + "name": "keyword.operator.divert" + }, + "3": { + "name": "keyword.done" + }, + "4": { + "name": "keyword.end" + }, + "5": { + "name": "variable.divertTarget" + } + } + }, + "mixedContent": { + "patterns": [ + { + "include": "#inlineConditional" + }, + { + "include": "#inlineSequence" + }, + { + "include": "#inlineLogic" + }, + { + "include": "#divert" + }, + { + "match": "<>", + "name": "constant.glue" + } + ] + }, + "statements": { + "patterns": [ + { + "include": "#include" + }, + { + "include": "#external" + }, + { + "include": "#comments" + }, + { + "include": "#TODO" + }, + { + "include": "#globalVAR" + }, + { + "include": "#choice" + }, + { + "include": "#gather" + }, + { + "include": "#multiLineLogic" + }, + { + "include": "#endOfSection" + }, + { + "include": "#logicLine" + }, + { + "include": "#mixedContent" + }, + { + "include": "#tag" + } + ] + } + } +} diff --git a/syntaxes/ink.tmLanguage.yaml b/syntaxes/ink.tmLanguage.yaml new file mode 100644 index 0000000..b70e9e8 --- /dev/null +++ b/syntaxes/ink.tmLanguage.yaml @@ -0,0 +1,250 @@ +name: ink +scopeName: source.ink +fileTypes: + - ink + - ink2 +uuid: 5a0f60ba-87b8-4fa9-854c-6bf41f74bd98 +patterns: + - include: "#comments" + - include: "#knot" + - include: "#stitch" + - include: "#choice" + - include: "#gather" + - include: "#statements" +repository: + stitch: + match: ^\s*(=)\s*(\w+)\s*(\([^)\n]*\))?\s*$ + captures: + "1": + name: markup.punctuation + "2": + name: entity.name.stitch + "3": + name: variable.parameter + name: meta.stitch.declaration + knot: + match: ^\s*(={2,})\s*(function)?\s*(\w+)\s*(\([^)]*\))?\s*(={1,})? + captures: + "1": + name: markup.punctuation + "2": + name: keyword.function + "3": + name: entity.name.knot + "4": + name: variable.parameter + "5": + name: markup.punctuation + name: meta.knot.declaration + tag: + begin: (#)\s* + end: \s*$\n* + captures: + "1": + name: keyword.operator.hashtag + contentName: entity.name.tag + patterns: + - include: "#comments" + comments: + patterns: + - begin: /\*\* + captures: + "0": + name: punctuation.definition.comment.json + end: \*/ + name: comment.block.documentation.json + - begin: /\* + captures: + "0": + name: punctuation.definition.comment.json + end: \*/ + name: comment.block.json + - captures: + "1": + name: punctuation.definition.comment.json + match: (//).*$\n? + name: comment.line.double-slash.js + TODO: + match: ^\s*(?:(TODO\s*:)|(TODO\b))\s*(.*) + captures: + "1": + name: comment.todo.TODO + "2": + name: comment.todo.TODO + "3": + name: comment.todo.message + begin: ^\s*(?:(TODO\s*:)|(TODO\b))\s* + end: $\n? + name: comment.todo + include: + begin: ^\s*((INCLUDE)\s*(\S*))\s* + beginCaptures: + "1": + name: meta.include + "2": + name: keyword.control.include + "3": + name: string.other + end: $\n? + external: + begin: ^\s*((EXTERNAL)\s*([\w_0-9]*\(\)))\s* + beginCaptures: + "1": + name: meta.external + "2": + name: keyword.control.external + "3": + name: support.function + end: $\n? + globalVAR: + begin: ^\s*((VAR|CONST)\s*(\w+))\s* + beginCaptures: + "1": + name: meta.variable.declaration + "2": + name: storage + "3": + name: entity.name.variable + end: $\n? + name: meta.variable.assignment + choice: + begin: ^\s*((?:[\*\+]\s?)+)\s*(\(\s*(\w+)\s*\))? + beginCaptures: + "1": + name: keyword.operator.weaveBullet.choice + "2": + name: meta.label + "3": + name: entity.name.label + end: $\n? + name: choice + patterns: + - include: "#comments" + - match: (\[)([^\]]*)(\]) + captures: + "1": + name: keyword.operator.weaveBracket + "2": + name: string.content + "3": + name: keyword.operator.weaveBracket + - include: "#divert" + - include: "#mixedContent" + gather: + match: ^\s*((?:-\s*)+)(?!>)(\(\s*(\w+)\s*\))? + captures: + "1": + name: keyword.operator.weaveBullet.gather + "2": + name: meta.label + "3": + name: entity.name.label + name: meta.gather + multiLineLogic: + begin: ^\s*(\{)([\w_\s\*\/\-\+\&\|\%\<\>\.\(\)]+(:))?(?=[^}]+$) + beginCaptures: + "0": + name: meta.logicBegin + "1": + name: keyword.operator.logic + "3": + name: keyword.operator.logic + end: (\}) + endCaptures: + "1": + name: keyword.operator + contentName: meta.multilineLogicInner + name: meta.multilineLogic + patterns: + - match: "^\\s*else\\s*\\:" + name: conditional.else + - begin: ^\s*(-)\s?[^:]+(:) + beginCaptures: + "1": + name: keyword.operator + "2": + name: keyword.operator + end: $\n? + name: conditional.clause + patterns: + - include: "#mixedContent" + - include: "#statements" + inlineConditional: + begin: "(\\{)[^:\\|\\}]+:" + beginCaptures: + "1": + name: keyword.operator.inlineConditionalStart + end: (\}) + endCaptures: + "1": + name: keyword.operator.inlineConditionalEnd + name: entity.inlineConditional + patterns: + - match: \| + name: keyword.operator.inlineConditionalBranchSeparator + - include: "#mixedContent" + inlineSequence: + begin: (\{)\s*(~|&|!|\$)?(?=([^\|]*\|(?!\|)[^\}]*)\}) + beginCaptures: + "1": + name: keyword.operator.inlineSequenceStart + "2": + name: keyword.operator.inlineSequenceTypeChar + end: \} + endCaptures: + "0": + name: keyword.operator.inlineSequenceEnd + name: entity.inlineSequence + patterns: + - match: \|(?!\|) + name: keyword.operator.inlineSequenceSeparator + - include: "#mixedContent" + inlineLogic: + begin: (\{) + beginCaptures: + "1": + name: keyword.operator.inlineLogicStart + end: (\}) + endCaptures: + "1": + name: keyword.operator.inlineLogicEnd + name: meta.logic + logicLine: + match: \s*(~\s*.*)$ + captures: + "0": + name: meta.logic + divert: + match: (->|<-)\s*((?:(DONE)|(END)|(\w+))(?:\s*\.\s*(?:\w+))*\s*(?:\([^\)]+\))?)? + name: meta.divert + captures: + "1": + name: keyword.operator.divert + "3": + name: keyword.done + "4": + name: keyword.end + "5": + name: variable.divertTarget + mixedContent: + patterns: + - include: "#inlineConditional" + - include: "#inlineSequence" + - include: "#inlineLogic" + - include: "#divert" + - match: <> + name: constant.glue + statements: + patterns: + - include: "#include" + - include: "#external" + - include: "#comments" + - include: "#TODO" + - include: "#globalVAR" + - include: "#choice" + - include: "#gather" + - include: "#multiLineLogic" + - include: "#endOfSection" + - include: "#logicLine" + - include: "#mixedContent" + - include: "#tag" diff --git a/tsconfig.json b/tsconfig.json index 11282c9..180ed53 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,13 +1,16 @@ { "compilerOptions": { - "module": "commonjs", + "module": "nodenext", "target": "es6", "outDir": "out", "lib": [ "es6" ], "sourceMap": true, - "rootDir": "." + "rootDir": ".", + "types": [ + "node" + ] }, "exclude": [ "node_modules", From ca19639ca02c8b24ae4426be65421ba1a01a3a7a Mon Sep 17 00:00:00 2001 From: sfaray Date: Thu, 28 May 2026 21:12:49 +0700 Subject: [PATCH 2/3] fixed ts errors --- package-lock.json | 3 +- src/completion.ts | 26 +- src/definitions.ts | 36 +-- src/extension.ts | 50 ++-- src/nodemap.ts | 611 +++++++++++++++++++++++---------------------- src/wordcount.ts | 264 ++++++++++---------- 6 files changed, 503 insertions(+), 487 deletions(-) diff --git a/package-lock.json b/package-lock.json index 878f13b..bd8b777 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,7 +7,6 @@ "": { "name": "ink", "version": "1.3.1", - "hasInstallScript": true, "license": "MIT", "devDependencies": { "@types/node": "^25.9.1", @@ -17,7 +16,7 @@ "vscode-test": "^1.4.1" }, "engines": { - "vscode": "^1.16.0" + "vscode": "^1.120.0" } }, "node_modules/@types/node": { diff --git a/src/completion.ts b/src/completion.ts index ade32c9..907a075 100644 --- a/src/completion.ts +++ b/src/completion.ts @@ -1,16 +1,16 @@ -// import { CompletionItemProvider, TextDocument, Position, CancellationToken, CompletionItem, Range, CompletionItemKind, workspace } from "vscode"; -// import * as NodeMap from "./nodemap"; -// import * as fs from "fs"; +import { CompletionItemProvider, TextDocument, Position, CancellationToken, CompletionItem, Range, CompletionItemKind, workspace } from "vscode"; +import * as NodeMap from "./nodemap"; +import * as fs from "fs"; -// export class DivertCompletionProvider implements CompletionItemProvider { +export class DivertCompletionProvider implements CompletionItemProvider { -// public provideCompletionItems (document: TextDocument, position: Position) : CompletionItem[] { -// // Make sure we are at the end of a valid divert arrow. -// // Ignore a > at the start of a line. -// const before = document.getText(new Range(position.with(position.line, 0), position)); -// if (!/(->|<-) ?$/.test(before)) return; -// if (/-> ?-> ?$/.test(before)) return; -// return NodeMap.getDivertCompletionTargets(document.uri.fsPath, position.line); -// } + public provideCompletionItems (document: TextDocument, position: Position) : CompletionItem[] { + // Make sure we are at the end of a valid divert arrow. + // Ignore a > at the start of a line. + const before = document.getText(new Range(position.with(position.line, 0), position)); + if (!/(->|<-) ?$/.test(before)) return []; + if (/-> ?-> ?$/.test(before)) return []; + return NodeMap.getDivertCompletionTargets(document.uri.fsPath, position.line); + } -// } \ No newline at end of file +} \ No newline at end of file diff --git a/src/definitions.ts b/src/definitions.ts index d2ff37d..38b3ad8 100644 --- a/src/definitions.ts +++ b/src/definitions.ts @@ -1,22 +1,22 @@ -// import { DefinitionProvider, Location, TextDocument, Position, Range } from "vscode"; -// import { getDefinitionByNameAndScope } from "./nodemap"; +import { DefinitionProvider, Location, TextDocument, Position, Range } from "vscode"; +import { getDefinitionByNameAndScope } from "./nodemap"; -// export class InkDefinitionProvider implements DefinitionProvider { +export class InkDefinitionProvider implements DefinitionProvider { -// public provideDefinition (document: TextDocument, position: Position) : Location { -// const lineStart = new Position(position.line, 0); -// const lineEnd = new Position(position.line + 1, 0); -// const before = new Range(lineStart, position); -// const after = new Range(position, lineEnd); -// const beforeText = document.getText(before); -// const afterText = document.getText(after); -// const beforeMatch = beforeText.match(/(->\s*\w*)$/)[1]; -// const afterMatch = afterText.match(/^([\w\.]*)\s*/)[1]; -// if (!(beforeMatch && afterMatch)) return; -// const name = (beforeMatch + afterMatch).match(/->\s*([\w.]+)/)[1]; -// const [target] = name.split("."); -// return getDefinitionByNameAndScope(target, document.uri.fsPath, position.line); + public provideDefinition (document: TextDocument, position: Position) : Location | undefined { + const lineStart = new Position(position.line, 0); + const lineEnd = new Position(position.line + 1, 0); + const before = new Range(lineStart, position); + const after = new Range(position, lineEnd); + const beforeText = document.getText(before); + const afterText = document.getText(after); + const beforeMatch = beforeText.match(/(->\s*\w*)$/)?.[1] ; + const afterMatch = afterText.match(/^([\w\.]*)\s*/)?.[1]; + if (!(beforeMatch && afterMatch)) return; + const name = (beforeMatch + afterMatch).match(/->\s*([\w.]+)/)?.[1]; + const [target] = name ? name.split(".") : []; + return getDefinitionByNameAndScope(target, document.uri.fsPath, position.line); -// } -// } \ No newline at end of file + } +} \ No newline at end of file diff --git a/src/extension.ts b/src/extension.ts index ec1203c..83b0232 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -1,33 +1,33 @@ -// 'use strict'; -// /* Ink for VS Code Extension Main File */ +'use strict'; +/* Ink for VS Code Extension Main File */ -// import { ExtensionContext, DocumentFilter, ProgressLocation, languages, window } from "vscode"; -// import { WordAndNodeCounter, WordNodeCounterController } from "./wordcount"; -// import { DivertCompletionProvider } from "./completion"; -// import * as NodeMap from "./nodemap"; -// import { InkDefinitionProvider } from "./definitions"; +import { ExtensionContext, DocumentFilter, ProgressLocation, languages, window } from "vscode"; +import { WordAndNodeCounter, WordNodeCounterController } from "./wordcount"; +import { DivertCompletionProvider } from "./completion"; +import * as NodeMap from "./nodemap"; +import { InkDefinitionProvider } from "./definitions"; -// const INK : DocumentFilter = { language: 'ink' }; +const INK : DocumentFilter = { language: 'ink' }; -// export function activate(ctx: ExtensionContext) { +export function activate(ctx: ExtensionContext) { -// // Create a new word counter. -// const wordCounter = new WordAndNodeCounter(); -// const wcController = new WordNodeCounterController(wordCounter); -// const nodeMapController = new NodeMap.NodeController(); + // Create a new word counter. + const wordCounter = new WordAndNodeCounter(); + const wcController = new WordNodeCounterController(wordCounter); + const nodeMapController = new NodeMap.NodeController(); -// // Start generating a node map. -// window.withProgress({ location: ProgressLocation.Window, title: "Mapping knots and stitches..." }, NodeMap.generateMaps); + // Start generating a node map. + window.withProgress({ location: ProgressLocation.Window, title: "Mapping knots and stitches..." }, NodeMap.generateMaps); -// // Add to a list of disposables which are disposed when this extension is -// // deactivated again. -// ctx.subscriptions.push(wcController); -// ctx.subscriptions.push(wordCounter); -// ctx.subscriptions.push(nodeMapController); + // Add to a list of disposables which are disposed when this extension is + // deactivated again. + ctx.subscriptions.push(wcController); + ctx.subscriptions.push(wordCounter); + ctx.subscriptions.push(nodeMapController); -// // Enable the completion provider. -// ctx.subscriptions.push(languages.registerCompletionItemProvider(INK, new DivertCompletionProvider(), '>', '-', ' ')); + // Enable the completion provider. + ctx.subscriptions.push(languages.registerCompletionItemProvider(INK, new DivertCompletionProvider(), '>', '-', ' ')); -// // Enable the definition provider. -// ctx.subscriptions.push(languages.registerDefinitionProvider(INK, new InkDefinitionProvider())); -// } \ No newline at end of file + // Enable the definition provider. + ctx.subscriptions.push(languages.registerDefinitionProvider(INK, new InkDefinitionProvider())); +} \ No newline at end of file diff --git a/src/nodemap.ts b/src/nodemap.ts index ba0af90..521be78 100644 --- a/src/nodemap.ts +++ b/src/nodemap.ts @@ -1,298 +1,315 @@ -// import { Uri, Position, CompletionItem, CompletionItemKind, Disposable, -// Location, TextDocument, TextDocumentChangeEvent, -// workspace } from "vscode"; -// import * as fs from "fs"; -// import * as path from "path"; - -// /* Divert targets that are always valid. */ -// const PERMANENT_DIVERTS = [ -// new CompletionItem("END", CompletionItemKind.Keyword), -// new CompletionItem("DONE", CompletionItemKind.Keyword), -// new CompletionItem("->", CompletionItemKind.Keyword) -// ] - -// class DivertTarget { -// constructor ( public readonly name : string | null) { } -// public line : number; -// public readonly parentFile : NodeMap; -// public toCompletionItem () : CompletionItem { -// return new CompletionItem(this.name, CompletionItemKind.Reference); -// } -// } - -// class LabelNode extends DivertTarget { - -// public get line () { -// return this._line + this.parentStitch.startLine; -// } - -// public get parentFile () { -// return this.parentStitch.parentKnot.parentFile; -// } - -// constructor ( -// public readonly name : string, -// private readonly _line : number, -// public readonly parentStitch : StitchNode -// ) { -// super(name); -// } - - -// } - -// class StitchNode extends DivertTarget { -// public readonly labels : LabelNode[] - -// public get line () { -// return this.startLine; -// } - -// public get startLine () { -// return this.parentKnot.startLine + this._relativeStart; -// } - -// public get parentFile () { -// return this.parentKnot.parentFile; -// } - -// public get endLine () { -// // On the last stich of the last knot in the file, we want the end line to actually be -// // the next line after the end of the file. This is why we track whether we're on the -// // last line or not when generating the map. -// return this.parentKnot.startLine + this._relativeEnd + (this.lastLine ? 1 : 0); -// } - -// constructor ( -// public readonly name : string, -// private readonly _relativeStart : number, -// private readonly _relativeEnd : number, -// public readonly parentKnot : KnotNode, -// textContent : string, -// private readonly lastLine : boolean = false -// ) { -// super(name); -// this.labels = textContent -// .split("\n") -// .map((line, index) => ({ found: line.match(/^\s*[-\*\+]\s*\((\w+)\)/), index })) -// .filter(({ found }) => found !== null) -// .map(({ found, index }) => new LabelNode(found[1], index, this)); -// } -// } - -// class KnotNode extends DivertTarget { - -// public readonly stitches; - -// public get line () { -// return this.startLine; -// } - -// constructor ( -// public readonly name : string | null, -// public readonly startLine : number, -// public readonly endLine : number, -// public readonly parentFile : NodeMap, -// textContent : string, -// private readonly isFunction : boolean = false, -// private readonly lastLine : boolean = false -// ) { -// super(name); -// const lines = textContent.split("\n"); -// this.stitches = lines -// .reduce(( -// {nodes, currentNode, lastStart, lastName} -// : { nodes: StitchNode[], currentNode: string[], lastStart : number, lastName : string | null } -// , line : string -// , index : number) => { -// if (line.match(/^\s*={1}\s*(\w+)/)) { -// // Found the start of a new stitch. -// const newName = line.match(/^\s*={1}\s*(\w+)/)[1]; -// const node = new StitchNode(lastName, lastStart, index, this, currentNode.join("\n")); -// nodes.push(node); -// if (index === lines.length -1) { -// // The new stitch is also the last line of the knot. -// const node = new StitchNode(newName, index, index + 1, this, currentNode.join("\n"), this.lastLine); -// nodes.push(node); -// } -// return { nodes, currentNode: [line], lastStart: index, lastName: newName }; -// } -// if (index === lines.length - 1) { -// // Found the last line. -// const node = new StitchNode(lastName, lastStart, index + 1, this, currentNode.join("\n"), this.lastLine); -// nodes.push(node); -// return { nodes, currentNode: [line], lastStart: index, lastName: null }; -// } -// currentNode.push(line); -// return { nodes, currentNode, lastStart, lastName }; -// }, { nodes: [], currentNode: [], lastStart: 0, lastName: null }) -// .nodes; -// } - -// public toCompletionItem () : CompletionItem { -// const itemKind = this.isFunction ? CompletionItemKind.Function : CompletionItemKind.Reference; -// return new CompletionItem(this.name, itemKind); -// } -// } - -// class NodeMap { - -// public readonly knots : KnotNode[]; -// public readonly includes : string[]; - -// private constructor (public filePath : string, fileText : string) { -// const lines = fileText.split("\n"); -// this.knots = lines -// .reduce(( -// {nodes, currentNode, lastStart, lastName, isFunction} -// : { nodes: KnotNode[], currentNode: string[], lastStart : number, lastName : string | null, isFunction } -// , line : string -// , index : number) => { -// if (line.match(/^\s*===(\s*function)?\s*(\w+)/)) { -// // Found the start of a new knot. -// const match = line.match(/^\s*===(\s*function)?\s*(\w+)/); -// const newName = match[2]; -// const foundFunction = (!!match[1]); -// const node = new KnotNode(lastName, lastStart, index, this, currentNode.join("\n"), isFunction); -// nodes.push(node); -// return { nodes, currentNode: [line], lastStart: index, lastName: newName, isFunction: foundFunction }; -// } -// if (index === lines.length - 1) { -// // Found the last line -// const node = new KnotNode(lastName, lastStart, index + 1, this, currentNode.concat(line).join("\n"), false, true); -// nodes.push(node); -// return { nodes, currentNode: [line], lastStart: index, lastName: null, isFunction }; -// } -// currentNode.push(line); -// return { nodes, currentNode, lastStart, lastName, isFunction }; -// }, { nodes: [], currentNode: [], lastStart: 0, lastName: null, isFunction: false }) -// .nodes; -// this.includes = lines -// .filter(line => line.match(/^\s*INCLUDE\s+(\w+\.ink)/)) -// .map(line => { -// const filename = line.match(/^\s*INCLUDE\s+(\w+\.ink)/)[1]; -// const dirname = path.dirname(filePath); -// return path.normalize(dirname + path.sep + filename); -// }); -// } - -// public static from (filePath : string) : Promise { -// return new Promise((resolve, reject) => { -// fs.readFile(filePath, 'utf8', (err, data : string) => { -// if (err) return reject(err); -// return resolve(data); -// }); -// }) -// .catch((err) => console.log("Error opening file: ", err)) -// .then((data) => new NodeMap(filePath, data ? data : "")); -// } - -// public static fromDocument (document : TextDocument) : NodeMap { -// const { fsPath } = document.uri; -// return new NodeMap(fsPath, document.getText()); -// } -// } - -// const nodeMaps : { [key: string]: NodeMap; } = {}; -// let mapsDone : boolean = false; - -// export function generateMaps () : Thenable { -// return workspace.findFiles("**/*.ink") -// .then(uris => { -// return Promise.all(uris.map(({fsPath}) => NodeMap.from(fsPath))).catch(err => console.log); -// }) -// .then((maps : NodeMap[]) => { -// maps.forEach(map => nodeMaps[map.filePath] = map); -// mapsDone = true; -// }); -// } - -// function getIncludeScope (filePath : string, knownScope : string[] = []) : string[] { -// const fileMap = nodeMaps[filePath]; -// if (!fileMap) return knownScope; -// if (knownScope.indexOf(filePath) === -1) knownScope.push(filePath); -// const newScope = fileMap.includes.filter(include => knownScope.indexOf(include) === -1); -// if (newScope.length < 1) return knownScope; -// return getIncludeScope(filePath, getIncludeScope(newScope[0], knownScope)); - -// } - -// function stitchFor (filePath : string, line : number) : StitchNode | null { -// const nodemap = nodeMaps[filePath] -// if (!nodemap) return null; -// const knot = nodemap.knots.find(knot => knot.startLine <= line && knot.endLine > line); -// if (!knot) { -// console.log("Can't identify knot for line ", line); -// return null; -// } -// const stitch = knot.stitches.find(stitch => stitch.startLine <= line && stitch.endLine > line); -// if (!stitch) { -// console.log("Can't identify stitch for line ", line); -// return null; -// } -// return stitch; -// } - -// /* Gets the divert names that are in scope for a given line and file. */ -// function getDivertsInScope (filePath: string, line : number) : DivertTarget[] { -// if (nodeMaps[filePath]) { -// let targets : DivertTarget[] = []; -// const scope = getIncludeScope(filePath); -// const knots = scope.map(path => -// nodeMaps[path] -// .knots -// ) -// .reduce((a, b) => a.concat(b)); -// targets = targets.concat(knots); -// const currentStitch = stitchFor(filePath, line); -// if (currentStitch) { -// const stitches = currentStitch.parentKnot.stitches; -// const labels = currentStitch.labels; -// targets = targets.concat(stitches); -// targets = targets.concat(labels); -// } else { -// console.log("WARN: Couldn't find current stitch for line ", line); -// } +import { Uri, Position, CompletionItem, CompletionItemKind, Disposable, + Location, TextDocument, TextDocumentChangeEvent, + workspace } from "vscode"; +import * as fs from "fs"; +import * as path from "path"; + +/* Divert targets that are always valid. */ +const PERMANENT_DIVERTS = [ + new CompletionItem("END", CompletionItemKind.Keyword), + new CompletionItem("DONE", CompletionItemKind.Keyword), + new CompletionItem("->", CompletionItemKind.Keyword) +] + +abstract class DivertTarget { + constructor ( public readonly name : string) { } + abstract get line() : number; + abstract get parentFile() : NodeMap; + public toCompletionItem () : CompletionItem { + return new CompletionItem(this.name as string, CompletionItemKind.Reference); + } +} + +class LabelNode extends DivertTarget { + + public get line () { + return this._line + this.parentStitch.startLine; + } + + public get parentFile () { + return this.parentStitch.parentKnot.parentFile; + } + + constructor ( + public readonly name : string, + private readonly _line : number, + public readonly parentStitch : StitchNode + ) { + super(name); + } + + +} + +class StitchNode extends DivertTarget { + public readonly labels : LabelNode[] + + public get line () { + return this.startLine; + } + + public get startLine () { + return this.parentKnot.startLine + this._relativeStart; + } + + public get parentFile () { + return this.parentKnot.parentFile; + } + + public get endLine () { + // On the last stich of the last knot in the file, we want the end line to actually be + // the next line after the end of the file. This is why we track whether we're on the + // last line or not when generating the map. + return this.parentKnot.startLine + this._relativeEnd + (this.lastLine ? 1 : 0); + } + + constructor ( + public readonly name : string, + private readonly _relativeStart : number, + private readonly _relativeEnd : number, + public readonly parentKnot : KnotNode, + textContent : string, + private readonly lastLine : boolean = false + ) { + super(name); + this.labels = textContent + .split("\n") + .map((line, index) => ({ found: line.match(/^\s*[-\*\+]\s*\((\w+)\)/), index })) + .map(({ found, index }) => found ? new LabelNode(found[1], index, this) : null) + .filter((v): v is LabelNode => !!v); + } +} + +class KnotNode extends DivertTarget { + + public readonly stitches; + + public get line () { + return this.startLine; + } + + constructor ( + public readonly name : string, + public readonly startLine : number, + public readonly endLine : number, + public readonly parentFile : NodeMap, + textContent : string, + private readonly isFunction : boolean = false, + private readonly lastLine : boolean = false + ) { + super(name); + const lines = textContent.split("\n"); + this.stitches = lines + .reduce(( + {nodes, currentNode, lastStart, lastName} + : { nodes: StitchNode[], currentNode: string[], lastStart : number, lastName : string | null } + , line : string + , index : number) => { + if (line.match(/^\s*={1}\s*(\w+)/)) { + + } + + // Found the start of a new stitch. + const newNameRegex = line.match(/^\s*={1}\s*(\w+)/); + if (newNameRegex) { + const newName = newNameRegex[1]; + const node = new StitchNode(lastName as string, lastStart, index, this, currentNode.join("\n")); + nodes.push(node); + if (index === lines.length -1) { + // The new stitch is also the last line of the knot. + const node = new StitchNode(newName, index, index + 1, this, currentNode.join("\n"), this.lastLine); + nodes.push(node); + } + return { nodes, currentNode: [line], lastStart: index, lastName: newName }; + } + + + if (index === lines.length - 1) { + // Found the last line. + const node = new StitchNode(lastName as string, lastStart, index + 1, this, currentNode.join("\n"), this.lastLine); + nodes.push(node); + return { nodes, currentNode: [line], lastStart: index, lastName: null }; + } + currentNode.push(line); + return { nodes, currentNode, lastStart, lastName }; + }, { nodes: [], currentNode: [], lastStart: 0, lastName: null }) + .nodes; + } + + public toCompletionItem () : CompletionItem { + const itemKind = this.isFunction ? CompletionItemKind.Function : CompletionItemKind.Reference; + return new CompletionItem(this.name, itemKind); + } +} + +class NodeMap { + + public readonly knots : KnotNode[]; + public readonly includes : string[]; + + private constructor (public filePath : string, fileText : string) { + const lines = fileText.split("\n"); + this.knots = lines + .reduce(( + {nodes, currentNode, lastStart, lastName, isFunction} + : { nodes: KnotNode[], currentNode: string[], lastStart : number, lastName : string | null, isFunction: boolean } + , line : string + , index : number) => { + const match = line.match(/^\s*===(\s*function)?\s*(\w+)/); + if (match) { + // Found the start of a new knot. + const newName = match[2]; + const foundFunction = (!!match[1]); + const node = new KnotNode(lastName as string, lastStart, index, this, currentNode.join("\n"), isFunction); + nodes.push(node); + return { nodes, currentNode: [line], lastStart: index, lastName: newName, isFunction: foundFunction }; + } + if (index === lines.length - 1) { + // Found the last line + const node = new KnotNode(lastName as string, lastStart, index + 1, this, currentNode.concat(line).join("\n"), false, true); + nodes.push(node); + return { nodes, currentNode: [line], lastStart: index, lastName: null, isFunction }; + } + currentNode.push(line); + return { nodes, currentNode, lastStart, lastName, isFunction }; + }, { nodes: [], currentNode: [], lastStart: 0, lastName: null, isFunction: false }) + .nodes; + this.includes = lines + .filter(line => line.match(/^\s*INCLUDE\s+(\w+\.ink)/)) + .map(line => { + const match = line.match(/^\s*INCLUDE\s+(\w+\.ink)/); + const filename = match ? match[1] : null; + const dirname = path.dirname(filePath); + if (!filename) { + console.log("Error parsing include line: ", line); + return ""; + } + return path.normalize(dirname + path.sep + filename); + }); + } + + public static from (filePath : string) : Promise { + return new Promise((resolve, reject) => { + fs.readFile(filePath, 'utf8', (err, data : string) => { + if (err) return reject(err); + return resolve(data); + }); + }) + .catch((err) => console.log("Error opening file: ", err)) + .then((data) => new NodeMap(filePath, data ? data : "")); + } + + public static fromDocument (document : TextDocument) : NodeMap { + const { fsPath } = document.uri; + return new NodeMap(fsPath, document.getText()); + } +} + +const nodeMaps : { [key: string]: NodeMap; } = {}; +let mapsDone : boolean = false; + +export function generateMaps () : Thenable { + return Promise.resolve(workspace.findFiles("**/*.ink")) + .then(uris => Promise.all(uris.map(({ fsPath }) => NodeMap.from(fsPath)))) + .then((maps: NodeMap[]) => { + maps.forEach(map => nodeMaps[map.filePath] = map); + mapsDone = true; + }) + .catch((err: unknown) => { + console.error("Error generating maps:", err); + }); +} + +function getIncludeScope (filePath : string, knownScope : string[] = []) : string[] { + const fileMap = nodeMaps[filePath]; + if (!fileMap) return knownScope; + if (knownScope.indexOf(filePath) === -1) knownScope.push(filePath); + const newScope = fileMap.includes.filter(include => knownScope.indexOf(include) === -1); + if (newScope.length < 1) return knownScope; + return getIncludeScope(filePath, getIncludeScope(newScope[0], knownScope)); + +} + +function stitchFor (filePath : string, line : number) : StitchNode | null { + const nodemap = nodeMaps[filePath] + if (!nodemap) return null; + const knot = nodemap.knots.find(knot => knot.startLine <= line && knot.endLine > line); + if (!knot) { + console.log("Can't identify knot for line ", line); + return null; + } + const stitch = knot.stitches.find(stitch => stitch.startLine <= line && stitch.endLine > line); + if (!stitch) { + console.log("Can't identify stitch for line ", line); + return null; + } + return stitch; +} + +/* Gets the divert names that are in scope for a given line and file. */ +function getDivertsInScope (filePath: string, line : number) : DivertTarget[] { + if (nodeMaps[filePath]) { + let targets : DivertTarget[] = []; + const scope = getIncludeScope(filePath); + const knots = scope.map(path => + nodeMaps[path] + .knots + ) + .reduce((a, b) => a.concat(b)); + targets = targets.concat(knots); + const currentStitch = stitchFor(filePath, line); + if (currentStitch) { + const stitches = currentStitch.parentKnot.stitches; + const labels = currentStitch.labels; + targets = targets.concat(stitches); + targets = targets.concat(labels); + } else { + console.log("WARN: Couldn't find current stitch for line ", line); + } -// return targets; -// } -// console.log(`Node map missing for file ${filePath}`); -// return []; -// } - -// export function getDefinitionByNameAndScope (name: string, filePath : string, line : number) : Location { -// const divert = getDivertsInScope(filePath, line) -// .find(target => target.name === name); -// return new Location(Uri.file(divert.parentFile.filePath), new Position(divert.line, 0)); -// } - -// /* Returns completion items for divert target names for a given line and file. */ -// export function getDivertCompletionTargets (filePath : string, line : number) : CompletionItem[] { -// return getDivertsInScope(filePath, line) -// .filter(target => target.name !== null) -// .map(target => target.toCompletionItem()) -// .concat(PERMANENT_DIVERTS); -// } - -// export class NodeController { -// private _disposable : Disposable; - -// constructor () { -// let subscriptions : Disposable[] = []; -// workspace.onDidChangeTextDocument(this._onEvent, this, subscriptions); - -// this._disposable = Disposable.from(...subscriptions); -// } - -// private _onEvent ({ contentChanges, document } : TextDocumentChangeEvent) { -// // Don't rebuild the entire file unless we have a new line or special character -// // suggesting the node map actually changed. -// if (!contentChanges.find(change => change.text.match(/[\n\*\+\(\)-=]/) !== null)) return; -// const { fsPath } = document.uri; -// nodeMaps[fsPath] = NodeMap.fromDocument(document); -// } - -// public dispose () { -// this._disposable.dispose(); -// } -// } \ No newline at end of file + return targets; + } + console.log(`Node map missing for file ${filePath}`); + return []; +} + +export function getDefinitionByNameAndScope (name: string, filePath : string, line : number) : Location { + const divert = getDivertsInScope(filePath, line) + .find(target => target.name === name); + if (!divert){ + console.log(`Divert not found: ${name}`); + return new Location(Uri.file(filePath), new Position(line, 0)); + } + return new Location(Uri.file(divert.parentFile.filePath), new Position(divert.line, 0)); +} + +/* Returns completion items for divert target names for a given line and file. */ +export function getDivertCompletionTargets (filePath : string, line : number) : CompletionItem[] { + return getDivertsInScope(filePath, line) + .filter(target => target.name !== null) + .map(target => target.toCompletionItem()) + .concat(PERMANENT_DIVERTS); +} + +export class NodeController { + private _disposable : Disposable; + + constructor () { + let subscriptions : Disposable[] = []; + workspace.onDidChangeTextDocument(this._onEvent, this, subscriptions); + + this._disposable = Disposable.from(...subscriptions); + } + + private _onEvent ({ contentChanges, document } : TextDocumentChangeEvent) { + // Don't rebuild the entire file unless we have a new line or special character + // suggesting the node map actually changed. + if (!contentChanges.find(change => change.text.match(/[\n\*\+\(\)-=]/) !== null)) return; + const { fsPath } = document.uri; + nodeMaps[fsPath] = NodeMap.fromDocument(document); + } + + public dispose () { + this._disposable.dispose(); + } +} \ No newline at end of file diff --git a/src/wordcount.ts b/src/wordcount.ts index fd2853c..12ba9a0 100644 --- a/src/wordcount.ts +++ b/src/wordcount.ts @@ -1,137 +1,137 @@ -// 'use strict'; +'use strict'; -// import { window, workspace, commands, Disposable, ExtensionContext, StatusBarAlignment, StatusBarItem, TextDocument } from "vscode"; +import { window, Disposable, StatusBarAlignment, StatusBarItem } from "vscode"; -// /* Provides word count functionality. Mostly adapted from the example -// word counter extension. -// */ -// export class WordAndNodeCounter { -// private _statusBarItem: StatusBarItem; +/* Provides word count functionality. Mostly adapted from the example + word counter extension. +*/ +export class WordAndNodeCounter { + private _statusBarItem: StatusBarItem | undefined; -// private plural (n: number, word: string) : string { -// return `${n} ${n === 1 ? word : `${word}s`}`; -// } + private plural (n: number, word: string) : string { + return `${n} ${n === 1 ? word : `${word}s`}`; + } -// public updateWordCount () { -// // Create this as needed. -// if (!this._statusBarItem) -// this._statusBarItem = window.createStatusBarItem(StatusBarAlignment.Left); + public updateWordCount () { + // Create this as needed. + if (!this._statusBarItem) + this._statusBarItem = window.createStatusBarItem(StatusBarAlignment.Left); -// // Get the current text editor. -// let editor = window.activeTextEditor; -// if (!editor) { -// this._statusBarItem.hide(); -// return; -// } - -// let doc = editor.document; - -// // Only update status if an Ink file. -// if (doc.languageId === "ink") { -// const docContent = doc.getText(); -// const wordCount = this._getWordCount(docContent); -// const nodeCount = this._getNodeCount(docContent); - - -// // Update the status bar, finally. -// this._statusBarItem.text = `$(pencil) ${this.plural(wordCount, "Word")} in ${this.plural(nodeCount, "Node")}`; -// this._statusBarItem.show(); -// } else { -// this._statusBarItem.hide(); -// } -// } - -// private static lineReducer (stack: { scope: string, lines: string[]}, line: string): { scope: string, lines: string[] } { -// // Reducer function to remove undesirable lines and inline content. -// let { scope, lines } = stack; -// if (line.match(/^\s*$/)) return stack; // Empty line -// if (scope === "multiline") { // Continuing multiline { block } -// if (line.match(/\}/) !== null) { -// scope = "root"; -// // Add just the part of the line after the }, if anything. -// return WordAndNodeCounter.lineReducer({ scope, lines }, (line.match(/}(.*)/)[1])); -// } -// return stack; -// } -// if (scope === "comment") { // Continuing multiline comment -// if (line.match(/\*\//) !== null) { -// scope = "root"; -// return WordAndNodeCounter.lineReducer({ scope, lines }, (line.match(/\*\/(.*)/)[1])); -// } -// return stack; -// } -// if (line.match(/\{/) !== null) { // Start of { block } -// if (line.match(/\}/) !== null) -// return WordAndNodeCounter.lineReducer(stack, line.replace(/\{.*\}/, "")); -// scope = "multiline"; -// return { scope, lines }; -// } -// if (line.match(/\/\//) !== null) { // // Comment -// return WordAndNodeCounter.lineReducer(stack, line.replace(/\/\/.*/, "")); -// } -// if (line.match(/\/\*/)) { // Start of /* comment -// if (line.match(/\*\//)) { -// return WordAndNodeCounter.lineReducer(stack, line.replace(/\/\*.*\*\//, "")); -// } -// scope = "comment"; -// return { scope, lines }; -// } -// // Various single-line directives/statements to ignore in wc -// if (line.match(/^\s*(~|=|VAR|EXTERNAL|INCLUDE)/) === null) { -// lines.push(line); -// } -// return { scope, lines }; -// } - -// public _getWordCount (docContent: string): number { - -// // TODO: Write code for accurate word count of Ink document. -// // TODO: Add node count. - -// /* We want an *accurate* word count, so we want to ignore things like knot identifiers -// * as much as possible. Consequently, we must go line by line and identify any lines -// * that should not be counted. */ - - -// return docContent.split("\n").reduce(WordAndNodeCounter.lineReducer, { scope: 'root', lines: [] }) -// .lines -// .join(" ") -// .split(/\s/) -// .filter(word => word.match(/\w/)) -// .length; -// } - -// public _getNodeCount (docContent: string): number { -// return docContent.split("\n").filter(line => line.match(/^\s*=/)).length; -// } - -// public dispose() { -// this._statusBarItem.dispose(); -// } -// } - -// export class WordNodeCounterController { -// private _wordCounter: WordAndNodeCounter; -// private _disposable: Disposable; - -// constructor (wordCounter: WordAndNodeCounter) { -// this._wordCounter = wordCounter; -// this._wordCounter.updateWordCount(); - -// // Subscribe to selection change and editor activation events. -// let subscriptions: Disposable[] = []; -// window.onDidChangeTextEditorSelection(this._onEvent, this, subscriptions); -// window.onDidChangeActiveTextEditor(this._onEvent, this, subscriptions); - -// // Create a combined disposable from both event subscriptions. -// this._disposable = Disposable.from(...subscriptions); -// } - -// private _onEvent () { -// this._wordCounter.updateWordCount(); -// } - -// public dispose () { -// this._disposable.dispose(); -// } -// } \ No newline at end of file + // Get the current text editor. + let editor = window.activeTextEditor; + if (!editor) { + this._statusBarItem.hide(); + return; + } + + let doc = editor.document; + + // Only update status if an Ink file. + if (doc.languageId === "ink") { + const docContent = doc.getText(); + const wordCount = this._getWordCount(docContent); + const nodeCount = this._getNodeCount(docContent); + + + // Update the status bar, finally. + this._statusBarItem.text = `$(pencil) ${this.plural(wordCount, "Word")} in ${this.plural(nodeCount, "Node")}`; + this._statusBarItem.show(); + } else { + this._statusBarItem.hide(); + } + } + + private static lineReducer (stack: { scope: string, lines: string[]}, line: string): { scope: string, lines: string[] } { + // Reducer function to remove undesirable lines and inline content. + let { scope, lines } = stack; + if (line.match(/^\s*$/)) return stack; // Empty line + if (scope === "multiline") { // Continuing multiline { block } + if (line.match(/\}/) !== null) { + scope = "root"; + // Add just the part of the line after the }, if anything. + return WordAndNodeCounter.lineReducer({ scope, lines }, (line.match(/}(.*)/)?.[1] || "")); + } + return stack; + } + if (scope === "comment") { // Continuing multiline comment + if (line.match(/\*\//) !== null) { + scope = "root"; + return WordAndNodeCounter.lineReducer({ scope, lines }, (line.match(/\*\/(.*)/)?.[1] || "")); + } + return stack; + } + if (line.match(/\{/) !== null) { // Start of { block } + if (line.match(/\}/) !== null) + return WordAndNodeCounter.lineReducer(stack, line.replace(/\{.*\}/, "")); + scope = "multiline"; + return { scope, lines }; + } + if (line.match(/\/\//) !== null) { // // Comment + return WordAndNodeCounter.lineReducer(stack, line.replace(/\/\/.*/, "")); + } + if (line.match(/\/\*/)) { // Start of /* comment + if (line.match(/\*\//)) { + return WordAndNodeCounter.lineReducer(stack, line.replace(/\/\*.*\*\//, "")); + } + scope = "comment"; + return { scope, lines }; + } + // Various single-line directives/statements to ignore in wc + if (line.match(/^\s*(~|=|VAR|EXTERNAL|INCLUDE)/) === null) { + lines.push(line); + } + return { scope, lines }; + } + + public _getWordCount (docContent: string): number { + + // TODO: Write code for accurate word count of Ink document. + // TODO: Add node count. + + /* We want an *accurate* word count, so we want to ignore things like knot identifiers + * as much as possible. Consequently, we must go line by line and identify any lines + * that should not be counted. */ + + + return docContent.split("\n").reduce(WordAndNodeCounter.lineReducer, { scope: 'root', lines: [] }) + .lines + .join(" ") + .split(/\s/) + .filter(word => word.match(/\w/)) + .length; + } + + public _getNodeCount (docContent: string): number { + return docContent.split("\n").filter(line => line.match(/^\s*=/)).length; + } + + public dispose() { + this._statusBarItem?.dispose(); + } +} + +export class WordNodeCounterController { + private _wordCounter: WordAndNodeCounter; + private _disposable: Disposable; + + constructor (wordCounter: WordAndNodeCounter) { + this._wordCounter = wordCounter; + this._wordCounter.updateWordCount(); + + // Subscribe to selection change and editor activation events. + let subscriptions: Disposable[] = []; + window.onDidChangeTextEditorSelection(this._onEvent, this, subscriptions); + window.onDidChangeActiveTextEditor(this._onEvent, this, subscriptions); + + // Create a combined disposable from both event subscriptions. + this._disposable = Disposable.from(...subscriptions); + } + + private _onEvent () { + this._wordCounter.updateWordCount(); + } + + public dispose () { + this._disposable.dispose(); + } +} \ No newline at end of file From e04ecb25e73c9ff58c694c1c0d98523235397216 Mon Sep 17 00:00:00 2001 From: sfaray Date: Thu, 28 May 2026 21:18:32 +0700 Subject: [PATCH 3/3] revert syntaxes --- package.json | 4 +- syntaxes/ink.tmLanguage | 670 +++++++++++++++++++++++++++++++++++ syntaxes/ink.tmLanguage.json | 435 ----------------------- syntaxes/ink.tmLanguage.yaml | 250 ------------- 4 files changed, 672 insertions(+), 687 deletions(-) create mode 100644 syntaxes/ink.tmLanguage delete mode 100644 syntaxes/ink.tmLanguage.json delete mode 100644 syntaxes/ink.tmLanguage.yaml diff --git a/package.json b/package.json index 2be1b9a..d8dfeff 100644 --- a/package.json +++ b/package.json @@ -49,13 +49,13 @@ { "language": "ink", "scopeName": "source.ink", - "path": "./syntaxes/ink.tmLanguage.json" + "path": "./syntaxes/ink.tmLanguage" } ] }, "scripts": { "vscode:prepublish": "npm run compile", - "compile": "js-yaml syntaxes/ink.tmLanguage.yaml > syntaxes/ink.tmLanguage.json && tsc -p ./", + "compile": "tsc -p ./", "watch": "tsc -watch -p ./" }, "devDependencies": { diff --git a/syntaxes/ink.tmLanguage b/syntaxes/ink.tmLanguage new file mode 100644 index 0000000..b505a61 --- /dev/null +++ b/syntaxes/ink.tmLanguage @@ -0,0 +1,670 @@ + + + + + name + ink + scopeName + source.ink + fileTypes + + ink + ink2 + + uuid + 5a0f60ba-87b8-4fa9-854c-6bf41f74bd98 + patterns + + + include + #comments + + + match + ^\s*(={2,})\s*(function)?\s*(\w+)\s*(\([^)]*\))?\s*(={1,})? + captures + + 1 + + name + markup.punctuation + + 2 + + name + keyword.function + + 3 + + name + entity.name.knot + + 4 + + name + variable.parameter + + 5 + + name + markup.punctuation + + + name + meta.knot.declaration + + + match + ^\s*(=)\s*(\w+)\s*(\([^)\n]*\))?\s*$ + captures + + 1 + + name + markup.punctuation + + 2 + + name + entity.name.stitch + + 3 + + name + variable.parameter + + + name + meta.stitch.declaration + + + include + #choice + + + include + #gather + + + include + #statements + + + repository + + tag + + begin + (#)\s* + end + \s*$\n* + captures + + 1 + + name + keyword.operator.hashtag + + + contentName + entity.name.tag + patterns + + + include + #comments + + + + comments + + patterns + + + begin + /\*\* + captures + + 0 + + name + punctuation.definition.comment.json + + + end + \*/ + name + comment.block.documentation.json + + + begin + /\* + captures + + 0 + + name + punctuation.definition.comment.json + + + end + \*/ + name + comment.block.json + + + captures + + 1 + + name + punctuation.definition.comment.json + + + match + (//).*$\n? + name + comment.line.double-slash.js + + + + TODO + + match + ^\s*(?:(TODO\s*:)|(TODO\b))\s*(.*) + captures + + 1 + + name + comment.todo.TODO + + 2 + + name + comment.todo.TODO + + + end + $\n? + name + comment.todo + + include + + begin + ^\s*((INCLUDE)\s*(\S*))\s* + beginCaptures + + 1 + + name + meta.include + + 2 + + name + keyword.control.include + + 3 + + name + string.other + + + end + $\n? + + external + + begin + ^\s*((EXTERNAL)\s*([\w_0-9]*\(\)))\s* + beginCaptures + + 1 + + name + meta.external + + 2 + + name + keyword.control.external + + 3 + + name + support.function + + + end + $\n? + + globalVAR + + begin + ^\s*((VAR|CONST)\s*(\w+))\s* + beginCaptures + + 1 + + name + meta.variable.declaration + + 2 + + name + storage + + 3 + + name + entity.name.variable + + + end + $\n? + name + meta.variable.assignment + + choice + + begin + ^\s*((?:[\*\+]\s?)+)\s*(\(\s*(\w+)\s*\))? + beginCaptures + + 1 + + name + keyword.operator.weaveBullet.choice + + 2 + + name + meta.label + + 3 + + name + entity.name.label + + + end + $\n? + name + choice + patterns + + + include + #comments + + + match + (\[)([^\]]*)(\]) + captures + + 1 + + name + keyword.operator.weaveBracket + + 2 + + name + string.content + + 3 + + name + keyword.operator.weaveBracket + + + + + include + #divert + + + include + #mixedContent + + + + gather + + match + ^\s*((?:-\s*)+)(?!>)(\(\s*(\w+)\s*\))? + captures + + 1 + + name + keyword.operator.weaveBullet.gather + + 2 + + name + meta.label + + 3 + + name + entity.name.label + + + name + meta.gather + + multiLineLogic + + begin + ^\s*(\{)([\w_\s\*\/\-\+\&\|\%\<\>\.\(\)]+(:))?(?=[^}]+$) + beginCaptures + + 0 + + name + meta.logicBegin + + 1 + + name + keyword.operator.logic + + 3 + + name + keyword.operator.logic + + + end + (\}) + endCaptures + + 1 + + name + keyword.operator + + + contentName + meta.multilineLogicInner + name + meta.multilineLogic + patterns + + + match + ^\s*else\s*\: + name + conditional.else + + + begin + ^\s*(-)\s?[^:]+(:) + beginCaptures + + 1 + + name + keyword.operator + + 2 + + name + keyword.operator + + + end + $\n? + name + conditional.clause + patterns + + + include + #mixedContent + + + + + include + #statements + + + + inlineConditional + + begin + (\{)[^:\|\}]+: + beginCaptures + + 1 + + name + keyword.operator.inlineConditionalStart + + + end + (\}) + endCaptures + + 1 + + name + keyword.operator.inlineConditionalEnd + + + name + entity.inlineConditional + patterns + + + match + \| + name + keyword.operator.inlineConditionalBranchSeparator + + + include + #mixedContent + + + + inlineSequence + + begin + (\{)\s*(~|&|!|\$)?(?=([^\|]*\|(?!\|)[^\}]*)\}) + beginCaptures + + 1 + + name + keyword.operator.inlineSequenceStart + + 2 + + name + keyword.operator.inlineSequenceTypeChar + + + end + \} + endCaptures + + 0 + + name + keyword.operator.inlineSequenceEnd + + + name + entity.inlineSequence + patterns + + + match + \|(?!\|) + name + keyword.operator.inlineSequenceSeparator + + + include + #mixedContent + + + + inlineLogic + + begin + (\{) + beginCaptures + + 1 + + name + keyword.operator.inlineLogicStart + + + end + (\}) + endCaptures + + 1 + + name + keyword.operator.inlineLogicEnd + + + name + meta.logic + + logicLine + + match + \s*(~\s*.*)$ + captures + + 0 + + name + meta.logic + + + + divert + + match + (->|<-)\s*((?:(DONE)|(END)|(\w+))(?:\s*\.\s*(?:\w+))*\s*(?:\([^\)]+\))?)? + name + meta.divert + captures + + 1 + + name + keyword.operator.divert + + 3 + + name + keyword.done + + 4 + + name + keyword.end + + 5 + + name + variable.divertTarget + + + + mixedContent + + patterns + + + include + #inlineConditional + + + include + #inlineSequence + + + include + #inlineLogic + + + include + #divert + + + match + <> + name + constant.glue + + + + statements + + patterns + + + include + #include + + + include + #external + + + include + #comments + + + include + #TODO + + + include + #globalVAR + + + include + #choice + + + include + #gather + + + include + #multiLineLogic + + + include + #endOfSection + + + include + #logicLine + + + include + #mixedContent + + + include + #tag + + + + + + \ No newline at end of file diff --git a/syntaxes/ink.tmLanguage.json b/syntaxes/ink.tmLanguage.json deleted file mode 100644 index 0ffb333..0000000 --- a/syntaxes/ink.tmLanguage.json +++ /dev/null @@ -1,435 +0,0 @@ -{ - "name": "ink", - "scopeName": "source.ink", - "fileTypes": [ - "ink", - "ink2" - ], - "uuid": "5a0f60ba-87b8-4fa9-854c-6bf41f74bd98", - "patterns": [ - { - "include": "#comments" - }, - { - "include": "#knot" - }, - { - "include": "#stitch" - }, - { - "include": "#choice" - }, - { - "include": "#gather" - }, - { - "include": "#statements" - } - ], - "repository": { - "stitch": { - "match": "^\\s*(=)\\s*(\\w+)\\s*(\\([^)\\n]*\\))?\\s*$", - "captures": { - "1": { - "name": "markup.punctuation" - }, - "2": { - "name": "entity.name.stitch" - }, - "3": { - "name": "variable.parameter" - } - }, - "name": "meta.stitch.declaration" - }, - "knot": { - "match": "^\\s*(={2,})\\s*(function)?\\s*(\\w+)\\s*(\\([^)]*\\))?\\s*(={1,})?", - "captures": { - "1": { - "name": "markup.punctuation" - }, - "2": { - "name": "keyword.function" - }, - "3": { - "name": "entity.name.knot" - }, - "4": { - "name": "variable.parameter" - }, - "5": { - "name": "markup.punctuation" - } - }, - "name": "meta.knot.declaration" - }, - "tag": { - "begin": "(#)\\s*", - "end": "\\s*$\\n*", - "captures": { - "1": { - "name": "keyword.operator.hashtag" - } - }, - "contentName": "entity.name.tag", - "patterns": [ - { - "include": "#comments" - } - ] - }, - "comments": { - "patterns": [ - { - "begin": "/\\*\\*", - "captures": { - "0": { - "name": "punctuation.definition.comment.json" - } - }, - "end": "\\*/", - "name": "comment.block.documentation.json" - }, - { - "begin": "/\\*", - "captures": { - "0": { - "name": "punctuation.definition.comment.json" - } - }, - "end": "\\*/", - "name": "comment.block.json" - }, - { - "captures": { - "1": { - "name": "punctuation.definition.comment.json" - } - }, - "match": "(//).*$\\n?", - "name": "comment.line.double-slash.js" - } - ] - }, - "TODO": { - "match": "^\\s*(?:(TODO\\s*:)|(TODO\\b))\\s*(.*)", - "captures": { - "1": { - "name": "comment.todo.TODO" - }, - "2": { - "name": "comment.todo.TODO" - }, - "3": { - "name": "comment.todo.message" - } - }, - "begin": "^\\s*(?:(TODO\\s*:)|(TODO\\b))\\s*", - "end": "$\\n?", - "name": "comment.todo" - }, - "include": { - "begin": "^\\s*((INCLUDE)\\s*(\\S*))\\s*", - "beginCaptures": { - "1": { - "name": "meta.include" - }, - "2": { - "name": "keyword.control.include" - }, - "3": { - "name": "string.other" - } - }, - "end": "$\\n?" - }, - "external": { - "begin": "^\\s*((EXTERNAL)\\s*([\\w_0-9]*\\(\\)))\\s*", - "beginCaptures": { - "1": { - "name": "meta.external" - }, - "2": { - "name": "keyword.control.external" - }, - "3": { - "name": "support.function" - } - }, - "end": "$\\n?" - }, - "globalVAR": { - "begin": "^\\s*((VAR|CONST)\\s*(\\w+))\\s*", - "beginCaptures": { - "1": { - "name": "meta.variable.declaration" - }, - "2": { - "name": "storage" - }, - "3": { - "name": "entity.name.variable" - } - }, - "end": "$\\n?", - "name": "meta.variable.assignment" - }, - "choice": { - "begin": "^\\s*((?:[\\*\\+]\\s?)+)\\s*(\\(\\s*(\\w+)\\s*\\))?", - "beginCaptures": { - "1": { - "name": "keyword.operator.weaveBullet.choice" - }, - "2": { - "name": "meta.label" - }, - "3": { - "name": "entity.name.label" - } - }, - "end": "$\\n?", - "name": "choice", - "patterns": [ - { - "include": "#comments" - }, - { - "match": "(\\[)([^\\]]*)(\\])", - "captures": { - "1": { - "name": "keyword.operator.weaveBracket" - }, - "2": { - "name": "string.content" - }, - "3": { - "name": "keyword.operator.weaveBracket" - } - } - }, - { - "include": "#divert" - }, - { - "include": "#mixedContent" - } - ] - }, - "gather": { - "match": "^\\s*((?:-\\s*)+)(?!>)(\\(\\s*(\\w+)\\s*\\))?", - "captures": { - "1": { - "name": "keyword.operator.weaveBullet.gather" - }, - "2": { - "name": "meta.label" - }, - "3": { - "name": "entity.name.label" - } - }, - "name": "meta.gather" - }, - "multiLineLogic": { - "begin": "^\\s*(\\{)([\\w_\\s\\*\\/\\-\\+\\&\\|\\%\\<\\>\\.\\(\\)]+(:))?(?=[^}]+$)", - "beginCaptures": { - "0": { - "name": "meta.logicBegin" - }, - "1": { - "name": "keyword.operator.logic" - }, - "3": { - "name": "keyword.operator.logic" - } - }, - "end": "(\\})", - "endCaptures": { - "1": { - "name": "keyword.operator" - } - }, - "contentName": "meta.multilineLogicInner", - "name": "meta.multilineLogic", - "patterns": [ - { - "match": "^\\s*else\\s*\\:", - "name": "conditional.else" - }, - { - "begin": "^\\s*(-)\\s?[^:]+(:)", - "beginCaptures": { - "1": { - "name": "keyword.operator" - }, - "2": { - "name": "keyword.operator" - } - }, - "end": "$\\n?", - "name": "conditional.clause", - "patterns": [ - { - "include": "#mixedContent" - } - ] - }, - { - "include": "#statements" - } - ] - }, - "inlineConditional": { - "begin": "(\\{)[^:\\|\\}]+:", - "beginCaptures": { - "1": { - "name": "keyword.operator.inlineConditionalStart" - } - }, - "end": "(\\})", - "endCaptures": { - "1": { - "name": "keyword.operator.inlineConditionalEnd" - } - }, - "name": "entity.inlineConditional", - "patterns": [ - { - "match": "\\|", - "name": "keyword.operator.inlineConditionalBranchSeparator" - }, - { - "include": "#mixedContent" - } - ] - }, - "inlineSequence": { - "begin": "(\\{)\\s*(~|&|!|\\$)?(?=([^\\|]*\\|(?!\\|)[^\\}]*)\\})", - "beginCaptures": { - "1": { - "name": "keyword.operator.inlineSequenceStart" - }, - "2": { - "name": "keyword.operator.inlineSequenceTypeChar" - } - }, - "end": "\\}", - "endCaptures": { - "0": { - "name": "keyword.operator.inlineSequenceEnd" - } - }, - "name": "entity.inlineSequence", - "patterns": [ - { - "match": "\\|(?!\\|)", - "name": "keyword.operator.inlineSequenceSeparator" - }, - { - "include": "#mixedContent" - } - ] - }, - "inlineLogic": { - "begin": "(\\{)", - "beginCaptures": { - "1": { - "name": "keyword.operator.inlineLogicStart" - } - }, - "end": "(\\})", - "endCaptures": { - "1": { - "name": "keyword.operator.inlineLogicEnd" - } - }, - "name": "meta.logic" - }, - "logicLine": { - "match": "\\s*(~\\s*.*)$", - "captures": { - "0": { - "name": "meta.logic" - } - } - }, - "divert": { - "match": "(->|<-)\\s*((?:(DONE)|(END)|(\\w+))(?:\\s*\\.\\s*(?:\\w+))*\\s*(?:\\([^\\)]+\\))?)?", - "name": "meta.divert", - "captures": { - "1": { - "name": "keyword.operator.divert" - }, - "3": { - "name": "keyword.done" - }, - "4": { - "name": "keyword.end" - }, - "5": { - "name": "variable.divertTarget" - } - } - }, - "mixedContent": { - "patterns": [ - { - "include": "#inlineConditional" - }, - { - "include": "#inlineSequence" - }, - { - "include": "#inlineLogic" - }, - { - "include": "#divert" - }, - { - "match": "<>", - "name": "constant.glue" - } - ] - }, - "statements": { - "patterns": [ - { - "include": "#include" - }, - { - "include": "#external" - }, - { - "include": "#comments" - }, - { - "include": "#TODO" - }, - { - "include": "#globalVAR" - }, - { - "include": "#choice" - }, - { - "include": "#gather" - }, - { - "include": "#multiLineLogic" - }, - { - "include": "#endOfSection" - }, - { - "include": "#logicLine" - }, - { - "include": "#mixedContent" - }, - { - "include": "#tag" - } - ] - } - } -} diff --git a/syntaxes/ink.tmLanguage.yaml b/syntaxes/ink.tmLanguage.yaml deleted file mode 100644 index b70e9e8..0000000 --- a/syntaxes/ink.tmLanguage.yaml +++ /dev/null @@ -1,250 +0,0 @@ -name: ink -scopeName: source.ink -fileTypes: - - ink - - ink2 -uuid: 5a0f60ba-87b8-4fa9-854c-6bf41f74bd98 -patterns: - - include: "#comments" - - include: "#knot" - - include: "#stitch" - - include: "#choice" - - include: "#gather" - - include: "#statements" -repository: - stitch: - match: ^\s*(=)\s*(\w+)\s*(\([^)\n]*\))?\s*$ - captures: - "1": - name: markup.punctuation - "2": - name: entity.name.stitch - "3": - name: variable.parameter - name: meta.stitch.declaration - knot: - match: ^\s*(={2,})\s*(function)?\s*(\w+)\s*(\([^)]*\))?\s*(={1,})? - captures: - "1": - name: markup.punctuation - "2": - name: keyword.function - "3": - name: entity.name.knot - "4": - name: variable.parameter - "5": - name: markup.punctuation - name: meta.knot.declaration - tag: - begin: (#)\s* - end: \s*$\n* - captures: - "1": - name: keyword.operator.hashtag - contentName: entity.name.tag - patterns: - - include: "#comments" - comments: - patterns: - - begin: /\*\* - captures: - "0": - name: punctuation.definition.comment.json - end: \*/ - name: comment.block.documentation.json - - begin: /\* - captures: - "0": - name: punctuation.definition.comment.json - end: \*/ - name: comment.block.json - - captures: - "1": - name: punctuation.definition.comment.json - match: (//).*$\n? - name: comment.line.double-slash.js - TODO: - match: ^\s*(?:(TODO\s*:)|(TODO\b))\s*(.*) - captures: - "1": - name: comment.todo.TODO - "2": - name: comment.todo.TODO - "3": - name: comment.todo.message - begin: ^\s*(?:(TODO\s*:)|(TODO\b))\s* - end: $\n? - name: comment.todo - include: - begin: ^\s*((INCLUDE)\s*(\S*))\s* - beginCaptures: - "1": - name: meta.include - "2": - name: keyword.control.include - "3": - name: string.other - end: $\n? - external: - begin: ^\s*((EXTERNAL)\s*([\w_0-9]*\(\)))\s* - beginCaptures: - "1": - name: meta.external - "2": - name: keyword.control.external - "3": - name: support.function - end: $\n? - globalVAR: - begin: ^\s*((VAR|CONST)\s*(\w+))\s* - beginCaptures: - "1": - name: meta.variable.declaration - "2": - name: storage - "3": - name: entity.name.variable - end: $\n? - name: meta.variable.assignment - choice: - begin: ^\s*((?:[\*\+]\s?)+)\s*(\(\s*(\w+)\s*\))? - beginCaptures: - "1": - name: keyword.operator.weaveBullet.choice - "2": - name: meta.label - "3": - name: entity.name.label - end: $\n? - name: choice - patterns: - - include: "#comments" - - match: (\[)([^\]]*)(\]) - captures: - "1": - name: keyword.operator.weaveBracket - "2": - name: string.content - "3": - name: keyword.operator.weaveBracket - - include: "#divert" - - include: "#mixedContent" - gather: - match: ^\s*((?:-\s*)+)(?!>)(\(\s*(\w+)\s*\))? - captures: - "1": - name: keyword.operator.weaveBullet.gather - "2": - name: meta.label - "3": - name: entity.name.label - name: meta.gather - multiLineLogic: - begin: ^\s*(\{)([\w_\s\*\/\-\+\&\|\%\<\>\.\(\)]+(:))?(?=[^}]+$) - beginCaptures: - "0": - name: meta.logicBegin - "1": - name: keyword.operator.logic - "3": - name: keyword.operator.logic - end: (\}) - endCaptures: - "1": - name: keyword.operator - contentName: meta.multilineLogicInner - name: meta.multilineLogic - patterns: - - match: "^\\s*else\\s*\\:" - name: conditional.else - - begin: ^\s*(-)\s?[^:]+(:) - beginCaptures: - "1": - name: keyword.operator - "2": - name: keyword.operator - end: $\n? - name: conditional.clause - patterns: - - include: "#mixedContent" - - include: "#statements" - inlineConditional: - begin: "(\\{)[^:\\|\\}]+:" - beginCaptures: - "1": - name: keyword.operator.inlineConditionalStart - end: (\}) - endCaptures: - "1": - name: keyword.operator.inlineConditionalEnd - name: entity.inlineConditional - patterns: - - match: \| - name: keyword.operator.inlineConditionalBranchSeparator - - include: "#mixedContent" - inlineSequence: - begin: (\{)\s*(~|&|!|\$)?(?=([^\|]*\|(?!\|)[^\}]*)\}) - beginCaptures: - "1": - name: keyword.operator.inlineSequenceStart - "2": - name: keyword.operator.inlineSequenceTypeChar - end: \} - endCaptures: - "0": - name: keyword.operator.inlineSequenceEnd - name: entity.inlineSequence - patterns: - - match: \|(?!\|) - name: keyword.operator.inlineSequenceSeparator - - include: "#mixedContent" - inlineLogic: - begin: (\{) - beginCaptures: - "1": - name: keyword.operator.inlineLogicStart - end: (\}) - endCaptures: - "1": - name: keyword.operator.inlineLogicEnd - name: meta.logic - logicLine: - match: \s*(~\s*.*)$ - captures: - "0": - name: meta.logic - divert: - match: (->|<-)\s*((?:(DONE)|(END)|(\w+))(?:\s*\.\s*(?:\w+))*\s*(?:\([^\)]+\))?)? - name: meta.divert - captures: - "1": - name: keyword.operator.divert - "3": - name: keyword.done - "4": - name: keyword.end - "5": - name: variable.divertTarget - mixedContent: - patterns: - - include: "#inlineConditional" - - include: "#inlineSequence" - - include: "#inlineLogic" - - include: "#divert" - - match: <> - name: constant.glue - statements: - patterns: - - include: "#include" - - include: "#external" - - include: "#comments" - - include: "#TODO" - - include: "#globalVAR" - - include: "#choice" - - include: "#gather" - - include: "#multiLineLogic" - - include: "#endOfSection" - - include: "#logicLine" - - include: "#mixedContent" - - include: "#tag"