diff --git a/apps/lsp/src/quarto.ts b/apps/lsp/src/quarto.ts index e0a33460..2062de3a 100644 --- a/apps/lsp/src/quarto.ts +++ b/apps/lsp/src/quarto.ts @@ -50,7 +50,9 @@ export async function initializeQuarto(context: QuartoContext): Promise getAttrCompletions: initializeAttrCompletionProvider( context.resourcePath ), - getYamlDiagnostics: quartoModule.getLint, + // the external getLint() resolves to null when linting fails + getYamlDiagnostics: async (context) => + (await quartoModule.getLint(context)) ?? [], getHover: quartoModule.getHover }; @@ -168,7 +170,7 @@ function normalizedValue(value: string, simpleDiv: boolean) { interface QuartoYamlModule { getCompletions(context: EditorContext): Promise; - getLint(context: EditorContext): Promise>; + getLint(context: EditorContext): Promise | null>; getHover?: (context: EditorContext) => Promise; } diff --git a/apps/vscode/CHANGELOG.md b/apps/vscode/CHANGELOG.md index 26712380..e7da458c 100644 --- a/apps/vscode/CHANGELOG.md +++ b/apps/vscode/CHANGELOG.md @@ -5,6 +5,7 @@ - In Positron, running a Python cell in a knitr document now respects the `quarto.cells.useReticulate` setting, instead of always routing it through reticulate on the R console (). - In Positron, when Positron serves language features for code cells itself (the `quarto.embeddedLanguageFeatures.native` setting), the extension no longer serves them from virtual document temp files (). - In Positron, fixed how the "Render on Save" checkbox works in the visual editor (). +- Fixed a crash of the Quarto language server on save when a code cell contained unparseable YAML options (e.g. an unquoted `fig-cap` value containing a colon) (). ## 1.137.0 (Release on 2026-09-04)