diff --git a/media/main.js b/media/main.js index b102c44..c5a5814 100644 --- a/media/main.js +++ b/media/main.js @@ -3,8 +3,6 @@ (function () { const vscode = acquireVsCodeApi(); - const oldState = vscode.getState(); - // Handle messages sent from the extension to the webview window.addEventListener('message', event => { const message = event.data; // The json data that the extension sent @@ -17,9 +15,6 @@ case 'clear': clear(); break; - case 'watcher': - update_watcher_state(message.status); - break; case 'progress': if (message.state == 'on') $('#loader').addClass('is-active'); @@ -1341,21 +1336,6 @@ class="has-tooltip-arrow has-tooltip-bottom" data-tooltip="${attempt_loc_file} ( return `
${text}
` } -// ///////////////////////////////////////////////////////////////////////////// -// -// ///////////////////////////////////////////////////////////////////////////// - - function update_watcher_state(status) { - - if(status == 'off') { - $("#watcher_state").removeClass("mdi-eye"); - $("#watcher_state").addClass("mdi-eye-off"); - } else { - $("#watcher_state").removeClass("mdi-eye-off"); - $("#watcher_state").addClass("mdi-eye"); - } - } - // ///////////////////////////////////////////////////////////////////////////// function clear() { diff --git a/package-lock.json b/package-lock.json index 06b37f2..3483f93 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,6 @@ "bulma-pageloader": "^0.3.0", "bulma-quickview": "^2.0.0", "bulma-tooltip": "^3.0.2", - "chokidar": "^3.5.3", "fuzzball": "^2.1.2", "jquery": "^3.6.1", "vue": "^2.7.0" @@ -27,7 +26,6 @@ "@typescript-eslint/eslint-plugin": "^5.19.0", "@typescript-eslint/parser": "^5.19.0", "@vscode/vsce": "^2.19.0", - "child-process": "^1.0.2", "eslint": "^8.13.0", "mustache": "^4.0.1", "typescript": "^4.6.3" @@ -512,18 +510,6 @@ "node": ">=4" } }, - "node_modules/anymatch": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", - "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", - "dependencies": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - }, - "engines": { - "node": ">= 8" - } - }, "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", @@ -576,14 +562,6 @@ ], "optional": true }, - "node_modules/binary-extensions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", - "engines": { - "node": ">=8" - } - }, "node_modules/bl": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", @@ -616,6 +594,7 @@ "version": "3.0.3", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, "dependencies": { "fill-range": "^7.1.1" }, @@ -756,38 +735,6 @@ "url": "https://github.com/sponsors/fb55" } }, - "node_modules/child-process": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/child-process/-/child-process-1.0.2.tgz", - "integrity": "sha512-e45+JmjvkV2XQsJ9rUJghiYJ7/9Uk8fyYi1UwfP071VmGKBu/oD1OIwuD0+jSwjMtQkV0a0FVpPTEW+XGlbSdw==", - "dev": true - }, - "node_modules/chokidar": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", - "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", - "funding": [ - { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - ], - "dependencies": { - "anymatch": "~3.1.2", - "braces": "~3.0.2", - "glob-parent": "~5.1.2", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" - }, - "engines": { - "node": ">= 8.10.0" - }, - "optionalDependencies": { - "fsevents": "~2.3.2" - } - }, "node_modules/chownr": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", @@ -1418,6 +1365,7 @@ "version": "7.1.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, "dependencies": { "to-regex-range": "^5.0.1" }, @@ -1473,19 +1421,6 @@ "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "dev": true }, - "node_modules/fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, "node_modules/function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", @@ -1548,6 +1483,7 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, "dependencies": { "is-glob": "^4.0.1" }, @@ -1743,21 +1679,11 @@ "dev": true, "optional": true }, - "node_modules/is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dependencies": { - "binary-extensions": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -1766,6 +1692,7 @@ "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, "dependencies": { "is-extglob": "^2.1.1" }, @@ -1777,6 +1704,7 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, "engines": { "node": ">=0.12.0" } @@ -2101,14 +2029,6 @@ "dev": true, "optional": true }, - "node_modules/normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/nth-check": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", @@ -2292,6 +2212,7 @@ "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, "engines": { "node": ">=8.6" }, @@ -2485,17 +2406,6 @@ "node": ">= 6" } }, - "node_modules/readdirp": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", - "dependencies": { - "picomatch": "^2.2.1" - }, - "engines": { - "node": ">=8.10.0" - } - }, "node_modules/regexpp": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", @@ -2827,6 +2737,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, "dependencies": { "is-number": "^7.0.0" }, @@ -3379,15 +3290,6 @@ "color-convert": "^1.9.0" } }, - "anymatch": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", - "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", - "requires": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - } - }, "argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", @@ -3423,11 +3325,6 @@ "dev": true, "optional": true }, - "binary-extensions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==" - }, "bl": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", @@ -3460,6 +3357,7 @@ "version": "3.0.3", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, "requires": { "fill-range": "^7.1.1" } @@ -3562,27 +3460,6 @@ "domutils": "^3.0.1" } }, - "child-process": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/child-process/-/child-process-1.0.2.tgz", - "integrity": "sha512-e45+JmjvkV2XQsJ9rUJghiYJ7/9Uk8fyYi1UwfP071VmGKBu/oD1OIwuD0+jSwjMtQkV0a0FVpPTEW+XGlbSdw==", - "dev": true - }, - "chokidar": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", - "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", - "requires": { - "anymatch": "~3.1.2", - "braces": "~3.0.2", - "fsevents": "~2.3.2", - "glob-parent": "~5.1.2", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" - } - }, "chownr": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", @@ -4057,6 +3934,7 @@ "version": "7.1.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, "requires": { "to-regex-range": "^5.0.1" } @@ -4100,12 +3978,6 @@ "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "dev": true }, - "fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "optional": true - }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", @@ -4159,6 +4031,7 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, "requires": { "is-glob": "^4.0.1" } @@ -4291,23 +4164,17 @@ "dev": true, "optional": true }, - "is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "requires": { - "binary-extensions": "^2.0.0" - } - }, "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==" + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true }, "is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, "requires": { "is-extglob": "^2.1.1" } @@ -4315,7 +4182,8 @@ "is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true }, "is-path-inside": { "version": "3.0.3", @@ -4565,11 +4433,6 @@ "dev": true, "optional": true }, - "normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==" - }, "nth-check": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", @@ -4709,7 +4572,8 @@ "picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==" + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true }, "postcss": { "version": "8.4.49", @@ -4829,14 +4693,6 @@ "util-deprecate": "^1.0.1" } }, - "readdirp": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", - "requires": { - "picomatch": "^2.2.1" - } - }, "regexpp": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", @@ -5051,6 +4907,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, "requires": { "is-number": "^7.0.0" } diff --git a/package.json b/package.json index cd47d1f..ce7e378 100644 --- a/package.json +++ b/package.json @@ -27,9 +27,7 @@ "activationEvents": [ "onView:elpi.tracer", "onCommand:elpi.trace", - "onCommand:elpi.clear", - "onCommand:elpi.watch_start", - "onCommand:elpi.watch_stop" + "onCommand:elpi.clear" ], "main": "./out/extension.js", "contributes": { @@ -52,18 +50,6 @@ "title": "Trace", "icon": "$(debug-console)" }, - { - "command": "elpi.watch_start", - "category": "Elpi Tracer", - "title": "Start watching", - "icon": "$(debug-alt)" - }, - { - "command": "elpi.watch_stop", - "category": "Elpi Tracer", - "title": "Stop watching", - "icon": "$(stop)" - }, { "command": "elpi.clear", "category": "Elpi Tracer", @@ -132,16 +118,6 @@ "command": "elpi.clear", "group": "navigation@3", "when": "view == elpi.tracer" - }, - { - "command": "elpi.watch_start", - "group": "navigation@4", - "when": "view == elpi.tracer" - }, - { - "command": "elpi.watch_stop", - "group": "navigation@5", - "when": "view == elpi.tracer" } ] }, @@ -183,7 +159,6 @@ "@typescript-eslint/eslint-plugin": "^5.19.0", "@typescript-eslint/parser": "^5.19.0", "@vscode/vsce": "^2.19.0", - "child-process": "^1.0.2", "eslint": "^8.13.0", "mustache": "^4.0.1", "typescript": "^4.6.3" @@ -196,7 +171,6 @@ "bulma-pageloader": "^0.3.0", "bulma-quickview": "^2.0.0", "bulma-tooltip": "^3.0.2", - "chokidar": "^3.5.3", "fuzzball": "^2.1.2", "jquery": "^3.6.1", "vue": "^2.7.0" diff --git a/src/extension.ts b/src/extension.ts index 63ec7b9..42f3e59 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -14,7 +14,7 @@ export function activate(context: vscode.ExtensionContext) { vscode.commands.registerCommand('elpi.open', () => { tracer.open(); })); - + context.subscriptions.push( vscode.commands.registerCommand('elpi.save', () => { tracer.save(); @@ -25,16 +25,6 @@ export function activate(context: vscode.ExtensionContext) { tracer.trace(); })); - context.subscriptions.push( - vscode.commands.registerCommand('elpi.watch_start', () => { - tracer.watch_start(); - })); - - context.subscriptions.push( - vscode.commands.registerCommand('elpi.watch_stop', () => { - tracer.watch_stop(); - })); - context.subscriptions.push( vscode.commands.registerCommand('elpi.clear', () => { tracer.clear(); diff --git a/src/provider.ts b/src/provider.ts index f674a9d..ff4bc64 100644 --- a/src/provider.ts +++ b/src/provider.ts @@ -7,8 +7,6 @@ import os = require('node:os'); import cp = require('child_process'); import fs = require('fs'); -import chokidar = require('chokidar'); - type TraceParser = { readTrace: (x: any, context?: any) => any; }; @@ -46,9 +44,6 @@ export class TraceProvider implements vscode.WebviewViewProvider { private _target: string; private _target_raw: string; private _target_dir: string; - private _watcher: chokidar.FSWatcher | undefined; - private _watcher_target: string; - private _watcher_target_elaborated: string; private _channel: any = vscode.window.createOutputChannel('Elpi'); @@ -74,9 +69,6 @@ export class TraceProvider implements vscode.WebviewViewProvider { this._target = this._target_dir + "trace.json"; this._target_raw = this._target_dir + "trace.tmp.json"; - this._watcher_target = this._target_dir + "traced.tmp.json"; - this._watcher_target_elaborated = this._target_dir + "traced.json"; - if (os.platform().toString().toLowerCase() == "win32") this._cat = "type"; else @@ -264,87 +256,6 @@ export class TraceProvider implements vscode.WebviewViewProvider { }); } - public watch_start() { - - let message; - - this._watcher = chokidar.watch(this._watcher_target, { - persistent: true, - ignoreInitial: true - }); - - if (this._view) - this._view.webview.postMessage({ type: 'watcher', status: 'on' }); - - this._watcher.on('change', path => { - - let configuration = vscode.workspace.getConfiguration('elpi'); - - this._elpi = configuration.elpi.path; - this._elpi_trace_elaborator = configuration.elpi_trace_elaborator.path; - - if(!this.findFileOnPath(this._elpi)) { - vscode.window - .showInformationMessage(`Failed to find elpi`, 'Go to settings') - .then(action => { - if (action == 'Go to settings') - vscode.commands.executeCommand('workbench.action.openSettings', '@ext:gares.elpi-lang'); - }); - return; - } - - if(!this.findFileOnPath(this._elpi_trace_elaborator)) { - vscode.window - .showInformationMessage(`Failed to find elpi trace elaborator`, 'Go to settings') - .then(action => { - if (action == 'Go to settings') - vscode.commands.executeCommand('workbench.action.openSettings', '@ext:gares.elpi-lang'); - }); - return; - } - - message = `File ${path} has been changed`; - - vscode.window.showInformationMessage(message); - - this._channel.appendLine(message); - - this.exec("eval $(opam env) && cat " + this._watcher_target + " | " + this._elpi_trace_elaborator + " > " + this._watcher_target_elaborated); - - const trace = any_parser_readTrace(JSON.parse(fs.readFileSync(this._watcher_target_elaborated, 'utf8'))); - - this._source = this._watcher_target; - - if (this._view) - this._view.webview.postMessage({ type: 'trace', trace: trace, file: 'Watched' }); - }); - - message = "Me watch has started. Try me by touching " + this._watcher_target; - - vscode.window.showInformationMessage(message); - - this._channel.appendLine(message); - } - - public watch_stop() { - - if (this._watcher != undefined - && this._view != undefined) { - - this._watcher.close().then(() => { - - const message = "Me watch has ended."; - - vscode.window.showInformationMessage(message); - - this._channel.appendLine(message); - - if (this._view) - this._view.webview.postMessage({ type: 'watcher', status: 'off' }); - }); - } - } - public trace() { let configuration = vscode.workspace.getConfiguration('elpi'); @@ -517,14 +428,6 @@ return ` -
-
- - - -
-
-