Skip to content

Commit c6fde97

Browse files
committed
Fix code
1 parent f78966f commit c6fde97

File tree

5 files changed

+21
-26
lines changed

5 files changed

+21
-26
lines changed

.vscodeignore

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ webpack.config.js
1919
.markdownlint.json
2020
.eslintignore
2121

22-
# node_modules #withWebpack
23-
# out/ #withWebpack
22+
node_modules
23+
out/
2424

25-
# withoutWebpack:
26-
dist
27-
# /withoutWebpack

package.json

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"onCommand:r.runSelectionInActiveTerm",
3434
"onWebviewPanel:rhelp"
3535
],
36-
"main": "./out/extension",
36+
"main": "./dist/extension",
3737
"contributes": {
3838
"terminal": {
3939
"profiles": [
@@ -1437,7 +1437,7 @@
14371437
"default": [],
14381438
"markdownDescription": "Additional library paths to launch R background processes (R languageserver, help server, etc.). These paths will be appended to `.libPaths()` on process startup. It could be useful for projects with [renv](https://rstudio.github.io/renv/index.html) enabled."
14391439
},
1440-
"r.useRenvLibPath" : {
1440+
"r.useRenvLibPath": {
14411441
"type": "boolean",
14421442
"default": false,
14431443
"markdownDescription": "Use renv library paths to launch R background processes (R languageserver, help server, etc.)."
@@ -2076,28 +2076,15 @@
20762076
]
20772077
},
20782078
"scripts": {
2079-
"vscode:prepublish": "tsc -p . && tsc -p ./html/help && tsc -p ./html/httpgd",
2080-
"compile": "tsc -p . && tsc -p ./html/help && tsc -p ./html/httpgd",
2081-
"watch": "tsc -p . --watch",
2079+
"vscode:prepublish": "tsc -p ./html/help && tsc -p ./html/httpgd && webpack --mode production",
2080+
"compile": "tsc -p ./html/help && tsc -p ./html/httpgd && webpack --mode none",
2081+
"watch": "webpack --mode none --watch",
20822082
"watchHelp": "tsc -p ./html/help --watch",
20832083
"watchHttpgd": "tsc -p ./html/httpgd --watch",
20842084
"pretest": "tsc -p ./",
20852085
"test": "node ./out/test/runTest.js",
20862086
"lint": "eslint src --ext ts"
20872087
},
2088-
"withWebpack": {
2089-
"scripts": {
2090-
"vscode:prepublish": "tsc -p ./html/help && tsc -p ./html/httpgd && webpack --mode production",
2091-
"compile": "tsc -p ./html/help && tsc -p ./html/httpgd && webpack --mode none",
2092-
"watch": "webpack --mode none --watch",
2093-
"watchHelp": "tsc -p ./html/help --watch",
2094-
"watchHttpgd": "tsc -p ./html/httpgd --watch",
2095-
"pretest": "tsc -p ./",
2096-
"test": "node ./out/test/runTest.js",
2097-
"lint": "eslint src --ext ts"
2098-
},
2099-
"main": "./dist/extension"
2100-
},
21012088
"devDependencies": {
21022089
"@types/cheerio": "^0.22.29",
21032090
"@types/ejs": "^3.0.6",
@@ -2126,6 +2113,7 @@
21262113
"webpack-cli": "^4.7.2"
21272114
},
21282115
"dependencies": {
2116+
"@types/highlight.js": "^10.1.0",
21292117
"ag-grid-community": "^31.3.2",
21302118
"cheerio": "1.0.0-rc.12",
21312119
"crypto": "^1.0.1",

src/helpViewer/helpPreviewer.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,14 +146,17 @@ export class RLocalHelpPreviewer {
146146
this.cachedPackageInfo = undefined;
147147
this.callPreviewListener();
148148
};
149-
const manDirListener: fs.WatchListener<string> = (event: fs.WatchEventType, filename: string) => {
149+
const manDirListener: fs.WatchListener<string | null> = (event: fs.WatchEventType, filename: string | null) => {
150150
if(this.isDisposed){
151151
return;
152152
}
153153
if(!isDirSafe(this.manDir)){
154154
this.dispose(true);
155155
return;
156156
}
157+
if (filename === null) {
158+
return;
159+
}
157160
const fullPath = path.join(this.manDir, filename);
158161
// The cache is only initialized when it is needed for the first time:
159162
if(this.cachedRdAliases){

src/helpViewer/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,7 @@ function pimpMyHelp(helpFile: HelpFile): HelpFile {
730730

731731
// apply syntax highlighting to each code section:
732732
codeSections.each((i, section) => {
733-
const styledCode = hljs.highlight($(section).text() || '', {
733+
const styledCode = hljs.default.highlight($(section).text() || '', {
734734
language: 'r',
735735
});
736736
$(section).html(styledCode.value);

yarn.lock

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,13 @@
266266
"@types/minimatch" "*"
267267
"@types/node" "*"
268268

269+
"@types/highlight.js@^10.1.0":
270+
version "10.1.0"
271+
resolved "https://registry.yarnpkg.com/@types/highlight.js/-/highlight.js-10.1.0.tgz#89bb0c202997d7a90a07bd2ec1f7d00c56bb90b4"
272+
integrity sha512-77hF2dGBsOgnvZll1vymYiNUtqJ8cJfXPD6GG/2M0aLRc29PkvB7Au6sIDjIEFcSICBhCh2+Pyq6WSRS7LUm6A==
273+
dependencies:
274+
highlight.js "*"
275+
269276
"@types/js-yaml@^4.0.2":
270277
version "4.0.3"
271278
resolved "https://registry.npmjs.org/@types/js-yaml/-/js-yaml-4.0.3.tgz"
@@ -1665,7 +1672,7 @@ [email protected]:
16651672
resolved "https://registry.npmjs.org/he/-/he-1.2.0.tgz"
16661673
integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==
16671674

1668-
highlight.js@^11.9.0:
1675+
highlight.js@*, highlight.js@^11.9.0:
16691676
version "11.9.0"
16701677
resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-11.9.0.tgz#04ab9ee43b52a41a047432c8103e2158a1b8b5b0"
16711678
integrity sha512-fJ7cW7fQGCYAkgv4CPfwFHrfd/cLS4Hau96JuJ+ZTOWhjnhoeN1ub1tFmALm/+lW5z4WCAuAV9bm05AP0mS6Gw==

0 commit comments

Comments
 (0)