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

Organize typescript imports as a fixer. #3177

Open
tplk opened this issue May 20, 2020 · 0 comments
Open

Organize typescript imports as a fixer. #3177

tplk opened this issue May 20, 2020 · 0 comments

Comments

@tplk
Copy link

tplk commented May 20, 2020

Hello!

I've been wondering if it's possible to use ale#organize_imports#Execute as a fixer so it's possible to organize imports and format code with a single command.

I've tried running it with ALEFixPost/Pre autocommands but it either messes up the imports or leaves some code unformatted.

Here's the fixer implementation I tried to use but I'm quite new to vimscript so I'm not sure if it's possible to wait until after it's finished to run other fixers.

function! ale#fixers#tsserver_organize_imports#Fix(buffer) abort
    return {
    \   'command': ale#organize_imports#Execute(),
    \   'read_temporary_file': 1,
    \}
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant