Coder Social home page Coder Social logo

Comments (9)

cgrushko avatar cgrushko commented on May 3, 2024 2

@ujjwalagrawal17 by forking, I meant copying https://github.com/google/google-java-format/tree/master/idea_plugin into https://github.com/facebookincubator/ktfmt/ and making changes (and adding some comments explaining the changes). We'll get to it once the holidays are over, as I mentioned. Feel free to experiment with this in the meantime.

from ktfmt.

cgrushko avatar cgrushko commented on May 3, 2024 2

Summary of my invetigation:

  1. I have a diff that creates such plugin.
  2. It requires ktfmt to switch to using kotlin-compiler-embeddable (instead of kotlin-compiler) because of class conflicts. However, kotlin-compiler-embeddable is missing JNA, which crashes ktfmt on Java 8, which is a blocker for Facebook. (https://youtrack.jetbrains.com/issue/KT-40937). I'll try to figure out which JNA is being used there and add it to ktfmt and try again.

(cc @tyvsmith)

from ktfmt.

cgrushko avatar cgrushko commented on May 3, 2024 2

I used jna-4.2.2 and it seems to be working (4343c1a).
Haven't released it yet.

from ktfmt.

cgrushko avatar cgrushko commented on May 3, 2024 1
  1. Thanks!
  2. This is indeed on our high-priority list. We'll give this more attention once everybody in the US is back from the holidays.
  3. Superficially, this seems like a matter of forking https://github.com/google/google-java-format/tree/master/idea_plugin and changing GJF classes to ktfmt's. (although, ktfmt doesn't support all options that GJF supports, which is another matter).

from ktfmt.

jef avatar jef commented on May 3, 2024 1

I started working on this, but quickly got overwhelmed with what I actually wanted to do. I'm not sure if we wanted to convert the Java into Kotlin as well as setup for ktfmt.

My knowledge ends where the formatting begins, so it'll have to be something I sit down for a couple hours to understand the google format plugin before tackling this again.

Not sure if you started any progress, but I also don't know how soon I can get to it. I'll see if I can carve in some time again in the near future to do the above.

from ktfmt.

cgrushko avatar cgrushko commented on May 3, 2024 1

I would go for keeping everything Java (as well as keeping the copyright headers) and just copying it all and modifying the minimum required to get ktfmt working in IntelliJ.

I haven't gotten around to it yet; I might have time in the coming weeks. I'll update here if I start working on this.

from ktfmt.

jef avatar jef commented on May 3, 2024

Has there been any progress on this? I might want to look into converting this, but don't want to step over someone else's progress.

from ktfmt.

cgrushko avatar cgrushko commented on May 3, 2024

@jef please do :) I didn't get around to it yet...
Thanks!

from ktfmt.

tyvsmith avatar tyvsmith commented on May 3, 2024

When I was playing with GraalVM native-image and had swapped it to the embeddable compiler, I ran into the JNA issue as well, and ended up just plugging in jna-5.5.0.jar from artifactory into the classpath, to pass. I ended up running into other blockers so never could determine other side effects, but should be reasonable to put whatever is needed on the classpath though.

from ktfmt.

Related Issues (20)

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.