binhonglee / vscode-vugu

4 stars 0 forks source link

Support for calling vugufmt #1

Open bradleypeabody opened 4 years ago

bradleypeabody commented 4 years ago

I think if vugufmt were to only handle extracting the Go script portion of a .vugu file and running gofmt and/or goimports on it, and then this extension called vugufmt upon save by default - that behavior would be really useful for people.

HTML formatting is nice, but Go formatting is probably more immediately useful, and it's easier to solve.

I can do the needed changes to vugufmt to make this happen. Do you think you'd be able to add the ability to install vugufmt automatically (just using go get and/or go install) when your extension is first loaded and then calling vugufmt automatically upon save? (Probably an option for this would be appropriate so it can be disabled if needed.)

binhonglee commented 4 years ago

Hey sorry for the lack of response. I kinda just hacked this together over a weekend when I was first trying out vugu and haven't had a chance to dedicate more time to look into it. I'd say PR is welcomed and I'll keep the plugin updated on the vscode store page. Do you have any code pointers on where vugufmt lives? I'll take a look at it when I get a chance over the next month or so but no promises.

bradleypeabody commented 4 years ago

Thanks @binhonglee and sounds good. vugufmt lives here: https://github.com/vugu/vugu/tree/master/cmd/vugufmt but I haven't looked at it in a while and Vugu as a project has evolved quite a bit since. I'll see if I can dust it off and ensure it works well enough to be useful. I'll post an update back here once I've done that and go from there.