Skip to content
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

[Bug] Importing .vue file in .jsx file added .js extension #229

Closed
wenfangdu opened this issue May 31, 2021 · 6 comments
Closed

[Bug] Importing .vue file in .jsx file added .js extension #229

wenfangdu opened this issue May 31, 2021 · 6 comments
Labels
wontfix This will not be worked on

Comments

@wenfangdu
Copy link
Contributor

Repro: https://github.com/wenfangdu/volar-jsx-import-vue-repro

volar

@johnsoncodehk johnsoncodehk added the bug Something isn't working label May 31, 2021
@johnsoncodehk
Copy link
Member

I can't reproduce, please provide some informations:

  • VSCode info from Help: About command
  • volar version
  • Is TS plugin enabled?

@wenfangdu
Copy link
Contributor Author

  • VSCode Info
    Version: 1.56.2 (user setup)
    Commit: 054a9295330880ed74ceaedda236253b4f39a335
    Date: 2021-05-12T17:13:13.157Z
    Electron: 12.0.4
    Chrome: 89.0.4389.114
    Node.js: 14.16.0
    V8: 8.9.255.24-electron.0
    OS: Windows_NT x64 10.0.19043
  • Volar Version
    v0.25.17
  • TS plugin is enabled

@wenfangdu
Copy link
Contributor Author

wenfangdu commented Jun 3, 2021

@johnsoncodehk
I see why now, to reproduce, please turn on "javascript.preferences.importModuleSpecifierEnding": "js" in your VSCode settings. For importing .vue files in .js/.jsx files, I think this setting should be ignored.

Just for completeness, I just tried enabling "typescript.preferences.importModuleSpecifierEnding": "js", then this issue appears for importing .vue files in .ts/.tsx files as well.

@johnsoncodehk
Copy link
Member

I see, this is expected behavior. Will check is it suitable for patching or not.

@johnsoncodehk johnsoncodehk removed bug Something isn't working need info labels Jun 6, 2021
@johnsoncodehk johnsoncodehk added the wontfix This will not be worked on label Jun 30, 2021
@wenfangdu
Copy link
Contributor Author

@johnsoncodehk
Since .vue files import auto-completion can only be enabled by enabling Volar, I think it makes sense to remove the .js suffix when auto-completing, could you please reconsider patching?

@johnsoncodehk
Copy link
Member

Since patching involves too much hacking, and this is expected behavior, it is temporarily decided not to patch. I want to avoid hacking to achieve unexpected but correct behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants