Skip to content

Commit 056afff

Browse files
authored
fix: language typos throughout the codebase (#650)
* fix: `langauge` typo * chore: add changelog entry
1 parent 1375251 commit 056afff

File tree

5 files changed

+15
-14
lines changed

5 files changed

+15
-14
lines changed

apps/vscode/CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
- Use `QUARTO_VISUAL_EDITOR_CONFIRMED` > `PW_TEST` > `CI` to bypass (`true`) or force (`false`) the Visual Editor confirmation dialogue (<https://github.com/quarto-dev/quarto/pull/654>).
66
- Fix behavior in Positron when running a cell containing invalid/incomplete code (<https://github.com/quarto-dev/quarto/pull/664>).
7+
- Fix `language` typos throughout the codebase (<https://github.com/quarto-dev/quarto/pull/650>)
78

89
## 1.118.0 (Release on 2024-11-26)
910

apps/vscode/src/lsp/client.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ function embeddedCodeCompletionProvider(engine: MarkdownEngine) {
178178
const vdoc = await virtualDoc(document, position, engine);
179179

180180
if (vdoc && !isWithinYamlComment(document, position)) {
181-
// if there is a trigger character make sure the langauge supports it
181+
// if there is a trigger character make sure the language supports it
182182
const language = vdoc.language;
183183
if (context.triggerCharacter) {
184184
if (

apps/vscode/src/providers/cell/commands.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ class RunCellsBelowCommand extends RunCommand implements Command {
521521
for (const blk of tokens.filter((token?: Token) => blockIsExecutable(this.host_, token)) as Array<TokenMath | TokenCodeBlock>) {
522522
// skip if the cell is above or at the cursor
523523
if (line < blk.range.start.line) {
524-
// set langauge if needed
524+
// set language if needed
525525
const blockLanguage = languageNameFromBlock(blk);
526526
if (!language) {
527527
language = blockLanguage;

apps/vscode/src/providers/option.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export function activateOptionEnterProvider(
5252
);
5353
if (block) {
5454
const language = languageNameFromBlock(block);
55-
// handle option enter for the this langauge if we can
55+
// handle option enter for the this language if we can
5656
const optionComment = languageOptionComment(language);
5757
if (optionComment) {
5858
handleOptionEnter(window.activeTextEditor, optionComment);
@@ -89,14 +89,14 @@ function handleOptionEnter(editor: TextEditor, comment: string) {
8989
}
9090
}
9191

92-
function languageOptionComment(langauge: string) {
92+
function languageOptionComment(language: string) {
9393
// some mappings
94-
if (langauge === "ojs") {
95-
langauge = "js";
94+
if (language === "ojs") {
95+
language = "js";
9696
}
9797

98-
if (Object.keys(kLangCommentChars).includes(langauge)) {
99-
return kLangCommentChars[langauge];
98+
if (Object.keys(kLangCommentChars).includes(language)) {
99+
return kLangCommentChars[language];
100100
} else {
101101
return undefined;
102102
}

apps/vscode/src/vdoc/languages.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,17 @@ export interface EmbeddedLanguage {
2828
canFormatDocument?: boolean;
2929
}
3030

31-
export function embeddedLanguage(langauge: string) {
32-
langauge = langauge.split("-").pop() || "";
33-
return kEmbededLanguages.find((lang) => lang.ids.includes(langauge));
31+
export function embeddedLanguage(language: string) {
32+
language = language.split("-").pop() || "";
33+
return kEmbededLanguages.find((lang) => lang.ids.includes(language));
3434
}
3535

3636
export function languageCanFormatDocument(language: EmbeddedLanguage) {
3737
return language.canFormatDocument !== false;
3838
}
3939

4040
const kEmbededLanguages = [
41-
// these langauges required creating a temp file
41+
// these languages required creating a temp file
4242
defineLanguage("python", {
4343
inject: ["# type: ignore", "# flake8: noqa"],
4444
emptyLine: "#",
@@ -77,7 +77,7 @@ const kEmbededLanguages = [
7777
defineLanguage("java"),
7878
defineLanguage("cpp"),
7979
defineLanguage("go"),
80-
// these langauges work w/ text document content provider
80+
// these languages work w/ text document content provider
8181
defineLanguage("html", { type: "content" }),
8282
defineLanguage("css", { type: "content" }),
8383
defineLanguage("javascript", { type: "content" }),
@@ -98,7 +98,7 @@ function defineLanguage(
9898
options?: LanguageOptions
9999
): EmbeddedLanguage {
100100

101-
// lookup langauge
101+
// lookup language
102102
const language = editorLanguage(id);
103103
if (!language) {
104104
throw new Error(`Unknown language ${id}`);

0 commit comments

Comments
 (0)