-
-
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
all imports duplicate to the bottom on each save #407
Comments
Thanks for reporting! I'm pretty sure what causes this, so I'll fix it soon. As a workaround you should disable But to be sure, can you share an MDX document to reproduce this? |
I’m seeing different behaviour.
(1) is fine. (2) should really never happen. (3) works as expected. Disabling I’m going to need more info on this. What are your VSCode settings used for formatting? |
this is my settings{ "javascript.format.insertSpaceAfterOpeningAndBeforeClosingEmptyBraces": true, event when i set
the issue remains the same. when i revert back to version 1.7.3 there is no problem this is how the bottom of the file look like after saving it with version 1.8.0 </CardGrid>import { Card, CardGrid, LinkCard } from '@astrojs/starlight/components'
import DonateButton from '@components/DonateButton.astro'
import { downloadLink, releasesLink } from '@utils/helper.mjs' the 3 import lines where copy from the top of the file |
This is really helpful information, but I’m still not able to reproduce it with those settings. I just released version 1.8.1. Can you check if that fixes the issue? |
1.8.1 did not solve this issue. I will try to start new folder with empty config and try to find the set of configuration and extension combination I am on windows 11 |
The issue is probably some incompatibility with IntelliCode extension from Microsoft. The problem solved as soon as I disabled This issue only started on version 1.8.0, on version 1.7.3 using |
Even with the IntelliCode extension installed and activated, and the settings you posted I’m not seeing this issue. |
Hi! Thanks for taking the time to contribute! This has been marked by a maintainer as needing more info. It’s not clear yet whether this is an issue. Here are a couple tips:
Thanks, |
I experienced this exact same issue and uninstalling the intellicode extension solved it. |
This was the bug that was causing this for me: mdx-js/mdx-analyzer#407
This was the bug that was causing this for me: mdx-js/mdx-analyzer#407
This was the bug that was causing this for me: mdx-js/mdx-analyzer#407
I'm also having this issue and it's also connected to IntelliCode (v1.3.1) and Here are my settings, but I removed some obvious things like color settings or Java Path: {
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"material-ui-snippets.showNotesOnStartup": false,
"material-ui-snippets.importPaths": "second level",
"mui-snippets.importPaths": "second level",
"mui-snippets.showNotesOnStartup": false,
"npm.packageManager": "npm",
"editor.tabCompletion": "on",
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[scss]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"jest.disabledWorkspaceFolders": [],
"jestrunner.codeLens": ["run", "debug", "coverage"],
"jest.autoRun": "off",
"jest.showCoverageOnLoad": true,
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit"
},
"files.eol": "\n",
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.detectIndentation": false,
"[sql]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "mtxr.sqltools"
},
"workbench.startupEditor": "none",
"debug.autoExpandLazyVariables": false,
"editor.linkedEditing": true,
} |
Unfortunately, I'm having this issue with Astro's VS Code extension, v2.13.1. Turning it off solves the issue. I feel like maybe it's not Intellicode's fault, but something related to what extensions do in general? I'm on MDX extension v1.8.9. Edit 1: Astro's extension claims to support auto-imports, which I suspect might be causing the issue here. Edit 2: okay, found the issue. Turns out I had |
Initial checklist
Affected packages and versions
[email protected]
Link to runnable example
No response
Steps to reproduce
Expected behavior
lol
Actual behavior
result: another copy of all the imports in the file are duplicated to the bottom of the file
Runtime
Node v20
Package manager
pnpm
OS
Windows
Build and bundle tools
Other (please specify in steps to reproduce)
The text was updated successfully, but these errors were encountered: