:TSLspOrganize
formatting
#104
-
import {
foo,
bar,
} from 'baz'; becomes import {
foo,
bar
} from 'baz'; If it's not noticable, the last comma is lost, and there are many extra spaces appended. I also started having another issue. I'm not sure if it's related to this plugin. When auto importing, it's now using absolute paths, rather than relative paths. import { foo } from '../../bar'; is now import { foo } from 'src/bar'; |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
On my end, the behavior is slightly different. Starting with this: import {
foo,
bar,
} from 'baz';
foo()
bar() And running import {
bar, foo
} from 'baz';
foo()
bar() VS Code produces the same results. If you look at the code for As for the second issue, this is controlled by your |
Beta Was this translation helpful? Give feedback.
-
I've created a PR for it to upstream: typescript-language-server/typescript-language-server#348. Now this should be fixed. |
Beta Was this translation helpful? Give feedback.
On my end, the behavior is slightly different. Starting with this:
And running
:TSLspOrganize
results in this:VS Code produces the same results. If you look at the code for
:TSLspOrganize
, you can see that all we are doing is sending a simple request to the client and applying the results, so there's not much we can do here to control how things are formatted.As for the second issue, this is controlled by your
tsconfig.json
. All this plugin does is get and apply actions from the language server.