Giter VIP home page Giter VIP logo

Comments (11)

sum01 avatar sum01 commented on June 18, 2024

Hmm. So it doesn't have its own executable? I'm wondering how I'm supposed to figure out where that google-java-format-1.5-all-deps.jar actually is to be able to run this.

from fmt-micro.

 avatar commented on June 18, 2024

You could probably have a config option in the settings file for that path

from fmt-micro.

sum01 avatar sum01 commented on June 18, 2024

If you require the functionality at the moment, just update fmt to 3.2, then add the path into your own custom formatter like so
"fmt|java": "java -jar /path/to/google-java-format-1.5-all-deps.jar --replace"

This seems like something that would do well to be bundled, so that I can know where it's located. Probably put the .jar in configs/google-java-format, but I'll have to keep it updated myself.

from fmt-micro.

sum01 avatar sum01 commented on June 18, 2024

Although I think that command might need some work, I didn't check their docs yet on how to do an in-place... Updated previous command, should be good

from fmt-micro.

 avatar commented on June 18, 2024

can't get it to work, how am I supposed to edit the settings?
currently "java-formatter": "uncrustify", works, should I delete that line or....?
I just added your command/ tried your command + "java-formatter": "", but it did not work

(and updated your plugin, a shame that micro still has this update bug so I have to manually select the one)

from fmt-micro.

sum01 avatar sum01 commented on June 18, 2024

Nah, you can simply create that entirely new option. I added it here 01b3831

It looks for fmt|langname and uses that instead of whatever is declared in langname-formatter (if found).

So just copy that entire command, fix the path, then add it as a new line in your settings.json. Docs

from fmt-micro.

 avatar commented on June 18, 2024

yes that is what I did very first but did not work
never mind now it works, maybe the java execution of the formatter was just bit sluggish, thanks for the super quick response

from fmt-micro.

sum01 avatar sum01 commented on June 18, 2024

Then perhaps the command itself doesn't work. I just tested "fmt|java": "echo 'test'" and it worked.

from fmt-micro.

sum01 avatar sum01 commented on June 18, 2024

I downloaded the file and tested on some example code, and it works just fine.

Perhaps you have the wrong path in the settings? There might be a helpful error in Micro's log (CtrlE 'log')

from fmt-micro.

 avatar commented on June 18, 2024

I did edit my post, sorry for the confusion, it works properly, thanks for the quick response!

from fmt-micro.

sum01 avatar sum01 commented on June 18, 2024

So I think I'm going to not add this as a built-in formatter, since that would require bundling it with the repo. Bundling would go against the idea of the user supplying their own binaries/whatever and at the version they want.

Plus the custom formatter option works for people that still want it 😄

Once more, I'll post the option for anyone interested

"fmt|java": "java -jar /path/to/google-java-format-1.5-all-deps.jar --replace"

from fmt-micro.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.