-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
[typescript-plugin] Doesn't understand component map #467
Comments
I see why this happens and have a rough idea how to fix it. It has to do with the scope analysis of virtual files in https://github.com/mdx-js/mdx-analyzer/blob/main/packages/language-service/lib/virtual-code.js. We will probably need to utilize the more detailed scopes returned by periscopic instead of only relying on the global scope. I will get to it when I get to it, but someone else can give it a try if they want. The related tests are in https://github.com/mdx-js/mdx-analyzer/blob/vscode-mdx%401.8.9/packages/language-service/test/language-plugin.js. |
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 |
This handles components used in a local scope the same as components defined in the global scope. This means local components used in JSX no longer yield errors in the editor. However, autocompletions are not yet supported. Closes #467
Hi! This was closed. Team: If this was fixed, please add |
1 similar comment
Hi! This was closed. Team: If this was fixed, please add |
Initial checklist
Affected packages and versions
MDX extension v1.8.9
Link to runnable example
https://codesandbox.io/p/github/aaronadamsCA/mdx-issues/main?file=/src/mdx.mdx
Steps to reproduce
You'll have to run the reproduction in an environment that supports Visual Studio Code extensions.
The TypeScript plugin doesn't seem to understand a component map in a
.mdx
file:Expected behavior
No errors or warnings.
Actual behavior
The plugin isn't recognizing the destructured
Component
and the JSX<Component />
as the same object, whereas the actual MDX parser has no problem with this syntax.Runtime
No response
Package manager
No response
OS
No response
Build and bundle tools
No response
The text was updated successfully, but these errors were encountered: