mdx-js / mdx-analyzer

MDX extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=unifiedjs.vscode-mdx
MIT License
347 stars 21 forks source link

MDX Extension for VSCode doesn't support IntelliSense link path completion for # and ## triggers in .mdx files #482

Open yokaiichi opened 6 days ago

yokaiichi commented 6 days ago

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

remcohaszing commented 2 days ago

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

github-actions[bot] commented 2 days ago

Hi! This was marked as ready to be worked on! Note that while this is ready to be worked on, nothing is said about priority: it may take a while for this to be solved.

Is this something you can and want to work on?

Team: please use the area/* (to describe the scope of the change), platform/* (if this is related to a specific one), and semver/* and type/* labels to annotate this. If this is first-timers friendly, add good first issue and if this could use help, add help wanted.

yokaiichi commented 1 day ago

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):

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