Comments (9)
@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.
Summary of my invetigation:
- I have a diff that creates such plugin.
- 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.
I used jna-4.2.2 and it seems to be working (4343c1a).
Haven't released it yet.
from ktfmt.
- Thanks!
- This is indeed on our high-priority list. We'll give this more attention once everybody in the US is back from the holidays.
- 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.
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.
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.
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.
@jef please do :) I didn't get around to it yet...
Thanks!
from ktfmt.
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)
- Unstable formatting of file with a set of comments HOT 3
- @sample tags should not be moved within kdoc HOT 9
- Formatting creating lines longer than 100 characters HOT 5
- Unexpected removal of space after a comment HOT 2
- Annotation location on properties HOT 1
- Incorrect detection of unused import in Gradle Kotlin DSLs using new assignment operator HOT 1
- Update the pics in [demo](https://github.com/facebook/ktfmt#demo) HOT 4
- Publishing workflow is broken HOT 2
- ktfmt 0.45 is shipping against ancient milestone version of Kotlin HOT 2
- Parse error on empty enum with ';'
- Stop unwrapping wrapped function chaining HOT 1
- Kotlin rangeUntil ..< Syntax Throws Error HOT 1
- Cannot handle formatting `context` keyword HOT 3
- idea complains about deprecated method HOT 5
- KDoc: `@param` and `@property` sorted by type, not by position
- Continuation indent on delegating properties is missing HOT 1
- 0.47 trailing comma changes cause class definitions to be formatted weirdly HOT 2
- Formatting isn't idempotent, and repeated invocations produce bad comment formatting HOT 3
- ktfmt version 0.47 incompatible with spotless HOT 2
- Feature request: GraalVM artifacts
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ktfmt.