anacierdem / vscode-requirejs

Provides goto definition functionality for require js modules.
MIT License
21 stars 14 forks source link

JSX files are not navigated #57

Closed ayush000 closed 5 years ago

ayush000 commented 5 years ago

Hi,

I tried using the extension to ease up navigation in VSCode. The extension works perfectly fine with JS files but doesn't work with JSX files. I've set the module path correctly.

Both JS and JSX have the same root. JSX is basically a javascript file but also contains React's HTML templates.

Thanks

anacierdem commented 5 years ago

I have just enabled jsx files, but I doubt this will work properly. Can you try and inform?

If they are not working, we need to write related tests and develop as necessary.

ayush000 commented 5 years ago

Thanks @anacierdem

I updated the extension to 0.1.19 in vscode. I'm now able to navigate to js files from a jsx file, but not able to navigate to jsx file from a js or jsx file

I added a workaround to support navigation to jsx files. https://github.com/anacierdem/vscode-requirejs/pull/58

Also, one strange bug that I encountered. I can navigate from within a jsx file only after I've opened a js file and navigated to another js / jsx file. I mean, first time I open a jsx file, it's as if this extension is not there at all. Then I open a js file, it's working fine as expected. Then I open a jsx file again, the extension magically starts working.

anacierdem commented 5 years ago

Setting requireModuleSupport.pluginExtensions importing like jsx!/src/moduleA is working as expected. Added necessary tests for these cases, updated readme and released a new version.

anacierdem commented 5 years ago

Thanks @anacierdem

I updated the extension to 0.1.19 in vscode. I'm now able to navigate to js files from a jsx file, but not able to navigate to jsx file from a js or jsx file

I added a workaround to support navigation to jsx files.

58

Also, one strange bug that I encountered. I can navigate from within a jsx file only after I've opened a js file and navigated to another js / jsx file. I mean, first time I open a jsx file, it's as if this extension is not there at all. Then I open a js file, it's working fine as expected. Then I open a jsx file again, the extension magically starts working.

The second bug you are experiencing may be related to vscode itself. Can you open a new issue for that?

anacierdem commented 5 years ago

Tests failed at CI, not yet released sorry :) New version only adds readme & tests on the other hand.

ayush000 commented 5 years ago

Hey @anacierdem , did you get time to fix the tests?

anacierdem commented 5 years ago

Not yet :(

anacierdem commented 5 years ago

Added simple test cases! Closing this one.