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

mdx.validate.validateFileLinks does not show diagnostics #465

Open
4 tasks done
karlhorky opened this issue Aug 8, 2024 · 1 comment
Open
4 tasks done

mdx.validate.validateFileLinks does not show diagnostics #465

karlhorky opened this issue Aug 8, 2024 · 1 comment
Labels
🤞 phase/open Post is being triaged manually

Comments

@karlhorky
Copy link

Initial checklist

Affected packages and versions

MDX VS Code Extension v1.8.9

Link to runnable example

No response

Steps to reproduce

  1. Open app/message.mdx in the reproduction repo (code below)
  2. Observe that none of the 4 "incorrect path" permutations for the non-existent file mdx2.png report any diagnostics (both images and links, relative paths starting with ./ and "bare" paths without any ./)
## Links

[link relative](./mdx.png) and [link bare](mdx.png)

[link relative - incorrect path](./mdx2.png) and [link bare - incorrect path](mdx2.png)

## Images

![image relative](./mdx.png) and ![image bare](mdx.png)

![image relative - incorrect path](./mdx2.png) and ![image bare - incorrect path](mdx2.png)

Screenshot 2024-08-08 at 15 08 54

Expected behavior

Diagnostics and problems should be reported for non-existent files when mdx.validate.validateFileLinks is set to hint, warning or error

Actual behavior

Diagnostics and problems are not reported for non-existent files when mdx.validate.validateFileLinks is set to hint, warning or error

Runtime

No response

Package manager

No response

OS

macOS

Build and bundle tools

No response

@github-actions github-actions bot added 👋 phase/new Post is being triaged automatically 🤞 phase/open Post is being triaged manually and removed 👋 phase/new Post is being triaged automatically labels Aug 8, 2024
@polynook
Copy link

I can observe the same behavior.

In my case, from all available validations, only one works, and that is the link.no-such-reference.
The link.no-such-header-in-file validation also reports, although incorrectly—it reports an error when the header exists.

mdx.mdx file content:

[no-definition] {/* No link definition found: 'no-definition'(link.no-such-reference) */}
[empty-definition]()

[non-existing-file-relative](./not-existing-file)
[non-existing-file-absolute](not-existing-file)

[existing-file-relative](./existing-file.md)
[existing-file-absolute](/existing-file.md)

[existing-file-existing-header](./existing-file.md#existing-header) {/* Header does not exist in file: existing-header(link.no-such-header-in-file) */}
[existing-file-non-existing-header](./existing-file.md#non-existing-header) {/* Header does not exist in file: non-existing-header(link.no-such-header-in-file) */}

[non-existing-file-non-existing-header](./not-existing-file#non-existing-header)
[non-existing-file-non-existing-header](not-existing-file#non-existing-header)
- Header does not exist in file: my_file(link.no-such-header-in-file)

I used the exact same content in an md.md file as control, and all Markdown validations work with plain VS Code Markdown (except for [empty-definition]() not being flagged as no-definition, which I personally think should be flagged as such).

I did this test in a blank VS Code profile that has only MDX extension installed to exclude possible conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤞 phase/open Post is being triaged manually
Development

No branches or pull requests

2 participants