language-tools
language-tools copied to clipboard
Arranged imports from code actions misses space in-between
Describe the bug
When I use the "Organize Imports" code action on a svelte file, the items in the braces is only delimited by ,, not , .
Reproduction
import { a, b, d, c } from './Foobar.svelte'- Right click -> Source Action -> Organize Imports
- It becomes
import { a,b,c,d } from './Foobar.svelte'
Expected behaviour
import { a, b, c, d } from './Foobar.svelte'
System Info
- OS: Windows 11
- IDE: VSCode 1.17.0
Which package is the issue about?
Svelte for VS Code extension
Additional Information, eg. Screenshots
No response
I guess it should somehow preserve formatting, rather than placing spaces. Otherwise after this issue being fixed some other guy would open issue about unwanted spaces after executing "Organize imports".
I saw this repo (e.g.) uses space in its imports all the time, so I thought it's some kind of coding style convention in TypeScript. To me, it's much more difficult to distinguish each name without the space. But if that's not universally accepted standard, then I guess either won't fix this, or provide a config to satisfy everyone.
Google's TypeScript Style Guide has an example that uses comma space: https://google.github.io/styleguide/tsguide.html#optimization-compatibility-for-module-object-imports
import {method1, method2} from 'utils';
class A {
readonly utils = {method1, method2};
}