mdx-analyzer
mdx-analyzer copied to clipboard
Auto-import IntelliSense of React components missing
Initial checklist
- [X] I read the support docs
- [X] I read the contributing guide
- [X] I agree to follow the code of conduct
- [X] I searched issues and couldn’t find anything (or linked relevant results below)
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.
- Clone the reproduction at https://github.com/karlhorky/repro-mdx-analyzer-missing-auto-import-intellisense
- Install the 2 recommended extensions
[email protected]and[email protected](both enabled) - In
app/message.mdx, move the cursor to the endZoomImageand trigger IntelliSense with ctrl-space - Observe one entry in IntelliSense
- Select this entry
- Observe the import is added at the end of the file
- Disable
[email protected] - Move the cursor to the end
ZoomImageand trigger IntelliSense with ctrl-space - 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
- One entry in the IntelliSense for
ZoomImagewhen only[email protected]installed - Selecting the entry should add the new import to the top of the code (also when
[email protected]enabled)- 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
- Zero entries in the IntelliSense for
ZoomImagewhen only[email protected]installed - (when
[email protected]enabled) selecting the entry adds the new import to the bottom of the code- 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
I am getting a similar issue with the VSCode Intellicode extension turning off all hints from this extension
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.
I have confirmed (and fixed) it, but the fact that it works with viijay-kr.react-ts-css is actually a bug.
@remcohaszing thanks, amazing!
Do you think this is a bug in viijay-kr.react-ts-css?
Hi! This was closed. Team: If this was fixed, please add phase/solved. Otherwise, please add one of the no/* labels.
Hi! This was closed. Team: If this was fixed, please add phase/solved. Otherwise, please add one of the no/* labels.
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):
Can this issue be reopened?
This used to work. If this is broken again, it’s a different bug. Please open a new issue.
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