Skip to content

Adjust isMarkdownFile heuristics to not Indirectly Depend Upon Language Extensions - #220

Merged
estruyf merged 3 commits into
estruyf:devfrom
farmerau:markdown-file-heuristics-mdx
Jan 5, 2022
Merged

Adjust isMarkdownFile heuristics to not Indirectly Depend Upon Language Extensions#220
estruyf merged 3 commits into
estruyf:devfrom
farmerau:markdown-file-heuristics-mdx

Conversation

@farmerau

@farmerau farmerau commented Jan 5, 2022

Copy link
Copy Markdown
Contributor

Description

Per #219, isMarkdownFile relies on language support for MDX files to be installed in order to work. This change adds fallback logic to the method to support checking the supported file extensions (md, mdx) to support these file types without need for users to install MDX language support.

Testing

To test the changes, I:

  1. Ran the extension using the Extension Development Host
  2. Ensured that MDX language support was disabled
  3. Ensured that frontMatter.content.autoUpdateDate was set to true
  4. Opened a workspace that had MDX files
  5. Edited an MDX file and observed that lastmod property was updated in Front Matter as expected.

Notes:

As discussed in the issue, there's an alternative path for resolving this: explicitly requiring mdx language support in the extension manifest. This might not be desirable-- since it's unknown (to me) how many people are using Front Matter for MDX instead of Markdown.

@estruyf

estruyf commented Jan 5, 2022

Copy link
Copy Markdown
Owner

Thanks @farmerau! This is very much appreciated 🙏

@estruyf
estruyf merged commit 2f31230 into estruyf:dev Jan 5, 2022
@estruyf estruyf mentioned this pull request Jan 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants