mdx-analyzer icon indicating copy to clipboard operation
mdx-analyzer copied to clipboard

Auto-import IntelliSense of React components missing

Open karlhorky opened this issue 1 year ago • 1 comments

Initial checklist

Affected packages and versions

MDX VS Code Extension v1.8.9

Link to runnable example

No response

Steps to reproduce

As noted in https://github.com/mdx-js/mdx-analyzer/issues/451#issuecomment-2196432076, the IntelliSense entries for auto-import of React components in .tsx files (auto-import in an .mdx file) are missing.

  1. Clone the reproduction at https://github.com/karlhorky/repro-mdx-analyzer-missing-auto-import-intellisense
  2. Install the 2 recommended extensions [email protected] and [email protected] (both enabled)
  3. In app/message.mdx, move the cursor to the end ZoomImage and trigger IntelliSense with ctrl-space
  4. Observe one entry in IntelliSense
  5. Select this entry
  6. Observe the import is added at the end of the file
  7. Disable [email protected]
  8. Move the cursor to the end ZoomImage and trigger IntelliSense with ctrl-space
  9. Observe zero entries in IntelliSense
Version: 1.91.0-insider
Commit: aea213b7fcc7de5c24ad797ac1af209b159d451f
Date: 2024-06-28T06:02:58.030Z
Electron: 29.4.0
ElectronBuildId: 9728852
Chromium: 122.0.6261.156
Node.js: 20.9.0
V8: 12.2.281.27-electron.0
OS: Darwin arm64 23.5.0

Repo: https://github.com/karlhorky/repro-mdx-analyzer-missing-auto-import-intellisense

https://github.com/mdx-js/mdx-analyzer/assets/1935696/9dc9fded-14a3-490f-a94e-416c16fa2d0a

Expected behavior

  1. One entry in the IntelliSense for ZoomImage when only [email protected] installed
  2. Selecting the entry should add the new import to the top of the code (also when [email protected] enabled)
    1. Saving the file with an import not in the import block at the top should move the import to the top of the file

Actual behavior

  1. Zero entries in the IntelliSense for ZoomImage when only [email protected] installed
  2. (when [email protected] enabled) selecting the entry adds the new import to the bottom of the code
    1. Saving the file has no effect

Runtime

Node v20

Package manager

No response

OS

macOS

Build and bundle tools

Next.js

Potentially Related

  • https://github.com/mdx-js/mdx-analyzer/issues/413
  • https://github.com/mdx-js/mdx-analyzer/issues/56
  • https://github.com/mdx-js/mdx-analyzer/issues/165
  • https://github.com/mdx-js/mdx-analyzer/pull/226

karlhorky avatar Jun 28 '24 16:06 karlhorky

I am getting a similar issue with the VSCode Intellicode extension turning off all hints from this extension

Yonom avatar Jul 08 '24 03:07 Yonom

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.

github-actions[bot] avatar Jan 03 '25 12:01 github-actions[bot]

I have confirmed (and fixed) it, but the fact that it works with viijay-kr.react-ts-css is actually a bug.

remcohaszing avatar Jan 03 '25 12:01 remcohaszing

@remcohaszing thanks, amazing!

Do you think this is a bug in viijay-kr.react-ts-css?

karlhorky avatar Jan 03 '25 14:01 karlhorky

Hi! This was closed. Team: If this was fixed, please add phase/solved. Otherwise, please add one of the no/* labels.

github-actions[bot] avatar Apr 11 '25 12:04 github-actions[bot]

Hi! This was closed. Team: If this was fixed, please add phase/solved. Otherwise, please add one of the no/* labels.

github-actions[bot] avatar Apr 11 '25 12:04 github-actions[bot]

Hi @remcohaszing, hope you're well :)

I tried my repro steps with the repo https://github.com/karlhorky/repro-mdx-analyzer-missing-auto-import-intellisense with the latest version of the extension [email protected] and there is still no auto-import IntelliSense for React components (No suggestions. shown):

Image

Can this issue be reopened?

karlhorky avatar Sep 02 '25 14:09 karlhorky

This used to work. If this is broken again, it’s a different bug. Please open a new issue.

remcohaszing avatar Sep 03 '25 07:09 remcohaszing

It didn't work when I opened this issue in June 2024. (unless I installed the other extension)

But yeah, I can open a new issue without the details of the other extension.

New issue:

  • #516

karlhorky avatar Sep 03 '25 08:09 karlhorky