diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2107ee87b..cb26609ee 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -72,13 +72,3 @@ jobs: shell: Rscript {0} env: LINTR_ERROR_ON_LINT: true - devreplay: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: 18 - - run: npm install - - name: Run devreplay - run: ./node_modules/.bin/devreplay ./src devreplay.json diff --git a/.vscode/launch.json b/.vscode/launch.json index 843bfd69d..977a98811 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -15,7 +15,6 @@ "outFiles": [ "${workspaceFolder}/out/src/**/*.js" ], - "preLaunchTask": "watchAll" }, { "name": "Launch Extension (--disable-extensions)", @@ -29,7 +28,6 @@ "outFiles": [ "${workspaceFolder}/out/src/**/*.js" ], - "preLaunchTask": "watchAll" }, { "name": "Extension Tests", diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 477118275..5abf195ae 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -32,7 +32,7 @@ }, { "type": "npm", - "script": "compile", + "script": "build", "problemMatcher": "$tsc" }, { diff --git a/.vscodeignore b/.vscodeignore index 8681f02ad..6dc2550d8 100644 --- a/.vscodeignore +++ b/.vscodeignore @@ -7,7 +7,6 @@ .xls .xlsx **/*.map -devreplay.json html/**/*.ts out/test/** src/ diff --git a/devreplay.json b/devreplay.json deleted file mode 100644 index 849fde5fa..000000000 --- a/devreplay.json +++ /dev/null @@ -1,94 +0,0 @@ -[ - { - "before": [ - "assert.equal" - ], - "after": [ - "assert.strictEqual" - ] - }, - { - "before": [ - "show(${1:column}, ${2:preservalFocus})" - ], - "after": [ - "show(${2:preservalFocus})" - ] - }, - { - "before": [ - "editor.hide()" - ], - "after": [ - "workbench.action.closeActiveEditor()" - ] - }, - { - "before": [ - "editor.show(${1:column})" - ], - "after": [ - "window.showTextDocument()" - ] - }, - { - "before": [ - "MarkedString" - ], - "after": [ - "MarkdownString" - ] - }, - { - "before": [ - "withScmProgress" - ], - "after": [ - "withProgress" - ] - }, - { - "before": [ - "workspace.rootPath" - ], - "after": [ - "workspace.workspaceFolders![0].uri.path" - ] - }, - { - "before": [ - "scm.inputBox" - ], - "after": [ - "SourceControl.inputBox" - ] - }, - { - "before": [ - "$0 $1 = workspace.getConfiguration('$2');" - ], - "after": [ - "export function $1() {", - " return workspace.getConfiguration('$2');", - "}" - ], - "description": "It is fixed on https://github.com/REditorSupport/vscode-R/pull/301", - "severity": "Error" - }, - { - "before": [ - "workspace.getConfiguration('$1').get" - ], - "after": [ - "config().get" - ] - }, - { - "before": [ - "delay(8)" - ], - "after": [ - "delay(rtermSendDelay)" - ] - } -] diff --git a/language/dcf-configuration.json b/language-configuration/dcf.json similarity index 100% rename from language/dcf-configuration.json rename to language-configuration/dcf.json diff --git a/language/rbuildignore-configuration.json b/language-configuration/rbuildignore.json similarity index 100% rename from language/rbuildignore-configuration.json rename to language-configuration/rbuildignore.json diff --git a/language/rd-configuration.json b/language-configuration/rd.json similarity index 100% rename from language/rd-configuration.json rename to language-configuration/rd.json diff --git a/language/r-configuration.json b/language-configuration/rnamespace.json similarity index 100% rename from language/r-configuration.json rename to language-configuration/rnamespace.json diff --git a/language/rmd-configuration.json b/language/rmd-configuration.json deleted file mode 100644 index efd1d9ae3..000000000 --- a/language/rmd-configuration.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "comments": { - "blockComment": [ "" ] - }, - "brackets": [ - [ "" ], - ["{", "}"], - ["[", "]"], - ["(", ")"] - ], - "autoClosingPairs": [ - ["{", "}"], - ["[", "]"], - ["(", ")"], - ["\"", "\""], - ["'", "'"] - ], - "surroundingPairs": [ - ["{", "}"], - ["[", "]"], - ["(", ")"], - ["\"", "\""], - ["'", "'"], - ["`", "`"], - ["$", "$"] - ] -} \ No newline at end of file diff --git a/language/rnamespace-configuration.json b/language/rnamespace-configuration.json deleted file mode 100644 index de5fe4b0b..000000000 --- a/language/rnamespace-configuration.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "comments": { - "lineComment": "#" - }, - "brackets": [ - ["{", "}"], - ["[", "]"], - ["(", ")"] - ], - "autoClosingPairs": [ - ["#'", ""], - ["{", "}"], - ["[", "]"], - ["(", ")"], - ["\"", "\""], - ["'", "'"], - ["`", "`"] - ], - "surroundingPairs": [ - ["{", "}"], - ["[", "]"], - ["(", ")"], - ["\"", "\""], - ["'", "'"], - ["`", "`"] - ], - "folding": { - "markers": { - "start": "^\\s*#region", - "end": "^\\s*#endregion" - } - } -} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 47e724ad6..dc0aa9641 100644 --- a/package-lock.json +++ b/package-lock.json @@ -42,7 +42,6 @@ "@typescript-eslint/parser": "^5.30.0", "@vscode/test-electron": "^2.2.3", "copy-webpack-plugin": "^9.0.0", - "devreplay": "^1.9.31", "eslint": "^7.28.0", "eslint-plugin-jsdoc": "^35.1.3", "mocha": "^11.1.0", @@ -56,21 +55,6 @@ "vscode": "^1.75.0" } }, - "node_modules/@babel/code-frame": { - "version": "7.26.2", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz", - "integrity": "sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-validator-identifier": "^7.25.9", - "js-tokens": "^4.0.0", - "picocolors": "^1.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, "node_modules/@babel/helper-validator-identifier": { "version": "7.25.9", "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", @@ -1853,16 +1837,6 @@ "node": ">= 0.8" } }, - "node_modules/commander": { - "version": "9.5.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz", - "integrity": "sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^12.20.0 || >=14" - } - }, "node_modules/comment-parser": { "version": "1.1.6-beta.0", "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.1.6-beta.0.tgz", @@ -2018,29 +1992,6 @@ "node": ">=0.4.0" } }, - "node_modules/devreplay": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/devreplay/-/devreplay-1.12.0.tgz", - "integrity": "sha512-Ezk3SSU7sm6E/QknXx6j+1HfxA+d6R2CoioYYOWIOGEXYm+Ddl8eIPiBaodJQuTIp44mbds9VDldhMGjHq+XMQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/code-frame": "^7.18.6", - "chalk": "4.1.2", - "commander": "^9.3.0", - "diff": "5.1.0", - "lodash": "^4.17.21", - "text-table": "^0.2.0", - "tslib": "^2.4.0", - "v8-compile-cache": "^2.3.0" - }, - "bin": { - "devreplay": "bin/devreplay" - }, - "engines": { - "node": ">=12.0.0" - } - }, "node_modules/diff": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/diff/-/diff-5.1.0.tgz", @@ -5472,13 +5423,6 @@ "webpack": "^5.0.0" } }, - "node_modules/tslib": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", - "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", - "dev": true, - "license": "0BSD" - }, "node_modules/tsutils": { "version": "3.21.0", "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", diff --git a/package.json b/package.json index 9fa5dd896..2ec2f28b9 100644 --- a/package.json +++ b/package.json @@ -100,21 +100,6 @@ } ], "languages": [ - { - "id": "r", - "extensions": [ - ".r", - ".rhistory", - ".rprofile", - ".rt" - ], - "aliases": [ - "R", - "r" - ], - "firstLine": "^#!/.*\\bRscript\\b", - "configuration": "./language/r-configuration.json" - }, { "id": "rd", "extensions": [ @@ -124,18 +109,7 @@ "R documentation", "r documentation" ], - "configuration": "./language/rd-configuration.json" - }, - { - "id": "rmd", - "extensions": [ - ".rmd" - ], - "aliases": [ - "R Markdown", - "r markdown" - ], - "configuration": "./language/rmd-configuration.json" + "configuration": "./language-configuration/rd.json" }, { "id": "debian-control.r", @@ -149,7 +123,7 @@ "DESCRIPTION", ".lintr" ], - "configuration": "./language/dcf-configuration.json" + "configuration": "./language-configuration/dcf.json" }, { "id": "namespace.r", @@ -159,7 +133,7 @@ "filenames": [ "NAMESPACE" ], - "configuration": "./language/rnamespace-configuration.json" + "configuration": "./language-configuration/rnamespace.json" }, { "id": "buildignore.r", @@ -169,7 +143,7 @@ "filenames": [ ".Rbuildignore" ], - "configuration": "./language/rbuildignore-configuration.json" + "configuration": "./language-configuration/rbuildignore.json" } ], "snippets": [ @@ -187,89 +161,21 @@ } ], "grammars": [ - { - "language": "r", - "scopeName": "source.r", - "path": "./syntax/r.json" - }, { "language": "rd", "scopeName": "text.tex.latex.rd", - "path": "./syntax/Rd (R Documentation).json" + "path": "./syntaxes/rd.json" }, { "language": "debian-control.r", "scopeName": "debian-control.r", - "path": "./syntax/dcf.json", + "path": "./syntaxes/dcf.json", "embeddedLanguages": { "meta.embedded.block.r": "r" } }, { - "language": "rmd", - "scopeName": "text.html.rmarkdown", - "path": "./syntax/RMarkdown.json", - "embeddedLanguages": { - "meta.embedded.block.html": "html", - "source.js": "javascript", - "source.css": "css", - "meta.embedded.block.frontmatter": "yaml", - "meta.embedded.block.css": "css", - "meta.embedded.block.ini": "ini", - "meta.embedded.block.java": "java", - "meta.embedded.block.lua": "lua", - "meta.embedded.block.makefile": "makefile", - "meta.embedded.block.perl": "perl", - "meta.embedded.block.r": "r", - "meta.embedded.block.ruby": "ruby", - "meta.embedded.block.php": "php", - "meta.embedded.block.sql": "sql", - "meta.embedded.block.vs_net": "vs_net", - "meta.embedded.block.xml": "xml", - "meta.embedded.block.xsl": "xsl", - "meta.embedded.block.yaml": "yaml", - "meta.embedded.block.dosbatch": "dosbatch", - "meta.embedded.block.clojure": "clojure", - "meta.embedded.block.coffee": "coffee", - "meta.embedded.block.c": "c", - "meta.embedded.block.cpp": "cpp", - "meta.embedded.block.diff": "diff", - "meta.embedded.block.dockerfile": "dockerfile", - "meta.embedded.block.go": "go", - "meta.embedded.block.groovy": "groovy", - "meta.embedded.block.pug": "jade", - "meta.embedded.block.javascript": "javascript", - "meta.embedded.block.json": "json", - "meta.embedded.block.less": "less", - "meta.embedded.block.objc": "objc", - "meta.embedded.block.scss": "scss", - "meta.embedded.block.perl6": "perl6", - "meta.embedded.block.powershell": "powershell", - "meta.embedded.block.python": "python", - "meta.embedded.block.rust": "rust", - "meta.embedded.block.scala": "scala", - "meta.embedded.block.shellscript": "shellscript", - "meta.embedded.block.typescript": "typescript", - "meta.embedded.block.typescriptreact": "typescriptreact", - "meta.embedded.block.csharp": "csharp", - "meta.embedded.block.fsharp": "fsharp" - } - }, - { - "scopeName": "text.html.markdown.redcarpet", - "path": "./syntax/Markdown Redcarpet.json", - "injectTo": [ - "text.html.rmarkdown" - ], - "embeddedLanguages": { - "meta.embedded.block.c": "c", - "meta.embedded.block.cpp": "cpp", - "meta.embedded.block.r": "r", - "meta.embedded.block.yaml": "yaml" - } - }, - { - "path": "./syntax/Rcpp.json", + "path": "./syntaxes/Rcpp.json", "scopeName": "comment.block.r", "injectTo": [ "source.cpp" @@ -278,12 +184,12 @@ { "language": "namespace.r", "scopeName": "namespace.r", - "path": "./syntax/rnamespace.json" + "path": "./syntaxes/rnamespace.json" }, { "language": "buildignore.r", "scopeName": "buildignore.r", - "path": "./syntax/rbuildignore.json" + "path": "./syntaxes/rbuildignore.json" } ], "commands": [ @@ -2078,7 +1984,7 @@ }, "scripts": { "vscode:prepublish": "tsc -p ./html/help && tsc -p ./html/httpgd && webpack --mode production", - "compile": "tsc -p ./html/help && tsc -p ./html/httpgd && webpack --mode none", + "build": "tsc -p ./html/help && tsc -p ./html/httpgd && webpack --mode none", "watch": "webpack --mode none --watch", "watchHelp": "tsc -p ./html/help --watch", "watchHttpgd": "tsc -p ./html/httpgd --watch", @@ -2104,7 +2010,6 @@ "@typescript-eslint/parser": "^5.30.0", "@vscode/test-electron": "^2.2.3", "copy-webpack-plugin": "^9.0.0", - "devreplay": "^1.9.31", "eslint": "^7.28.0", "eslint-plugin-jsdoc": "^35.1.3", "mocha": "^11.1.0", diff --git a/src/test/suite/sesson.test.ts b/src/test/suite/sesson.test.ts index dd3a2edc1..a799daa34 100644 --- a/src/test/suite/sesson.test.ts +++ b/src/test/suite/sesson.test.ts @@ -9,7 +9,7 @@ import * as session from '../../session'; import * as workspace from '../../workspaceViewer'; const extension_root: string = path.join(__dirname, '..', '..', '..'); -const workspaceFile = path.join(extension_root, 'test', 'rFiles', 'session', 'workspace.json'); +const workspaceFile = path.join(extension_root, 'src', 'test', 'testdata', 'session', 'workspace.json'); function mockWorkspaceData(sandbox: sinon.SinonSandbox) { const content = fs.readFileSync(workspaceFile, 'utf8'); diff --git a/test/rFiles/session/workspace.json b/src/test/testdata/session/workspace.json similarity index 100% rename from test/rFiles/session/workspace.json rename to src/test/testdata/session/workspace.json diff --git a/syntax/Rcpp.json b/syntaxes/Rcpp.json similarity index 100% rename from syntax/Rcpp.json rename to syntaxes/Rcpp.json diff --git a/syntax/dcf.json b/syntaxes/dcf.json similarity index 100% rename from syntax/dcf.json rename to syntaxes/dcf.json diff --git a/syntax/rbuildignore.json b/syntaxes/rbuildignore.json similarity index 100% rename from syntax/rbuildignore.json rename to syntaxes/rbuildignore.json diff --git a/syntax/Rd (R Documentation).json b/syntaxes/rd.json similarity index 100% rename from syntax/Rd (R Documentation).json rename to syntaxes/rd.json diff --git a/syntax/rnamespace.json b/syntaxes/rnamespace.json similarity index 100% rename from syntax/rnamespace.json rename to syntaxes/rnamespace.json diff --git a/test/rFiles/rmarkdown/basic.rmd b/test/rFiles/rmarkdown/basic.rmd deleted file mode 100644 index fdae8b2d3..000000000 --- a/test/rFiles/rmarkdown/basic.rmd +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: Hello World ---- - -Hello world \ No newline at end of file