coc-extensions / coc-svelte

svelte support for (Neo)Vim
MIT License
178 stars 24 forks source link

Windows line endings (^M) at the end of auto import statement #32

Open icalvin102 opened 3 years ago

icalvin102 commented 3 years ago

Whenever I use the auto import feature of coc or the CocAction('runCommand', 'editor.action.organizeImport') the line endings will be in windows format.

Example

import Foo from './Foo.svelte';^M

This only happens in svelte files. js and ts use Unix line endings.

Is there a way to specify the type of line endings?

My current workaround is to run :%s/^M//g from time to time.

Edit: I found a related issue on https://github.com/sveltejs/language-tools/issues/854 but I don't know what to do with the information.

quentin-fox commented 3 years ago

I'm also encountering this issue. Is there anyone able who knows more about the LSP setup who would be able to tackle this issue? I'm happy to help debug this, but I have very little experience with the inner workings of LSPs.

quentin-fox commented 3 years ago

This has been fixed in recent versions of the svelte language server, from what I can tell.