Comments (16)
Any update on this?
from ktfmt.
Yeah, we need to at least upgrade the parser to 1.4.
I have a draft diff with the changes required to ugprade to 1.4, I'll get to it soon-ish.
from ktfmt.
@JavierSegoviaCordoba, I finally got around to it. There's a link to Maven Central from https://github.com/facebookincubator/ktfmt/releases/tag/v0.19 .
from ktfmt.
@cgrushko snippet of ktfmt
failure for fun interface
:
public fun interface PacketHandlerFunction<T : Packet<*>> : (Player, T?) -> T?
I'm getting the error:
33:11: error: Expecting function name or receiver type
com.facebook.ktfmt.ParseError: 33:11: error: Expecting function name or receiver type
from ktfmt.
Almost got it to work: #68
I can't figure out how to tell Maven not to compile Kotlin13InputAstVisitor.kt
, so one must first delete this file before compiling.
from ktfmt.
Yes, I expect we'll figure it out soon.
from ktfmt.
Let me release a new version.
from ktfmt.
Thank you very much :)
from ktfmt.
- Trailing commas are already supported
- I skimmed https://blog.jetbrains.com/kotlin/2019/12/what-to-expect-in-kotlin-1-4-and-beyond/, and seems that most new things should already work.
fun interface
might actually work out of the box, depending on how it's represented in the AST. If not, it should be a trivial amount of work.
Question - do you happen to have a list of snippets where ktfmt
fails? Having them in the format of unit-tests in FormatterKtTest.kt would be wonderful :)
from ktfmt.
Much appreciate your work. Thanks
from ktfmt.
@cgrushko do you possibly have the update for this? If you want to open a work in progress pull request maybe I can help?
from ktfmt.
Apologies for the delay - we're still on 1.3 internally, and I was hoping we'll get to 1.4 any day.
Because we build internally inside a monorepo, we need to make special arrangement to build both for 1.3 and for 1.4.
As I said, I was hoping I can get away with waiting a bit.
The problem is that Kotlin's interface of the visitor has changed in a backwards incompatible way.
Let me see if I can whip up something using reflection.
from ktfmt.
@cgrushko do you think the new version will be available this week? I am going to start a new project and I would like to test it there to get some conclusions before presenting it to my partners so we can use it instead ktlint or detekt
from ktfmt.
I am checking maven central and I don't find it. Is it in a snapshot repository so I can start testing it?
from ktfmt.
@cgrushko The IntelliJ plugin has to be updated to get the last version? I checked the code and I see it is using val ktfmtVersion = "0.18"
I don't know if there is a way that lets you avoid the usage of it directly in the project and adding a spinner menu with all the current versions available in MavenCentral. If you think it is possible I can file a new issue to ask this there as a feature request.
from ktfmt.
Ugh, the AS plugin is a problem we didn't figure out yet. I think what you suggest makes total sense, and is much better than releasing a plugin every time AS or ktfmt changes, but doing this is probably more complicated (unless IntelliJ plugins have access to such capability from the platform?)
The underlying is reason is of course that we have our own in-house plugin, so we don't dogfood this.
from ktfmt.
Related Issues (20)
- add trailing comma support to other non-google styles HOT 10
- Indentation level should be a command-line argument HOT 2
- Android Studio / IDEA plugin yields different results than running ktfmt HOT 11
- Treat trailing Elvis operator as part of a call chain HOT 2
- Adding target jar to releases HOT 2
- Weird lambda formatting when wrapping long line HOT 3
- Intellij Plugin set to Google (internal) always removes trailing commas HOT 1
- Lambdas following a statement can be treated as lambda arguments, breaking syntax HOT 1
- No artifacts were released for v0.48 and v0.49 HOT 4
- Trailing comma gets removed if there is only one parameter and it is formatted to be on its own line HOT 2
- ktfmt doesn't seem to work in IJ 2024.1.1 HOT 6
- Is ktfmt used on itself? HOT 5
- Misspelled flags in CLI can cause user data loss HOT 1
- How can I config Intellij plugin? HOT 2
- error: did not generate token "context" HOT 3
- Google style with trailing comma does not use maxWidth correctly HOT 1
- Nested function calls with named parameters is incredibly difficult to read and results in unnecessary nesting HOT 8
- ktfmt 0.51 incompatible with Spotless Gradle plugin HOT 2
- Consider providing a binary jar HOT 7
- ver 1.1.0.51 update breaks ktfmt intellij plugin setting screen if style is "Dropbox" HOT 2
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.