microsoft / vscode-markdown-languageservice

The language service that powers VS Code's Markdown support, extracted so that it can be reused by other editors and tools
MIT License
408 stars 12 forks source link

Allow validation of extensionless links to non-markdown syntax files #189

Open twhittock-disguise opened 4 months ago

twhittock-disguise commented 4 months ago

When working with "markdown.preferredMdPathExtensionStyle": "removeExtension" set, and a mix of MDX and MD files, it is not possible to validate and autocomplete links to MDX files from MD files using this language service.

The root cause, at least for validation, seems to be https://github.com/microsoft/vscode-markdown-languageservice/blob/7156aba6bdffef89b9210def0e0dda785569d1ab/src/workspace.ts#L227

This function requires all extensionless links in MD files to be handled by the language service. However, MDX files can't be handled by this service.

Perhaps a new setting ("markdown.knownMdExtensions": ["md", "mdx"]) could be added to allow link validation to find the file?

mjbvz commented 2 weeks ago

Does markdownFileExtensions handle this?

It's not configurable via vscode directly at the moment