Skip to content

Conversation

@flwyd
Copy link
Contributor

@flwyd flwyd commented Oct 20, 2022

Fixes #200.

let l:cmd = codefmt#formatterhelpers#ResolveFlagToArray('mix_executable')
" Specify stdin as the file
let l:cmd = l:cmd + ['format', '--stdin-filename=' . l:filename, '-']
let l:dir = l:filename == 'stdin.exs' ? getcwd() : s:findMixDir(l:filename)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can stdin.exs be a valid filename here, or is it just supposed to be a placeholder value? If so, would this give the right behavior for a file explicitly named stdin.exs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair point. I moved l:dir assignment into the if empty block and added a comment giving context to stdin.exs.

@dbarnett dbarnett merged commit 3494825 into google:master Nov 18, 2022
@dbarnett
Copy link
Contributor

Thanks, Trevor!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants