diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 26a755c6f..2ca81df95 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -43,3 +43,13 @@ jobs: run: | Rscript -e "stopifnot(length(print(lintr::lint_dir('./R'))) == 0)" shell: bash + devreplay: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: "13.x" + - run: npm ci + - name: Run devreplay + run: ./node_modules/.bin/devreplay --dir ./src devreplay.json \ No newline at end of file diff --git a/.vscode/extentions.json b/.vscode/extentions.json index 43760d32a..8852e2f9e 100644 --- a/.vscode/extentions.json +++ b/.vscode/extentions.json @@ -1,6 +1,7 @@ { "recommendations": [ "dbaeumer.vscode-eslint", - "GrapeCity.gc-excelviewer" + "GrapeCity.gc-excelviewer", + "ikuyadeu.devreplay" ] } \ No newline at end of file diff --git a/devreplay.json b/devreplay.json new file mode 100644 index 000000000..3a0080de1 --- /dev/null +++ b/devreplay.json @@ -0,0 +1,78 @@ +[ + { + "condition": [ + "show(${1:column}, ${2:preservalFocus})" + ], + "consequent": [ + "show(${2:preservalFocus})" + ] + }, + { + "condition": [ + "editor.hide()" + ], + "consequent": [ + "workbench.action.closeActiveEditor()" + ] + }, + { + "condition": [ + "editor.show(${1:column})" + ], + "consequent": [ + "window.showTextDocument()" + ] + }, + { + "condition": [ + "MarkedString" + ], + "consequent": [ + "MarkdownString" + ] + }, + { + "condition": [ + "withScmProgress" + ], + "consequent": [ + "withProgress" + ] + }, + { + "condition": [ + "workspace.rootPath" + ], + "consequent": [ + "workspace.workspaceFolders![0].uri.path" + ] + }, + { + "condition": [ + "scm.inputBox" + ], + "consequent": [ + "SourceControl.inputBox" + ] + }, + { + "condition": [ + "$0 $1 = workspace.getConfiguration('$2');" + ], + "consequent": [ + "export function $1() {", + " return workspace.getConfiguration('$2');", + "}" + ], + "description": "It is fixed on https://github.com/Ikuyadeu/vscode-R/pull/301", + "severity": "Error" + }, + { + "condition": [ + "workspace.getConfiguration('$1').get" + ], + "consequent": [ + "config().get" + ] + } +] \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 0047d2be4..d856bf92d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -69,6 +69,12 @@ "integrity": "sha512-x26ur3dSXgv5AwKS0lNfbjpCakGIduWU1DU91Zz58ONRWrIKGunmZBNv4P7N+e27sJkiGDsw/3fT4AtsqQBrBA==", "dev": true }, + "@types/text-table": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@types/text-table/-/text-table-0.2.1.tgz", + "integrity": "sha512-dchbFCWfVgUSWEvhOkXGS7zjm+K7jCUvGrQkAHPk2Fmslfofp4HQTH2pqnQ3Pw5GPYv0zWa2AQjKtsfZThuemQ==", + "dev": true + }, "@types/vscode": { "version": "1.44.0", "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.44.0.tgz", @@ -872,6 +878,12 @@ "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", "dev": true }, + "builtin-modules": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.1.0.tgz", + "integrity": "sha512-k0KL0aWZuBt2lrxrcASWDfwOLMnodeQjodT/1SxEQAXsHANgo6ZC/VEaSEHCXt7aSTZ4/4H5LKa+tBXmW7Vtvw==", + "dev": true + }, "builtin-status-codes": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", @@ -1510,6 +1522,81 @@ "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=", "dev": true }, + "devreplay": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/devreplay/-/devreplay-1.3.6.tgz", + "integrity": "sha512-Air4DsugvxBPMnYabkd8eVBgKY/wh0MWydqPUfAwcht85fVcnkO2v10ifAfUguBKhveyOvITE+sEWCV0vHcoUw==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.8.3", + "@types/text-table": "^0.2.1", + "builtin-modules": "^3.1.0", + "chalk": "4.0.0", + "commander": "^5.1.0", + "text-table": "0.2.0", + "tslib": "^1.11.1", + "tsutils": "^3.17.1", + "unicode": "^12.1.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.0.0.tgz", + "integrity": "sha512-N9oWFcegS0sFr9oh1oz2d7Npos6vNoWW9HvtCg5N1KRFpUhaAhvTv5Y58g880fZaEYSNm3qDz8SU1UrGvp+n7A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "commander": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz", + "integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, "diff": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", @@ -5712,6 +5799,12 @@ "integrity": "sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w==", "dev": true }, + "unicode": { + "version": "12.1.0", + "resolved": "https://registry.npmjs.org/unicode/-/unicode-12.1.0.tgz", + "integrity": "sha512-Ty6+Ew21DiYTWLYtd05RF/X4c1ekOvOgANyHbBj0h3MaXpfaGr2Rdmc0hMFuGQLyPLb9cU4ArNxl0bTF5HSzXw==", + "dev": true + }, "union-value": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", diff --git a/package.json b/package.json index 859550873..580b52418 100644 --- a/package.json +++ b/package.json @@ -506,7 +506,8 @@ "typescript": "^3.8.3", "webpack": "^4.43.0", "webpack-cli": "^3.3.11", - "yamljs": "^0.3.0" + "yamljs": "^0.3.0", + "devreplay": "^1.3.6" }, "dependencies": { "bootstrap": "^4.4.1", diff --git a/src/session.ts b/src/session.ts index c0c8e3cc1..9681e17e7 100644 --- a/src/session.ts +++ b/src/session.ts @@ -330,7 +330,7 @@ async function getListHtml(webview: Webview, file: string) { } export async function showPlotHistory() { - if (config().get('sessionWatcher')) { + if (workspace.getConfiguration('r').get('sessionWatcher')) { if (plotDir === undefined) { window.showErrorMessage('No session is attached.'); } else {