Changing to an LSP style model. Client extension is now small af

This commit is contained in:
Noah Santschi-Cooney 2018-06-02 21:04:53 +01:00
parent cefd0e2e67
commit 3db6964f7c
No known key found for this signature in database
GPG key ID: 3B22282472C8AE48
21 changed files with 728 additions and 820 deletions

63
.vscode/launch.json vendored
View file

@ -1,36 +1,33 @@
// A launch configuration that compiles the extension and then opens it inside a new window
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
{
"version": "0.2.0",
"configurations": [
{
"name": "Extension",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"outFiles": [
"${workspaceFolder}/out/**/*.js"
],
"preLaunchTask": "npm: watch"
},
{
"name": "Extension Tests",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test"
],
"outFiles": [
"${workspaceFolder}/out/test/**/*.js"
],
"preLaunchTask": "npm: watch"
}
]
// List of configurations. Add new configurations or edit existing ones.
"configurations": [
{
"name": "Launch Client",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceRoot}/client"
],
"stopOnEntry": false,
"sourceMaps": true,
"outFiles": [
"${workspaceRoot}/client/out/**/*.js"
],
"preLaunchTask": "watch:client"
},
{
"name": "Attach to Server",
"type": "node",
"request": "attach",
"port": 6009,
"sourceMaps": true,
"outFiles": [
"${workspaceRoot}/client/server/**/*.js"
],
"protocol": "legacy",
"preLaunchTask": "watch:server"
}
]
}

View file

@ -1,7 +1,7 @@
// Place your settings in this file to overwrite default and user settings.
{
"files.exclude": {
"out": false // set this to true to hide the "out" folder with the compiled JS files
"out": true // set this to true to hide the "out" folder with the compiled JS files
},
"search.exclude": {
"out": true // set this to false to include "out" folder in search results

97
.vscode/tasks.json vendored
View file

@ -1,20 +1,79 @@
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "watch",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"presentation": {
"reveal": "never"
},
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
"version": "2.0.0",
"tasks": [
{
"label": "compile",
"dependsOn": [
"compile:client",
"compile:server"
],
"problemMatcher": []
},
{
"label": "compile:client",
"type": "npm",
"script": "compile:client",
"group": "build",
"presentation": {
"panel": "dedicated",
"reveal": "never"
},
"problemMatcher": [
"$tsc"
]
},
{
"label": "compile:server",
"type": "npm",
"script": "compile:server",
"group": "build",
"presentation": {
"panel": "dedicated",
"reveal": "never"
},
"problemMatcher": [
"$tsc"
]
},
{
"label": "watch",
"dependsOn": [
"watch:client",
"watch:server"
],
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": []
},
{
"label": "watch:client",
"type": "npm",
"script": "watch:client",
"isBackground": true,
"group": "build",
"presentation": {
"panel": "dedicated",
"reveal": "never"
},
"problemMatcher": [
"$tsc-watch"
]
},
{
"label": "watch:server",
"type": "npm",
"script": "watch:server",
"isBackground": true,
"group": "build",
"presentation": {
"panel": "dedicated",
"reveal": "never"
},
"problemMatcher": [
"$tsc-watch"
]
}
]
}

View file

@ -4,29 +4,6 @@
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"@types/events": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/@types/events/-/events-1.2.0.tgz",
"integrity": "sha512-KEIlhXnIutzKwRbQkGWb/I4HFqBuUykAdHgDED6xqwXJfONCjF5VoE0cXEiurh3XauygxzeDzgtXUqvLkxFzzA==",
"dev": true
},
"@types/glob": {
"version": "5.0.35",
"resolved": "https://registry.npmjs.org/@types/glob/-/glob-5.0.35.tgz",
"integrity": "sha512-wc+VveszMLyMWFvXLkloixT4n0harUIVZjnpzztaZ0nKLuul7Z32iMt2fUFGAaZ4y1XWjFRMtCI5ewvyh4aIeg==",
"dev": true,
"requires": {
"@types/events": "*",
"@types/minimatch": "*",
"@types/node": "*"
}
},
"@types/minimatch": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz",
"integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==",
"dev": true
},
"@types/mocha": {
"version": "2.2.48",
"resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-2.2.48.tgz",
@ -39,16 +16,6 @@
"integrity": "sha512-i8KiWTXKD8O76LjlTt+lK/8CUY/FDLbw5djHNrEK1SjOM6MAcZhvhskCX8vsujdxVD+UeX7SvusEzchLY4UBYQ==",
"dev": true
},
"@types/shelljs": {
"version": "0.7.9",
"resolved": "https://registry.npmjs.org/@types/shelljs/-/shelljs-0.7.9.tgz",
"integrity": "sha512-GwfXBWx+JgH+mrf35NnNFPFl6kQZgDQqZBUdWrHB1phulBbVpOwedZun7hZRyfTOxlicwo4ftsC1fpUZZIiN5w==",
"dev": true,
"requires": {
"@types/glob": "*",
"@types/node": "*"
}
},
"ajv": {
"version": "5.5.2",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz",
@ -70,15 +37,6 @@
"ansi-wrap": "0.1.0"
}
},
"ansi-gray": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/ansi-gray/-/ansi-gray-0.1.1.tgz",
"integrity": "sha1-KWLPVOyXksSFEKPetSRDaGHvclE=",
"dev": true,
"requires": {
"ansi-wrap": "0.1.0"
}
},
"ansi-red": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/ansi-red/-/ansi-red-0.1.1.tgz",
@ -235,7 +193,8 @@
"balanced-match": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c="
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
"dev": true
},
"bcrypt-pbkdf": {
"version": "1.0.1",
@ -247,12 +206,6 @@
"tweetnacl": "^0.14.3"
}
},
"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",
@ -262,19 +215,11 @@
"inherits": "~2.0.0"
}
},
"boom": {
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/boom/-/boom-4.3.1.tgz",
"integrity": "sha1-T4owBctKfjiJ90kDD9JbluAdLjE=",
"dev": true,
"requires": {
"hoek": "4.x.x"
}
},
"brace-expansion": {
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
"dev": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
@ -304,9 +249,9 @@
"dev": true
},
"buffer-from": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.0.0.tgz",
"integrity": "sha512-83apNb8KK0Se60UE1+4Ukbe3HbfELJ6UlI4ldtOGs7So4KD26orJM8hIY9lxdzP+UpItH1Yh/Y8GUvNFWFFRxA==",
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.0.tgz",
"integrity": "sha512-c5mRlguI/Pe2dSZmpER62rSCu0ryKmWddzRYsuXc50U2/g8jMOulc31VZMa4mYx31U5xsmSOpDCgH88Vl9cDGQ==",
"dev": true
},
"builtin-modules": {
@ -402,12 +347,6 @@
"integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
"dev": true
},
"color-support": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz",
"integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==",
"dev": true
},
"combined-stream": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz",
@ -426,7 +365,8 @@
"concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
"dev": true
},
"convert-source-map": {
"version": "1.5.1",
@ -440,26 +380,6 @@
"integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=",
"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.x.x"
},
"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.x.x"
}
}
}
},
"dashdash": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz",
@ -469,12 +389,6 @@
"assert-plus": "^1.0.0"
}
},
"dateformat": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/dateformat/-/dateformat-2.2.0.tgz",
"integrity": "sha1-QGXiATz5+5Ft39gu+1Bq1MZ2kGI=",
"dev": true
},
"debug": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
@ -511,41 +425,6 @@
"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.9"
},
"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.0",
"inherits": "~2.0.1",
"isarray": "0.0.1",
"string_decoder": "~0.10.x"
}
},
"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.6.0",
"resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.6.0.tgz",
@ -666,17 +545,6 @@
"integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=",
"dev": true
},
"fancy-log": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/fancy-log/-/fancy-log-1.3.2.tgz",
"integrity": "sha1-9BEl49hPLn2JpD0G2VjI94vha+E=",
"dev": true,
"requires": {
"ansi-gray": "^0.1.1",
"color-support": "^1.1.3",
"time-stamp": "^1.0.0"
}
},
"fast-deep-equal": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz",
@ -764,7 +632,8 @@
"fs.realpath": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
"dev": true
},
"fstream": {
"version": "1.0.11",
@ -791,6 +660,7 @@
"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.4",
@ -911,15 +781,6 @@
}
}
},
"glogg": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/glogg/-/glogg-1.0.1.tgz",
"integrity": "sha512-ynYqXLoluBKf9XGR1gA59yEJisIL7YHEH4xr3ZziHB5/yl4qWfaK8Js9jGe6gBGCSCKVqiyO30WnRZADvemUNw==",
"dev": true,
"requires": {
"sparkles": "^1.0.0"
}
},
"graceful-fs": {
"version": "4.1.11",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz",
@ -1092,75 +953,24 @@
}
},
"gulp-untar": {
"version": "0.0.6",
"resolved": "https://registry.npmjs.org/gulp-untar/-/gulp-untar-0.0.6.tgz",
"integrity": "sha1-1r3v3n6ajgVMnxYjhaB4LEvnQAA=",
"version": "0.0.7",
"resolved": "https://registry.npmjs.org/gulp-untar/-/gulp-untar-0.0.7.tgz",
"integrity": "sha512-0QfbCH2a1k2qkTLWPqTX+QO4qNsHn3kC546YhAP3/n0h+nvtyGITDuDrYBMDZeW4WnFijmkOvBWa5HshTic1tw==",
"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.2",
"beeper": "^1.0.0",
"chalk": "^1.0.0",
"dateformat": "^2.0.0",
"fancy-log": "^1.1.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.0.0",
"minimist": "^1.1.0",
"multipipe": "^0.1.2",
"object-assign": "^3.0.0",
"replace-ext": "0.0.1",
"through2": "^2.0.0",
"vinyl": "^0.5.0"
"through2": "~2.0.3",
"vinyl": "^1.2.0"
},
"dependencies": {
"chalk": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
"integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
"dev": true,
"requires": {
"ansi-styles": "^2.2.1",
"escape-string-regexp": "^1.0.2",
"has-ansi": "^2.0.0",
"strip-ansi": "^3.0.0",
"supports-color": "^2.0.0"
}
},
"clone": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz",
"integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=",
"dev": true
},
"minimist": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
"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
},
"replace-ext": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-0.0.1.tgz",
@ -1168,9 +978,9 @@
"dev": true
},
"vinyl": {
"version": "0.5.3",
"resolved": "https://registry.npmjs.org/vinyl/-/vinyl-0.5.3.tgz",
"integrity": "sha1-sEVbOPxeDPMNQyUTLkYZcMIJHN4=",
"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.0",
@ -1232,15 +1042,6 @@
}
}
},
"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",
@ -1272,39 +1073,12 @@
"integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
"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": "6.0.2",
"resolved": "https://registry.npmjs.org/hawk/-/hawk-6.0.2.tgz",
"integrity": "sha512-miowhl2+U7Qle4vdLqDdPt9m09K6yZhkLDTWGoUiUzrQCn+mHHSmfJgAyGaLRZbPmTqfFFjRV1QWCW0VWUJBbQ==",
"dev": true,
"requires": {
"boom": "4.x.x",
"cryptiles": "3.x.x",
"hoek": "4.x.x",
"sntp": "2.x.x"
}
},
"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": "4.2.1",
"resolved": "https://registry.npmjs.org/hoek/-/hoek-4.2.1.tgz",
"integrity": "sha512-QLg82fGkfnJ/4iy1xZ81/9SIJiq1NGFUMGs6ParyjBZr6jW2Ufj/snDqTHixNlHdPNwN2RLVD0Pi3igeK9+JfA==",
"dev": true
},
"http-signature": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz",
@ -1320,6 +1094,7 @@
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
"dev": true,
"requires": {
"once": "^1.3.0",
"wrappy": "1"
@ -1328,12 +1103,8 @@
"inherits": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
},
"interpret": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/interpret/-/interpret-1.1.0.tgz",
"integrity": "sha1-ftGxQQxqDg94z5XTuEQMY/eLhhQ="
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=",
"dev": true
},
"is": {
"version": "3.2.1",
@ -1549,131 +1320,12 @@
"readable-stream": "^2.0.5"
}
},
"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.0"
}
},
"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.0.0",
"lodash.isarguments": "^3.0.0",
"lodash.isarray": "^3.0.0"
}
},
"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.0",
"lodash._basetostring": "^3.0.0",
"lodash._basevalues": "^3.0.0",
"lodash._isiterateecall": "^3.0.0",
"lodash._reinterpolate": "^3.0.0",
"lodash.escape": "^3.0.0",
"lodash.keys": "^3.0.0",
"lodash.restparam": "^3.0.0",
"lodash.templatesettings": "^3.0.0"
}
},
"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.0.0"
}
},
"map-stream": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.1.0.tgz",
@ -1770,6 +1422,7 @@
"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.7"
}
@ -1854,15 +1507,6 @@
"minimatch": "^3.0.0"
}
},
"multipipe": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/multipipe/-/multipipe-0.1.2.tgz",
"integrity": "sha1-Ko8t33Du1WTf8tV/HhoTfZ8FB4s=",
"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",
@ -1907,6 +1551,7 @@
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
"dev": true,
"requires": {
"wrappy": "1"
}
@ -1959,12 +1604,14 @@
"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="
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
"dev": true
},
"path-parse": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz",
"integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME="
"integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=",
"dev": true
},
"pause-stream": {
"version": "0.0.11",
@ -2079,14 +1726,6 @@
"util-deprecate": "~1.0.1"
}
},
"rechoir": {
"version": "0.6.2",
"resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz",
"integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=",
"requires": {
"resolve": "^1.1.6"
}
},
"regex-cache": {
"version": "0.4.4",
"resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz",
@ -2121,9 +1760,9 @@
"dev": true
},
"request": {
"version": "2.85.0",
"resolved": "https://registry.npmjs.org/request/-/request-2.85.0.tgz",
"integrity": "sha512-8H7Ehijd4js+s6wuVPLjwORxD4zeuyjYugprdOXlPSqaApmL/QOy+EB/beICHVCHkGMKNh5rvihb5ov+IDw4mg==",
"version": "2.87.0",
"resolved": "https://registry.npmjs.org/request/-/request-2.87.0.tgz",
"integrity": "sha512-fcogkm7Az5bsS6Sl0sibkbhcKsnyon/jV1kF3ajGmF0c8HrttdKTPRT9hieOaQHA5HEq6r8OyWOo/o781C1tNw==",
"dev": true,
"requires": {
"aws-sign2": "~0.7.0",
@ -2134,7 +1773,6 @@
"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",
@ -2144,7 +1782,6 @@
"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"
@ -2160,6 +1797,7 @@
"version": "1.7.1",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.7.1.tgz",
"integrity": "sha512-c7rwLofp8g1U+h1KNyHL/jicrKg1Ek4q+Lr33AL65uZTinUZHe30D5HlyN5V9NW0JX1D5dXQ4jqW5l7Sy/kGfw==",
"dev": true,
"requires": {
"path-parse": "^1.0.5"
}
@ -2185,25 +1823,6 @@
"integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==",
"dev": true
},
"shelljs": {
"version": "0.8.2",
"resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.2.tgz",
"integrity": "sha512-pRXeNrCA2Wd9itwhvLp5LZQvPJ0wU6bcjaTMywHHGX5XWhVN2nzSu7WV0q+oUY7mGK3mgSkDDzP3MgjqdyIgbQ==",
"requires": {
"glob": "^7.0.0",
"interpret": "^1.0.0",
"rechoir": "^0.6.2"
}
},
"sntp": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/sntp/-/sntp-2.1.0.tgz",
"integrity": "sha512-FL1b58BDrqS3A11lJ0zEdnJ3UOKqVxawAkF3k7F0CVN7VQ34aZrV+G8BZ1WC9ZL7NyrwsW0oviwsWDgRuVYtJg==",
"dev": true,
"requires": {
"hoek": "4.x.x"
}
},
"source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
@ -2211,21 +1830,15 @@
"dev": true
},
"source-map-support": {
"version": "0.5.5",
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.5.tgz",
"integrity": "sha512-mR7/Nd5l1z6g99010shcXJiNEaf3fEtmLhRB/sBcQVJGodcHCULPp2y4Sfa43Kv2zq7T+Izmfp/WHCR6dYkQCA==",
"version": "0.5.6",
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.6.tgz",
"integrity": "sha512-N4KXEz7jcKqPf2b2vZF11lQIz9W5ZMuUcIOGj243lduidkf2fjkVKJS9vNxVWn3u/uxX38AcE8U9nnH9FPcq+g==",
"dev": true,
"requires": {
"buffer-from": "^1.0.0",
"source-map": "^0.6.0"
}
},
"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",
@ -2302,12 +1915,6 @@
"safe-buffer": "~5.1.0"
}
},
"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",
@ -2379,12 +1986,6 @@
"xtend": "~4.0.0"
}
},
"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",
@ -2591,9 +2192,9 @@
}
},
"vscode": {
"version": "1.1.17",
"resolved": "https://registry.npmjs.org/vscode/-/vscode-1.1.17.tgz",
"integrity": "sha512-yNMyrgEua2qyW7+trNNYhA6PeldRrBcwtLtlazkdtzcmkHMKECM/08bPF8HF2ZFuwHgD+8FQsdqd/DvJYQYjJg==",
"version": "1.1.18",
"resolved": "https://registry.npmjs.org/vscode/-/vscode-1.1.18.tgz",
"integrity": "sha512-SyDw4qFwZ+WthZX7RWp71PNiWLF7VhpM65j2oryY/6jtSORd8qH6J8vclwWZJ6Jvu0EH7JamO2RWNfBfsMR9Zw==",
"dev": true,
"requires": {
"glob": "^7.1.2",
@ -2602,7 +2203,7 @@
"gulp-gunzip": "1.0.0",
"gulp-remote-src-vscode": "^0.5.0",
"gulp-symdest": "^1.1.0",
"gulp-untar": "^0.0.6",
"gulp-untar": "^0.0.7",
"gulp-vinyl-zip": "^2.1.0",
"mocha": "^4.0.1",
"request": "^2.83.0",
@ -2612,10 +2213,38 @@
"vinyl-source-stream": "^1.1.0"
}
},
"vscode-jsonrpc": {
"version": "3.6.2",
"resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-3.6.2.tgz",
"integrity": "sha512-T24Jb5V48e4VgYliUXMnZ379ItbrXgOimweKaJshD84z+8q7ZOZjJan0MeDe+Ugb+uqERDVV8SBmemaGMSMugA=="
},
"vscode-languageclient": {
"version": "4.1.4",
"resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-4.1.4.tgz",
"integrity": "sha512-V2fWd+2vm8wmShjgciBxovMzSXMzBFtQo2R6OIW5kJIynds6x0J3SwMNa3QKAmhsCDy3WmBwnplBGtyGNNnvPA==",
"requires": {
"vscode-languageserver-protocol": "^3.7.2"
}
},
"vscode-languageserver-protocol": {
"version": "3.7.2",
"resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.7.2.tgz",
"integrity": "sha512-VVJwIA/FPl/FnVtrns0FPK6TLi/ET7n1Yo6tCrm6aG7+yAVwIGWdpTmKE+nbP8wEMMbHCkIabk63IJvfz2HNRg==",
"requires": {
"vscode-jsonrpc": "^3.6.2",
"vscode-languageserver-types": "^3.7.2"
}
},
"vscode-languageserver-types": {
"version": "3.7.2",
"resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.7.2.tgz",
"integrity": "sha512-L9D2RA+PDS2CiyhLQY5ZrOmyRvXyjc4Ha8s9PqS6mIgGxj00R5Xx2vLKBnAOVfrawJXYZST+2hioMks6SQVU7A=="
},
"wrappy": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
"dev": true
},
"xtend": {
"version": "4.0.1",

83
client/package.json Normal file
View file

@ -0,0 +1,83 @@
{
"name": "vscode-mc-shader-client",
"description": "A Visual Studio Code extension for linting/etc Minecraft GLSL Shaders",
"version": "0.0.1",
"publisher": "Noah Santschi-Cooney (Strum355)",
"author": "Noah Santschi-Cooney (Strum355)",
"license": "MIT",
"repository": {
"url": "https://github.com/Strum355/vscode-mc-shader"
},
"engines": {
"vscode": "^1.23.0"
},
"categories": [
"Linters",
"Programming Languages"
],
"activationEvents": [
"onLanguage:glsl",
"workspaceContains:**/*.fsh",
"workspaceContains:**/*.vsh",
"workspaceContains:**/*.gsh",
"workspaceContains:**/*.glsl"
],
"extensionDependencies": [
"slevesque.shader"
],
"main": "./out/extension",
"contributes": {
"languages": [
{
"id": "glsl",
"aliases": [
"OpenGL Shading Language"
],
"extensions": [
".fsh",
".vsh",
".gsh",
".glsl"
]
}
],
"configuration": {
"title": "Minecraft GLSL configurations",
"properties": {
"mcglsl.glslangValidatorPath": {
"type": "string",
"default": "glslangValidator",
"description": "The path to the glslangValidator executable. Default value assumes its in your PATH."
},
"mcglsl.lintOnType": {
"type": "boolean",
"default": false,
"description": "Whether or not to lint while typing. Can decrease performance."
},
"mcglsl.minecraftPath": {
"type": "string",
"default": "",
"description": "Absolute path to your Minecraft installation folder. The shaderpacks folder will be derived from this."
}
}
}
},
"scripts": {
"vscode:prepublish": "npm run compile",
"compile": "tsc -p ./",
"watch": "tsc -watch -p ./",
"postinstall": "node ./node_modules/vscode/bin/install",
"test": "npm run compile && node ./node_modules/vscode/bin/test",
"lint": "tslint -c tslint.json 'src/**/*.ts'"
},
"devDependencies": {
"@types/mocha": "^2.2.42",
"@types/node": "^7.0.43",
"tslint": "^5.8.0",
"typescript": "^2.6.1",
"vscode": "^1.1.18"
},
"dependencies": {
"vscode-languageclient": "^4.1.4"
}
}

30
client/src/extension.ts Normal file
View file

@ -0,0 +1,30 @@
import * as vscode from 'vscode'
import * as vscodeLang from 'vscode-languageclient'
import * as path from 'path'
export function activate(context: vscode.ExtensionContext) {
const serverModule = context.asAbsolutePath(path.join('server', 'server.js'))
const debugOpts = { execArgv: ['--nolazy', '--debug=6009']}
const serverOpts: vscodeLang.ServerOptions = {
run: {
module: serverModule, transport: vscodeLang.TransportKind.ipc
},
debug: {
module: serverModule, transport: vscodeLang.TransportKind.ipc, options: debugOpts
}
}
const clientOpts: vscodeLang.LanguageClientOptions = {
documentSelector: [{scheme: 'file', language: 'glsl'}],
synchronize: {
configurationSection: 'mcglsl',
fileEvents: vscode.workspace.createFileSystemWatcher('**/*.{fsh,gsh,vsh,glsl}')
}
}
const disposable = new vscodeLang.LanguageClient('vscode-mc-shader', serverOpts, clientOpts)
context.subscriptions.push(disposable.start())
}

View file

@ -3,78 +3,24 @@
"displayName": "vscode-mc-shader",
"description": "A Visual Studio Code extension for linting/etc Minecraft GLSL Shaders",
"version": "0.0.1",
"publisher": "Strum355",
"publisher": "Noah Santschi-Cooney (Strum355)",
"author": "Noah Santschi-Cooney (Strum355)",
"license": "MIT",
"repository": {
"url": "https://github.com/Strum355/vscode-mc-shader"
},
"engines": {
"vscode": "^1.23.0"
},
"categories": [
"Linters",
"Programming Languages"
],
"activationEvents": [
"onLanguage:glsl",
"workspaceContains:**/*.fsh",
"workspaceContains:**/*.vsh",
"workspaceContains:**/*.gsh"
],
"extensionDependencies": [
"slevesque.shader"
],
"main": "./out/extension",
"contributes": {
"languages": [
{
"id": "glsl",
"extensions": [
".fsh",
".vsh",
".gsh",
".glsl"
]
}
],
"configuration": {
"title": "Minecraft GLSL configurations",
"properties": {
"mcglsl.glslangValidatorPath": {
"type": "string",
"default": "glslangValidator",
"description": "The path to the glslangValidator executable. Default value assumes its in your PATH."
},
"mcglsl.lintOnType": {
"type": "boolean",
"default": false,
"description": "Whether or not to lint while typing. Can decrease performance."
},
"mcglsl.minecraftPath": {
"type": "string",
"default": "",
"description": "Absolute path to your Minecraft installation folder. The shaderpacks folder will be derived from this."
}
}
}
},
"scripts": {
"vscode:prepublish": "npm run compile",
"compile": "tsc -p ./",
"watch": "tsc -watch -p ./",
"postinstall": "node ./node_modules/vscode/bin/install",
"test": "npm run compile && node ./node_modules/vscode/bin/test",
"lint": "tslint -c tslint.json 'src/**/*.ts'"
"postinstall": "cd server && npm install && cd ../client && npm install && cd ..",
"compile": "tsc -p client/tsconfig.json && cd server && npm run installServer && cd .. && tsc -p server/tsconfig.json",
"compile:client": "tsc -p client/tsconfig.json",
"watch:client": "tsc -w -p client/tsconfig.json",
"compile:server": "cd server && npm run installServer && cd .. && tsc -p server/tsconfig.json",
"watch:server": "cd server && npm run installServer && cd .. && tsc -w -p server/tsconfig.json"
},
"devDependencies": {
"@types/mocha": "^2.2.42",
"@types/node": "^7.0.43",
"@types/shelljs": "^0.7.9",
"tslint": "^5.8.0",
"typescript": "^2.6.1",
"vscode": "^1.1.6"
},
"dependencies": {
"shelljs": "^0.8.2"
"typescript": "^2.6.1"
}
}

378
server/package-lock.json generated Normal file
View file

@ -0,0 +1,378 @@
{
"name": "vscode-mc-shader-server",
"version": "0.0.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"@types/node": {
"version": "7.0.65",
"resolved": "https://registry.npmjs.org/@types/node/-/node-7.0.65.tgz",
"integrity": "sha512-iUdyWWikcQnGvIZnYh5ZxnxeREykndA9+iGdo068NGNutibWknDjmmNMq/8cnS1eaTCcgqJsPsFppw3XJWNlUg==",
"dev": true
},
"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
},
"argparse": {
"version": "1.0.10",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
"integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
"dev": true,
"requires": {
"sprintf-js": "~1.0.2"
}
},
"babel-code-frame": {
"version": "6.26.0",
"resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz",
"integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=",
"dev": true,
"requires": {
"chalk": "^1.1.3",
"esutils": "^2.0.2",
"js-tokens": "^3.0.2"
},
"dependencies": {
"chalk": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
"integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
"dev": true,
"requires": {
"ansi-styles": "^2.2.1",
"escape-string-regexp": "^1.0.2",
"has-ansi": "^2.0.0",
"strip-ansi": "^3.0.0",
"supports-color": "^2.0.0"
}
}
}
},
"balanced-match": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
"dev": true
},
"brace-expansion": {
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
"dev": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
}
},
"builtin-modules": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz",
"integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=",
"dev": true
},
"chalk": {
"version": "2.4.1",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz",
"integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==",
"dev": true,
"requires": {
"ansi-styles": "^3.2.1",
"escape-string-regexp": "^1.0.5",
"supports-color": "^5.3.0"
},
"dependencies": {
"ansi-styles": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
"dev": true,
"requires": {
"color-convert": "^1.9.0"
}
},
"supports-color": {
"version": "5.4.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz",
"integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==",
"dev": true,
"requires": {
"has-flag": "^3.0.0"
}
}
}
},
"color-convert": {
"version": "1.9.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.1.tgz",
"integrity": "sha512-mjGanIiwQJskCC18rPR6OmrZ6fm2Lc7PeGFYwCmy5J34wC6F1PzdGL6xeMfmgicfYcNLGuVFA3WzXtIDCQSZxQ==",
"dev": true,
"requires": {
"color-name": "^1.1.1"
}
},
"color-name": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
"integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
"dev": true
},
"commander": {
"version": "2.15.1",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz",
"integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==",
"dev": true
},
"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
},
"diff": {
"version": "3.5.0",
"resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz",
"integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==",
"dev": true
},
"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
},
"esprima": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz",
"integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==",
"dev": true
},
"esutils": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz",
"integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=",
"dev": true
},
"fs.realpath": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
"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.4",
"inherits": "2",
"minimatch": "^3.0.4",
"once": "^1.3.0",
"path-is-absolute": "^1.0.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.0.0"
}
},
"has-flag": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
"integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
"dev": true
},
"inflight": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
"dev": true,
"requires": {
"once": "^1.3.0",
"wrappy": "1"
}
},
"inherits": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=",
"dev": true
},
"js-tokens": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz",
"integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=",
"dev": true
},
"js-yaml": {
"version": "3.12.0",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz",
"integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==",
"dev": true,
"requires": {
"argparse": "^1.0.7",
"esprima": "^4.0.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.7"
}
},
"once": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
"dev": true,
"requires": {
"wrappy": "1"
}
},
"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
},
"path-parse": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz",
"integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=",
"dev": true
},
"resolve": {
"version": "1.7.1",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.7.1.tgz",
"integrity": "sha512-c7rwLofp8g1U+h1KNyHL/jicrKg1Ek4q+Lr33AL65uZTinUZHe30D5HlyN5V9NW0JX1D5dXQ4jqW5l7Sy/kGfw==",
"dev": true,
"requires": {
"path-parse": "^1.0.5"
}
},
"semver": {
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz",
"integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==",
"dev": true
},
"sprintf-js": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
"integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=",
"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.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
},
"tslib": {
"version": "1.9.2",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.2.tgz",
"integrity": "sha512-AVP5Xol3WivEr7hnssHDsaM+lVrVXWUvd1cfXTRkTj80b//6g2wIFEH6hZG0muGZRnHGrfttpdzRk3YlBkWjKw==",
"dev": true
},
"tslint": {
"version": "5.10.0",
"resolved": "https://registry.npmjs.org/tslint/-/tslint-5.10.0.tgz",
"integrity": "sha1-EeJrzLiK+gLdDZlWyuPUVAtfVMM=",
"dev": true,
"requires": {
"babel-code-frame": "^6.22.0",
"builtin-modules": "^1.1.1",
"chalk": "^2.3.0",
"commander": "^2.12.1",
"diff": "^3.2.0",
"glob": "^7.1.1",
"js-yaml": "^3.7.0",
"minimatch": "^3.0.4",
"resolve": "^1.3.2",
"semver": "^5.3.0",
"tslib": "^1.8.0",
"tsutils": "^2.12.1"
}
},
"tsutils": {
"version": "2.27.1",
"resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.27.1.tgz",
"integrity": "sha512-AE/7uzp32MmaHvNNFES85hhUDHFdFZp6OAiZcd6y4ZKKIg6orJTm8keYWBhIhrJQH3a4LzNKat7ZPXZt5aTf6w==",
"dev": true,
"requires": {
"tslib": "^1.8.1"
}
},
"typescript": {
"version": "2.9.1",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-2.9.1.tgz",
"integrity": "sha512-h6pM2f/GDchCFlldnriOhs1QHuwbnmj6/v7499eMHqPeW4V2G0elua2eIc2nu8v2NdHV0Gm+tzX83Hr6nUFjQA==",
"dev": true
},
"vscode-jsonrpc": {
"version": "3.5.0",
"resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-3.5.0.tgz",
"integrity": "sha1-hyOdnhZrLXNSJFuKgTWXgEwdY6o="
},
"vscode-languageserver": {
"version": "3.5.1",
"resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-3.5.1.tgz",
"integrity": "sha512-RYUKn0DgHTFcS8kS4VaNCjNMaQXYqiXdN9bKrFjXzu5RPKfjIYcoh47oVWwZj4L3R/DPB0Se7HPaDatvYY2XgQ==",
"requires": {
"vscode-languageserver-protocol": "3.5.1",
"vscode-uri": "^1.0.1"
}
},
"vscode-languageserver-protocol": {
"version": "3.5.1",
"resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.5.1.tgz",
"integrity": "sha512-1fPDIwsAv1difCV+8daOrJEGunClNJWqnUHq/ncWrjhitKWXgGmRCjlwZ3gDUTt54yRcvXz1PXJDaRNvNH6pYA==",
"requires": {
"vscode-jsonrpc": "3.5.0",
"vscode-languageserver-types": "3.5.0"
}
},
"vscode-languageserver-types": {
"version": "3.5.0",
"resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.5.0.tgz",
"integrity": "sha1-5I15li8LjgLelV4/UkkI4rGcA3Q="
},
"vscode-uri": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-1.0.3.tgz",
"integrity": "sha1-Yxvb9xbcyrDmUpGo3CXCMjIIWlI="
},
"wrappy": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
"dev": true
}
}
}

27
server/package.json Normal file
View file

@ -0,0 +1,27 @@
{
"name": "vscode-mc-shader-server",
"description": "A Visual Studio Code extension for linting/etc Minecraft GLSL Shaders",
"version": "0.0.1",
"author": "Noah Santschi-Cooney (Strum355)",
"license": "MIT",
"engines": {
"node": "*"
},
"repository": {
"type": "git",
"url": "https://dl.continuum.graphics/nova-group/bedrock-verifier.git"
},
"devDependencies": {
"@types/node": "^7.0.43",
"tslint": "^5.8.0",
"typescript": "^2.6.1"
},
"dependencies": {
"vscode-languageserver": "^3.4.2"
},
"scripts": {
"installServer": "installServerIntoExtension ../client ./package.json ./tsconfig.json",
"compile": "installServerIntoExtension ../client ./package.json ./tsconfig.json && tsc -p .",
"watch": "installServerIntoExtension ../client ./package.json ./tsconfig.json && tsc -w -p ."
}
}

3
server/src/server.ts Normal file
View file

@ -0,0 +1,3 @@
import * as vscodeLang from 'vscode-languageserver'
import { exec } from 'child_process'

20
server/tsconfig.json Normal file
View file

@ -0,0 +1,20 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "esnext",
"outDir": "out",
"lib": [
"es6"
],
"sourceMap": true,
"rootDir": "src",
"strict": true,
"noUnusedLocals": true,
"noImplicitReturns": true,
},
"exclude": [
"node_modules",
".vscode-test",
"test"
]
}

1
server/tslint.json Symbolic link
View file

@ -0,0 +1 @@
/home/noah/TypeScript/vscode-mc-shader/client/tslint.json

View file

@ -1,27 +0,0 @@
import { spawn } from 'child_process'
//
export function runLinter(command: string, ...args: any[]) {
const child = spawn(command, ...args)
let stderr = ''
child.stderr.on('data', data => {
stderr += data
})
const promise = new Promise<string>((resolve, reject) => {
child.on('error', () => reject(new Error('fatal error ${stderr}')))
child.on('exit', (code, signal) => {
switch (code) {
case 0:
case 2:
resolve(stderr)
default:
reject(new Error('standard error ${signal} ${stderr}'))
}
})
})
return promise
}

View file

@ -1,39 +0,0 @@
import * as vscode from 'vscode'
import * as path from 'path'
import * as os from 'os'
import { regLinuxOutput } from './linter/glslProvider'
// glslangPath: Path to glslangValidator (assumed in PATH by default)
// workDir: the directory in which all the files should be, ending in /shaders
// tmpdir: the directory into which the symlinks are stored, should be the OS's temp dir
// isWin: are we on Windows?
export class Config {
public readonly minecraftPath: string
public readonly glslangPath: string
public readonly workDir: string
public readonly tmpdir: string
public readonly isWin: boolean
public readonly outputMatch: RegExp
constructor() {
const c = vscode.workspace.getConfiguration('mcglsl')
console.log('[MC-GLSL] glslangValidatorPath set to', c.get('glslangValidatorPath'))
console.log('[MC-GLSL] temp directory root set to', path.join(os.tmpdir(), vscode.workspace.name!, 'shaders'))
this.glslangPath = c.get('glslangValidatorPath') as string
this.minecraftPath = c.get('minecraftPath') as string
this.isWin = os.platform() === 'win32'
this.tmpdir = path.join(os.tmpdir(), vscode.workspace.name!, 'shaders')
this.outputMatch = regLinuxOutput
this.workDir = path.basename(vscode.workspace.rootPath!) === 'shaders' ?
vscode.workspace.rootPath! :
path.join(vscode.workspace.rootPath!, 'shaders')
}
public onChange(e: vscode.ConfigurationChangeEvent) {
if (e.affectsConfiguration('mcglsl')) {
console.log('[MC-GLSL] config changed')
Object.assign(this, new Config())
}
}
}

View file

@ -1,8 +0,0 @@
import * as vscode from 'vscode'
import GLSLProvider from './linter/glslProvider'
export function activate(context: vscode.ExtensionContext) {
vscode.languages.registerCodeActionsProvider('glsl', new GLSLProvider(context.subscriptions))
}
export function deactivate() {}

View file

@ -1,11 +0,0 @@
declare global {
interface String {
leftTrim: () => string
}
}
String.prototype.leftTrim = function(): string {
return this.replace(/^\s+/,'')
}
export {}

View file

@ -1,155 +0,0 @@
import * as vscode from 'vscode'
import * as shell from 'shelljs'
import * as path from 'path'
import { runLinter } from '../asyncSpawn'
import '../global'
import { Config } from '../config'
// These are used for symlinking as glslangValidator only accepts files in these formats
const extensions: { [id: string]: string } = {
'.fsh': 'frag',
'.vsh': 'vert',
'.gsh': 'geom',
'.glsl': 'frag',
}
// These will be used to filter out error messages that are irrelevant/incorrect for us
// Lot of testing needed to find all the ones that we need to match
const filters: RegExp[] = [
/(No code generated)/,
/(compilation terminated)/,
/\/\w*.(vert|frag)$/
]
const regInclude = /^(?: |\t)*(?:#include) "((?:\/[\S]+)+\.(?:glsl))"$/
export const regLinuxOutput = /^(WARNING|ERROR): ((?:\/[^/\n]*)+\/*):(\d+): ((?:'[\w\W]*'){1} :[\w ]+)/
export default class GLSLProvider implements vscode.CodeActionProvider {
private diagnosticCollection: vscode.DiagnosticCollection // where errors/warnings/hints are pushed to be displayed
private config: Config
private onTypeDisposable?: vscode.Disposable
constructor(subs: vscode.Disposable[]) {
this.diagnosticCollection = vscode.languages.createDiagnosticCollection()
subs.push(this)
this.config = new Config()
const c = vscode.workspace.getConfiguration('mcglsl')
if (c.get('lintOnType') as boolean) {
this.onTypeDisposable = vscode.workspace.onDidChangeTextDocument(this.docChange, this)
console.log('[MC-GLSL] linting while typing.')
} else {
if (this.onTypeDisposable) this.onTypeDisposable.dispose()
console.log('[MC-GLSL] not linting while typing.')
}
this.checkBinary()
vscode.workspace.onDidOpenTextDocument(this.lint, this)
vscode.workspace.onDidSaveTextDocument(this.lint, this)
vscode.workspace.onDidChangeConfiguration((e: vscode.ConfigurationChangeEvent) => {
this.config.onChange(e)
this.checkBinary()
}, this)
vscode.workspace.textDocuments.forEach(doc => this.lint(doc))
}
// Check if glslangValidator binary can be found
public checkBinary() {
if (shell.which(this.config.glslangPath) == null) {
const msg = '[MC-GLSL] glslangValidator not found. Please check that you\'ve given the right path.'
console.log(msg)
vscode.window.showErrorMessage(msg)
}
}
public dispose = () => this.diagnosticCollection.dispose()
// Maybe only lint when files are saved...hmmm
private docChange = (e: vscode.TextDocumentChangeEvent) => this.lint(e.document)
// Returns true if the string matches any of the regex
public matchesFilters = (s: string) => filters.some(reg => reg.test(s))
// Split output by line, remove empty lines and then remove all lines that match any of the regex
private filterMessages = (res: string) => res
.split('\n')
.filter(s => s.length > 1 && !this.matchesFilters(s))
.map(s => s.match(this.config.outputMatch))
.filter(match => match && match.length > 3)
// The big boi that does all the shtuff
private async lint(document: vscode.TextDocument) {
if (document.languageId !== 'glsl') return
const ext = extensions[path.extname(document.fileName)]
const root = '-I'
let res = ''
try {
res = await runLinter(this.config.glslangPath, ['-E', '-S', ext, document.uri.path])
} catch (e) {
console.error(e)
return
}
console.log(res)
const messageMatches = this.filterMessages(res) as RegExpMatchArray[]
console.log(messageMatches)
const diags: vscode.Diagnostic[] = []
messageMatches.forEach(match => {
const [type, lineString, message] = match!.slice(1)
const lineNum = parseInt(lineString)
const severity: vscode.DiagnosticSeverity = type !== 'ERROR:' ? vscode.DiagnosticSeverity.Warning : vscode.DiagnosticSeverity.Error
const range = this.calcRange(document, lineNum)
//if (diags.length > 0 && range.isEqual(diags[diags.length - 1].range) && regSyntaxError.test(message)) return
diags.push(new vscode.Diagnostic(range, '[mc-glsl] ' + message, severity))
})
this.findIncludes(document).forEach(include => {
// path.join(this.config.workDir, match![1])
if (include.text.includes('../')) {
const trimmed = include.text.leftTrim()
const offset = include.text.length - trimmed.length
const range = new vscode.Range(include.lineNumber, offset, include.lineNumber, offset + trimmed.length)
diags.push(new vscode.Diagnostic(range, '[mc-glsl] includes with .. directory movement will fail in zipped shaders.', vscode.DiagnosticSeverity.Warning))
}
})
this.diagnosticCollection.set(document.uri, diags)
}
// Finds all lines that contain #include
private findIncludes = (document: vscode.TextDocument) => this.filter(document, line => regInclude.test(line.text))
private filter(document: vscode.TextDocument, f: (s: vscode.TextLine) => boolean): vscode.TextLine[] {
const out: vscode.TextLine[] = []
for (let i = 0; i < document.lineCount; i++) {
if (f(document.lineAt(i))) out.push(document.lineAt(i))
}
return out
}
// Calculates the start and end character positions to underline
private calcRange(document: vscode.TextDocument, lineNum: number): vscode.Range {
const line = document.lineAt(lineNum - 1).text
const trimmed = line.leftTrim()
return new vscode.Range(lineNum - 1, line.length - trimmed.length, lineNum - 1, line.length - 1)
}
public provideCodeActions(document: vscode.TextDocument,
range: vscode.Range,
context: vscode.CodeActionContext,
token: vscode.CancellationToken): vscode.ProviderResult<vscode.Command[]> {
throw new Error('Method not implemented.');
}
}

View file

@ -1,3 +0,0 @@
suite('Extension Tests', () => {
});

View file

@ -1,22 +0,0 @@
//
// PLEASE DO NOT MODIFY / DELETE UNLESS YOU KNOW WHAT YOU ARE DOING
//
// This file is providing the test runner to use when running extension tests.
// By default the test runner in use is Mocha based.
//
// You can provide your own test runner if you want to override it by exporting
// a function run(testRoot: string, clb: (error:Error) => void) that the extension
// host can call to run the tests. The test runner is expected to use console.log
// to report the results back to the caller. When the tests are finished, return
// a possible error to the callback or null if none.
import * as testRunner from 'vscode/lib/testrunner';
// You can directly control Mocha options by uncommenting the following lines
// See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options for more info
testRunner.configure({
ui: 'tdd', // the TDD UI is being used in extension.test.ts (suite, test, etc.)
useColors: true // colored output from test results
});
module.exports = testRunner;