-
Notifications
You must be signed in to change notification settings - Fork 4
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
Errors in .mdx
files with mdx.checkMdx
in tsconfig.json
appear at end of file
#160
Comments
Seems interesting. Initial thoughts. 1.The extension should not be activated for MDX language unless they are considered as JSX (courtesy MDX extension) |
Good to know, maybe that's useful information for tracking down this problem.
Yes, it's visible in the video |
@karlhorky Did you notice this , ? the extension never gets activated like I presumed |
@karlhorky I modified the langauge service plugin based on the volar PR Viijay-Kr/typescript-cleanup-defs#4 . This fixes the problem for me . I tested it locally . If you wish to test it ? clone the repo , link the package in react-ts-css project and run the extension locally , the errors appear at the right location |
With "the Volar PR", you mean volarjs/volar.js#216, right? I wonder if this PR will actually resolve the issue, once it is pulled in to MDX Analyzer and a new version of MDX Analyzer released...
Sounds great though! Maybe it's best to have it resolved in both extensions anyway. I will try to find some time in the next days to test this... |
I don't follow this 🤔. I haven't gone over mdx analyzer project. Does MDX analyzer process all the typrescript server plugins installed by other extensions ? even if it did I tested it using the setup you recommended , using the mdx analyzer extension. So please enlighten me If I am missing something
Yes thats right. |
Ah I'm not sure you're missing anything - I was just wondering if fixing it in MDX Analyzer would also fix it in other extensions. But fixing in both places (also in React CSS modules) is probably better and maybe also even necessary. |
I would try to test this out today - just having trouble understanding the instructions. Is there a way to apply the patch manually (eg. from the Files changed in the PR) by editing the extension files locally on my machine? (instead of building/linking anything or installing a different local version of the extension) Something similar to the workflow of editing |
Ah yeah, I can edit the files in place by editing this file:
This was the change I applied (based on Viijay-Kr/typescript-cleanup-defs#4): - const proxy = Object.create(null);
+ const proxy = new Proxy(info.languageService, {
+ get(target, p, receiver) {
+ return Reflect.get(target, p, receiver)
+ },
+ set(target, p, newValue, receiver) {
+ return Reflect.set(target, p, newValue, receiver)
+ },
+ }); This indeed resolves the problem: BeforeAfter |
Companion issue to mdx-js/mdx-analyzer#451
Describe the bug
Usage with
[email protected]
along with[email protected]
leads to:.mdx
files reported at end of fileZoomImage
adds the new import to the bottom of the codeDisabling
[email protected]
leads to errors being reported in the correct locationsTo Reproduce
Steps to reproduce the behavior:
package.json
dependencies[email protected]
and[email protected]
(both enabled)app/message.mdx
, observe that the errors are reported at a one-character red squiggly at the end of the file, instead of in the correct locationsKapture.2024-06-28.at.17.33.21.mp4
Expected behavior
ZoomImage
should add the new import to the top of the codeScreenshots
Already included above
Desktop (please complete the following information):
VS Code version information:
Additional context
--
The text was updated successfully, but these errors were encountered: