Skip to content

Commit c5f8f7f

Browse files
committed
updating references to "rlang" as a language to "r" to work better with VS Code's language server
1 parent e62c8e8 commit c5f8f7f

File tree

6 files changed

+7
-5
lines changed

6 files changed

+7
-5
lines changed

client/src/components/notebook/Controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export class NotebookController {
1111
readonly controllerId = "sas-notebook-controller-id";
1212
readonly notebookType = "sas-notebook";
1313
readonly label = "SAS Notebook";
14-
readonly supportedLanguages = ["sas", "sql", "python", "rlang"];
14+
readonly supportedLanguages = ["sas", "sql", "python", "r"];
1515

1616
private readonly _controller: vscode.NotebookController;
1717
private _executionOrder = 0;

client/src/components/notebook/exporters/toHTML.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import { includeLogInNotebookExport } from "../../utils/settings";
2828
const templatesDir = path.resolve(__dirname, "../notebook/exporters/templates");
2929

3030
hljs.registerLanguage("python", python);
31-
hljs.registerLanguage("rlang", r);
31+
hljs.registerLanguage("r", r);
3232
hljs.registerLanguage("sql", sql);
3333

3434
export const exportToHTML = async (

client/src/components/notebook/exporters/toSAS.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ const exportCell = (cell: NotebookCell) => {
1515
return text;
1616
case "python":
1717
return wrapPython(text);
18+
case "r":
19+
return wrapRlang(text);
1820
case "rlang":
1921
return wrapRlang(text);
2022
case "sql":

client/src/components/utils/SASCodeDocument.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ ${code}`;
206206
wrapped = this.wrapPython(wrapped);
207207
}
208208

209-
if (this.parameters.languageId === "rlang") {
209+
if (this.parameters.languageId === "r" || this.parameters.languageId === "rlang") {
210210
wrapped = this.wrapRlang(wrapped);
211211
}
212212

client/test/components/util/SASCodeDocument.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ run;
4040

4141
it("wrap rlang code", () => {
4242
const parameters: SASCodeDocumentParameters = {
43-
languageId: "rlang",
43+
languageId: "r",
4444
code: `for (x in 1:6) {
4545
print(x)
4646
}

client/testFixture/sasnb_export.sasnb

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)