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: Adding duplicate import statement when using CRLF line endings and organize imports #933

Closed
xkeshav opened this issue Aug 12, 2024 · 5 comments
Labels
- P4: important Violate documented behavior or significantly improves performance (priority) needs triage Issue needs to be triaged

Comments

@xkeshav
Copy link

xkeshav commented Aug 12, 2024

Describe the Bug

Whenever we save an .astro file; it automatically add the last import statment one more time. earlier I though it is due to some eslint and vd code settings. here is full details of issue.

Astro extension v v2.13.2

VS Code v 1.92

VS Code > About Report

Version: 1.92.1
Commit: eaa41d57266683296de7d118f574d0c2652e1fc4
Date: 2024-08-07T20:16:39.455Z
Electron: 30.1.2
ElectronBuildId: 9870757
Chromium: 124.0.6367.243
Node.js: 20.14.0
V8: 12.4.254.20-electron.0
OS: Linux x64 6.8.0-40-generic

.prettierrc.js is default formatter and .eslintrc.js is on place

Steps to Reproduce

Please see here for details

Link to Minimal Reproducible Example

withastro/prettier-plugin-astro#425

@github-actions github-actions bot added the needs triage Issue needs to be triaged label Aug 12, 2024
@Princesseuh
Copy link
Member

Princesseuh commented Aug 12, 2024

This should normally already been fixed, see #928

I cannot reproduce the issue with your snippet, so there must be something else going on... Could you share a repo?

@Princesseuh Princesseuh added needs response Need a response from the original author and removed needs triage Issue needs to be triaged labels Aug 12, 2024
@Princesseuh
Copy link
Member

Managed to reproduce, it only happens in prod and with CRLF line endings again...

@Princesseuh Princesseuh added - P4: important Violate documented behavior or significantly improves performance (priority) and removed needs response Need a response from the original author labels Aug 13, 2024
@Princesseuh
Copy link
Member

Figured it out, there was an update to an upstream dependency that unexpectedly caused a change in how we generate the Volar mappings microsoft/vscode-languageserver-node#1286

I'm not sure if Microsoft intended for it to be breaking or not, but a bit annoying. It only happened in prod because prod ended up using a different version of the dependency due to a difference between how pnpm and npm handled the dep.

@Princesseuh Princesseuh changed the title 🐛 BUG: Adding duplicate import statement when Astro extension is enabled 🐛 BUG: Adding duplicate import statement when using CRLF line endings and organize imports Aug 13, 2024
@xkeshav
Copy link
Author

xkeshav commented Aug 14, 2024

But it is happening in a dev environment too

@Princesseuh
Copy link
Member

Should be fixed in latest version of the extension!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P4: important Violate documented behavior or significantly improves performance (priority) needs triage Issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

2 participants