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 Extension for VSCode doesn't support IntelliSense link path completion for # and ## triggers in .mdx files #482

Open
4 tasks done
yokaiichi opened this issue Nov 7, 2024 · 3 comments
Labels
🗄 area/interface This affects the public interface 👍 phase/yes Post is accepted and can be worked on 👶 semver/patch This is a backwards-compatible fix 🐛 type/bug This is a problem 🙆 yes/confirmed This is confirmed and ready to be worked on

Comments

@yokaiichi
Copy link

Initial checklist

Affected packages and versions

MDX unified v1.8.11

Link to runnable example

No response

Steps to reproduce

  1. On a Mac system, install VSCode 1.94.0 or later, and install the MDX unified Extension v1.8.11.

  2. In a repo, create two sibling folders. In one folder place two files A.mdx and B.mdx. In the other folder place a single file C.mdx.

  3. In A.mdx create several different ## sections and dummy paragraphs in each section. Do the same for B.mdx and C.mdx.

  4. In A.mdx, in any paragraph, add an empty Markdown link [anchorText](). Place your cursor in the empty link destination delimiters (), trigger IntelliSense autocomplete (Control + Space) and type # to attempt to view autocomplete link paths to headers within the same A.mdx file. Nothing will happen; IntelliSense is not recognizing the # trigger.

  5. Try a variation of this by removing the # and this time typing two hash marks ## to attemp to view autocomplete link paths to headers across ALL files including B.mdx and C.mdx. Nothing will happen; IntelliSense is not recognizing the ## trigger.

  6. Now try all this again with three non-MDX files A.md, B.md, and C.md. You'll see that IntelliSense fully recognizes and acts on both the # and ## triggers in regular .md files.

Expected behavior

IntelliSense recognizes both # and ## triggers for link path completion behavior, exactly as it does in regular .md files.

Additional details from Discussion in mdx-js

Actual behavior

IntelliSense does absolutely nothing in response to # and ## triggers for link path completion in .mdx files, even with the most recent (v1.8.11) MDX unified Extension installed in the most recent version of VSCode (v1.94.0) for Mac.

Affected runtime and version

node v20.18.0

Affected package manager and version

npm v10.9.0

Affected OS and version

macOS Sonoma 14.6.1

Build and bundle tools

Docusaurus

@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 Nov 7, 2024
@remcohaszing
Copy link
Member

Some findings based on fixtures/demo/fixture.mdx, where | represents the cursor position:

  • The # character does trigger completions.
  • Headings are resolved for relative paths to .mdx files ([](./fixtures.mdx#|)
  • Headings are not resolved for relative paths to .md files ([](../../README.md#|)
  • Headings are not resolved within the same file ([](#|)

@remcohaszing remcohaszing added 🐛 type/bug This is a problem 🗄 area/interface This affects the public interface 👶 semver/patch This is a backwards-compatible fix 🙆 yes/confirmed This is confirmed and ready to be worked on 👍 phase/yes Post is accepted and can be worked on labels Nov 11, 2024
@github-actions github-actions bot removed the 🤞 phase/open Post is being triaged manually label Nov 11, 2024

This comment was marked as resolved.

@yokaiichi
Copy link
Author

yokaiichi commented Nov 12, 2024

Not sure exactly what you mean with the first bullet, but it's outside the scope of the problem I reported anyway. Which revolves around what you've partially confirmed in the 3rd and 4th bullets.

However, there is one other aspect of my reported behavior that isn't reflected in your findings (yet):

  • Headings within other files are not resolved for relative paths to .md files [](../../README.md##|) - Note the double-hash trigger.
  • Headings are not resolved within other files [](##|) - Note the double-hash trigger.

Both your 3rd and 4th bullets, and these two just above, work correctly for .md files in VSCode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🗄 area/interface This affects the public interface 👍 phase/yes Post is accepted and can be worked on 👶 semver/patch This is a backwards-compatible fix 🐛 type/bug This is a problem 🙆 yes/confirmed This is confirmed and ready to be worked on
Development

No branches or pull requests

2 participants