Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: language typos throughout the codebase #650

Merged
merged 3 commits into from
Mar 5, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/vscode/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@

- 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>).
- Fix behavior in Positron when running a cell containing invalid/incomplete code (<https://github.com/quarto-dev/quarto/pull/664>).
- Fix `language` typos throughout the codebase (<https://github.com/quarto-dev/quarto/pull/650>)

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

2 changes: 1 addition & 1 deletion apps/vscode/src/lsp/client.ts
Original file line number Diff line number Diff line change
@@ -178,7 +178,7 @@ function embeddedCodeCompletionProvider(engine: MarkdownEngine) {
const vdoc = await virtualDoc(document, position, engine);

if (vdoc && !isWithinYamlComment(document, position)) {
// if there is a trigger character make sure the langauge supports it
// if there is a trigger character make sure the language supports it
const language = vdoc.language;
if (context.triggerCharacter) {
if (
2 changes: 1 addition & 1 deletion apps/vscode/src/providers/cell/commands.ts
Original file line number Diff line number Diff line change
@@ -521,7 +521,7 @@ class RunCellsBelowCommand extends RunCommand implements Command {
for (const blk of tokens.filter((token?: Token) => blockIsExecutable(this.host_, token)) as Array<TokenMath | TokenCodeBlock>) {
// skip if the cell is above or at the cursor
if (line < blk.range.start.line) {
// set langauge if needed
// set language if needed
const blockLanguage = languageNameFromBlock(blk);
if (!language) {
language = blockLanguage;
12 changes: 6 additions & 6 deletions apps/vscode/src/providers/option.ts
Original file line number Diff line number Diff line change
@@ -52,7 +52,7 @@ export function activateOptionEnterProvider(
);
if (block) {
const language = languageNameFromBlock(block);
// handle option enter for the this langauge if we can
// handle option enter for the this language if we can
const optionComment = languageOptionComment(language);
if (optionComment) {
handleOptionEnter(window.activeTextEditor, optionComment);
@@ -89,14 +89,14 @@ function handleOptionEnter(editor: TextEditor, comment: string) {
}
}

function languageOptionComment(langauge: string) {
function languageOptionComment(language: string) {
// some mappings
if (langauge === "ojs") {
langauge = "js";
if (language === "ojs") {
language = "js";
}

if (Object.keys(kLangCommentChars).includes(langauge)) {
return kLangCommentChars[langauge];
if (Object.keys(kLangCommentChars).includes(language)) {
return kLangCommentChars[language];
} else {
return undefined;
}
12 changes: 6 additions & 6 deletions apps/vscode/src/vdoc/languages.ts
Original file line number Diff line number Diff line change
@@ -28,17 +28,17 @@ export interface EmbeddedLanguage {
canFormatDocument?: boolean;
}

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

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

const kEmbededLanguages = [
// these langauges required creating a temp file
// these languages required creating a temp file
defineLanguage("python", {
inject: ["# type: ignore", "# flake8: noqa"],
emptyLine: "#",
@@ -77,7 +77,7 @@ const kEmbededLanguages = [
defineLanguage("java"),
defineLanguage("cpp"),
defineLanguage("go"),
// these langauges work w/ text document content provider
// these languages work w/ text document content provider
defineLanguage("html", { type: "content" }),
defineLanguage("css", { type: "content" }),
defineLanguage("javascript", { type: "content" }),
@@ -98,7 +98,7 @@ function defineLanguage(
options?: LanguageOptions
): EmbeddedLanguage {

// lookup langauge
// lookup language
const language = editorLanguage(id);
if (!language) {
throw new Error(`Unknown language ${id}`);