Angry-Potato / prettier-plugin-kotlin

A prettier plugin for the Kotlin programming language
57 stars 4 forks source link

invalid stream header #17

Open Taliro opened 2 years ago

Taliro commented 2 years ago

Hi everyone,

I try to use this plugin on intellij and i have an error when i want format file

stacktrace:

Error: Exception in thread "main" java.io.StreamCorruptedException: invalid stream header: FDFD0005
    at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:863)
    at java.io.ObjectInputStream.<init>(ObjectInputStream.java:355)
    at com.github.angrypotato.kotato.ObjectSerializer.deserialize(ObjectSerializer.kt:37)
    at com.github.angrypotato.kotato.Write.run(main.kt:61)
    at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:136)
    at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:14)
    at com.github.ajalt.clikt.core.CliktCommand.parse(CliktCommand.kt:216)
    at com.github.ajalt.clikt.core.CliktCommand.parse$default(CliktCommand.kt:213)
    at com.github.ajalt.clikt.core.CliktCommand.main(CliktCommand.kt:231)
    at com.github.ajalt.clikt.core.CliktCommand.main(CliktCommand.kt:250)
    at com.github.angrypotato.kotato.MainKt.main(main.kt:70)

    at Object.module.exports [as print] (C:\Users\David\AppData\Roaming\npm\node_modules\prettier-plugin-kotlin\src\print.js:16:11)
    at callPluginPrintFunction (C:\Users\David\AppData\Roaming\npm\node_modules\prettier\index.js:13787:21)
    at mainPrintInternal (C:\Users\David\AppData\Roaming\npm\node_modules\prettier\index.js:13725:17)
    at mainPrint (C:\Users\David\AppData\Roaming\npm\node_modules\prettier\index.js:13707:14)
    at printAstToDoc (C:\Users\David\AppData\Roaming\npm\node_modules\prettier\index.js:13694:13)
    at coreFormat (C:\Users\David\AppData\Roaming\npm\node_modules\prettier\index.js:14055:15)
    at formatWithCursor$1 (C:\Users\David\AppData\Roaming\npm\node_modules\prettier\index.js:14284:14)
    at C:\Users\David\AppData\Roaming\npm\node_modules\prettier\index.js:59304:12
    at Object.format (C:\Users\David\AppData\Roaming\npm\node_modules\prettier\index.js:59324:12)
    at performFormat (C:\Users\David\AppData\Roaming\JetBrains\IntelliJIdea2021.2\plugins\prettierJS\prettierLanguageService\prettier-plugin.js:66:29)
Process finished with exit code -1

file i want formated :

package com.mmorpg.meatwork.entity

import com.j256.ormlite.field.DatabaseField
import mmorpg.meatwork.entity.AbstractModel

import javax.persistence.*

@Entity(name = "npc_dialogs")
data class NpcDialogs(
    @Column var responses: String,
    @Column var params: String,
    @Column var cond: String,
    @Column var ifFalse: String,
    @Column var description: String
) : AbstractModel() {

    constructor() : this("", "", "", "", "")

    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE)
    @DatabaseField(generatedIdSequence = "npc_dialogs_seq")
    @Column
    override var id: Long = 0

}
shrralis commented 1 year ago

Same problem here, it seems to be impossible using this plugin unfortunately 😢

JensWinkler91 commented 5 months ago

I receive the same error. @Angry-Potato: Is there any chance that this bug will be fixed?

sw-tracker commented 4 months ago

is this plugin dead?