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

[improve docs] organize imports upon save #480

Open
jabbalaci opened this issue Jun 17, 2024 · 0 comments
Open

[improve docs] organize imports upon save #480

jabbalaci opened this issue Jun 17, 2024 · 0 comments

Comments

@jabbalaci
Copy link

I could set up to autoformat my code upon save. However, import lines were not sorted.

From the docs I could figure out how to do it: move the cursor on an input line and press Ctrl+q Ctrl+s. But how to get it automatically? When I save my code, I wanted it fully autoformatted: 1) format the code, and 2) sort the import lines.

Actually, it's possible, but I had to ask it on a forum. Add these lines to your settings.json:

"[d]": {
    "editor.formatOnSave": true,
    "editor.codeActionsOnSave": {
      "source.organizeImports": "always"
    }
  },

Please add it to the documentation so people find it easily.

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

No branches or pull requests

1 participant