-
Notifications
You must be signed in to change notification settings - Fork 179
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
Added very basic terraform fmt runner #6
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really cool, thanks. Before I merge could you please squash "Add initial code plugin." and "Added very basic terraform formatting" ?
Also it would be awesome if the path to terraform could be made configurable, but that is just "would-be-cool"-type of comment so no need to fix.
|
||
function fmt(text: string): Promise<string> { | ||
return new Promise<string>((resolve, reject) => { | ||
const child = exec('terraform fmt -', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we make the path to terraform configurable?
Idea from goMain.ts, it is, as they say pretty horrible.
e975508
to
d816fac
Compare
@mauve that should do it. |
thanks for your contributions, I will push a new release to the vscode gallery later tonight after writing some changelog, do you mind if I mention you in the releasenotes? |
the formatOnSave is kinda bad when you have Auto-Save on is there a hook into editor.action.formatDocument that this could be executed on? |
I added a configuration option for
terraform.formatOnSave
and a little function runningterraform fmt -
with the input from the document.Thoughts?