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

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

Merged
merged 3 commits into from
Jan 5, 2022

Conversation

farmerau
Copy link
Contributor

@farmerau farmerau commented Jan 5, 2022

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
Copy link
Owner

estruyf commented Jan 5, 2022

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