From 66036c2e016a4b6bb468c21ca3e33d7d89a32c27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Canouil?= <8896044+mcanouil@users.noreply.github.com> Date: Mon, 5 Aug 2024 13:32:55 +0200 Subject: [PATCH 1/3] fix: update tm language with new markdown frontmatter specs Fixes #501 --- apps/vscode/syntaxes/quarto.tmLanguage.yaml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/apps/vscode/syntaxes/quarto.tmLanguage.yaml b/apps/vscode/syntaxes/quarto.tmLanguage.yaml index 446666f0..e6df7ef7 100644 --- a/apps/vscode/syntaxes/quarto.tmLanguage.yaml +++ b/apps/vscode/syntaxes/quarto.tmLanguage.yaml @@ -224,11 +224,20 @@ repository: ]{4}|\t)'} separator: {match: '(^|\G)[ ]{0,3}([\*\-\_])([ ]{0,2}\2){2,}[ \t]*$\n?', name: meta.separator.quarto} frontMatter: - begin: \A-{3}\s*$ - contentName: meta.embedded.block.frontmatter + begin: \A(?=(-{3,})) + end: ^ {,3}\1-*[ \t]*$|^[ \t]*\.{3}$ + applyEndPatternLast: 1 + endCaptures: + 0: {name: punctuation.definition.end.frontmatter} patterns: - - {include: source.yaml} - end: (^|\G)-{3}|\.{3}\s*$ + - begin: \A(-{3,})(.*)$ + while: ^(?! {,3}\1-*[ \t]*$|[ \t]*\.{3}$) + beginCaptures: + "1": {name: punctuation.definition.begin.frontmatter} + "2": {name: comment.frontmatter} + contentName: meta.embedded.block.frontmatter + patterns: + - {include: source.yaml} inline: patterns: - {include: '#ampersand'} From a4e088460bb1b21a36fa180ea09ca7f2f0b739ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Canouil?= <8896044+mcanouil@users.noreply.github.com> Date: Mon, 5 Aug 2024 15:25:55 +0200 Subject: [PATCH 2/3] fix: run `node apps/vscode/syntaxes/build-lang.js` --- apps/vscode/syntaxes/quarto.tmLanguage | 46 ++++++++++++++++++++++---- 1 file changed, 39 insertions(+), 7 deletions(-) diff --git a/apps/vscode/syntaxes/quarto.tmLanguage b/apps/vscode/syntaxes/quarto.tmLanguage index 87b14f3c..a5a9a842 100644 --- a/apps/vscode/syntaxes/quarto.tmLanguage +++ b/apps/vscode/syntaxes/quarto.tmLanguage @@ -4395,18 +4395,50 @@ frontMatter begin - \A-{3}\s*$ - contentName - meta.embedded.block.frontmatter + \A(?=(-{3,})) + end + ^ {,3}\1-*[ \t]*$|^[ \t]*\.{3}$ + applyEndPatternLast + 1 + endCaptures + + 0 + + name + punctuation.definition.end.frontmatter + + patterns - include - source.yaml + begin + \A(-{3,})(.*)$ + while + ^(?! {,3}\1-*[ \t]*$|[ \t]*\.{3}$) + beginCaptures + + 1 + + name + punctuation.definition.begin.frontmatter + + 2 + + name + comment.frontmatter + + + contentName + meta.embedded.block.frontmatter + patterns + + + include + source.yaml + + - end - (^|\G)-{3}|\.{3}\s*$ inline From 0f9daaa351cfe58c09ad2a8f9d3fa8fdf9c727be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Canouil?= <8896044+mcanouil@users.noreply.github.com> Date: Mon, 5 Aug 2024 20:19:57 +0200 Subject: [PATCH 3/3] chore: bump version and add changelog --- apps/vscode/CHANGELOG.md | 30 +++++++++++++++++------------- apps/vscode/package.json | 2 +- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/apps/vscode/CHANGELOG.md b/apps/vscode/CHANGELOG.md index 582c6c1f..801f4b49 100644 --- a/apps/vscode/CHANGELOG.md +++ b/apps/vscode/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 1.114.0 + +- Update front matter Markdown grammar specification (). + ## 1.111.0 (Release on 29 February 2024) - Use Preview icon on editor toolbar (text on toolbar no longer supported) @@ -45,7 +49,7 @@ ## 1.106.1 (Release on 29 October 2023) -- Visual Editor: Use line-height of 1.2 for headings +- Visual Editor: Use line-height of 1.2 for headings - Catch initialization errors that occur when probing for Python environments ## 1.106.0 (Release on 27 October 2023) @@ -82,7 +86,7 @@ - Default to rendering on save for server: shiny documents - Support server: shiny documents from .py percent scripts - Only prompt for installation of Lua extension when developing extensions -- Use longer terminal 5-second terminal delay only for conda (venv always activates quickly) +- Use longer terminal 5-second terminal delay only for conda (venv always activates quickly) - Restore rather than dispose of preview webview on reload ## 1.101.0 (Release on 28 September 2023) @@ -113,7 +117,7 @@ ## 1.96.0 (Release on 3 September 2023) -- Formatting: format only currently active cell +- Formatting: format only currently active cell - Syntax highlighting for embedded `typst` raw blocks - Revert to previous toggle comment behavior (single line) @@ -124,12 +128,12 @@ ## 1.95.0 (Release on 25 August 2023) - Jupyter: Run cell-by-cell only when there are cell magics (%%) present -- Jupyter: Verify that the ms-toolsai.jupyter extension is installed +- Jupyter: Verify that the ms-toolsai.jupyter extension is installed - Mark temporary .intellisense. files as plaintext so they are not auto-formatted - Use triple-dash for block and line comments - Visual Editor: Use correct selection text color in high contrast mode - Visual Editor: Workaround Pandoc 3.1.4 change in `--id-prefix` behavior -- Visual Editor: Remove it_IT spelling dictionary +- Visual Editor: Remove it_IT spelling dictionary ## 1.94.0 (Release on 17 August 2023) @@ -197,7 +201,7 @@ - Fix issue w/ parsing math blocks at the end of documents - Disable styler in R intellisense background document - Ensure that all files in the workspace are indexed when required -- Provide whatever features we can even if Quarto isn't installed +- Provide whatever features we can even if Quarto isn't installed ## 1.87.1 (Release on 31 May 2023) @@ -210,8 +214,8 @@ - Visual Editor: Support Cmd+Shift+V shortcut for pasting without formatting - Visual Editor: Render pasted markdown text rather than treating it literally - Language support (highlighting, completion, etc.) for embedded Matlab code cells -- Render All command to render and preview all specified formats -- Fix crash caused by improper initialization of LSP configuration +- Render All command to render and preview all specified formats +- Fix crash caused by improper initialization of LSP configuration - Fail gracefully when we are unable to read zotero key ## 1.86.2 (Release on 26 May 2023) @@ -266,8 +270,8 @@ ## 1.81.0 (Release on 14 April 2023) -- Configurable zoom behavior for HTML document preview -- Notebook markdown renderer for Pandoc/Quarto markdown extensions +- Configurable zoom behavior for HTML document preview +- Notebook markdown renderer for Pandoc/Quarto markdown extensions - Correct hover behavior for multiple equations on a single line ## 1.80.0 (Release on 09 April 2023) @@ -360,8 +364,8 @@ - Handle exceptions that occur when writing settings at startup - Correct indentation for multi-line YAML completions - Fix issue w/ handling visual mode untitled document warning -- Resolve issue w/ reading large bibliographies -- Allow dot ('.') in citation highlighting regex +- Resolve issue w/ reading large bibliographies +- Allow dot ('.') in citation highlighting regex - Derive `mathjax.theme` from name of `workbench.colorTheme` ## 1.67.0 (Release on 18 February 2023) @@ -371,7 +375,7 @@ - Change location of edit in visual/source context menu item - Use resource scoping for visual editor preferences - Resolve full path when setting QUARTO_PYTHON from Python extension config -- Don't offer LaTeX completions for `\\` +- Don't offer LaTeX completions for `\\` - Ensure that empty code block class doesn't show up in the visual editor - Add `mermaid` and `dot` to insert code cell snippet diff --git a/apps/vscode/package.json b/apps/vscode/package.json index 9e7e0455..9190b8c5 100644 --- a/apps/vscode/package.json +++ b/apps/vscode/package.json @@ -11,7 +11,7 @@ "pandoc", "quarto" ], - "version": "1.111.0", + "version": "1.114.0", "repository": { "type": "git", "url": "https://github.com/quarto-dev/quarto/tree/main/apps/vscode"