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

Option to stop the extension from modifying imports on save/format #3399

Closed
WillsterJohnson opened this issue Nov 23, 2023 · 1 comment · Fixed by eclipse-jdtls/eclipse.jdt.ls#2978
Labels

Comments

@WillsterJohnson
Copy link

This extension keeps modifying my imports either by ordering them differently or by switching into or out of * imports. I Do Not Want It To Touch My Imports. Ever.

Environment
  • Operating System: MacOS 13.6.1
  • JDK version: openjdk 17.0.8.1
  • Visual Studio Code version: 1.84.2
  • Java extension version: 1.24.0
Steps To Reproduce
  1. Use imported classes and members
  2. Save the file
  3. Observe the extension modifying imports
Current Result

The imports are modified.

Expected Result

There should be a configuration option which completely prevents modifying imports.

The star thresholds are not a solution; I am the one to determine whether I use a star import, not some arbitrary number.

Setting import order such that it is 'anything goes' is also not a solution; I want auto-added imports to continue to make a best guess at where to go, however I do not want existing imports to be reordered.

@snjeza
Copy link
Contributor

snjeza commented Nov 23, 2023

@WillsterJohnson Could you show your

  • settings.json
  • <your_project>/.settings/org.eclipse.jdt.core.prefs
  • <your_project>/.settings/org.eclipse.jdt.ui.prefs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants