prettier-plugin-kotlin icon indicating copy to clipboard operation
prettier-plugin-kotlin copied to clipboard

invalid stream header

Open Taliro opened this issue 3 years ago • 3 comments

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

}

Taliro avatar Nov 20 '21 12:11 Taliro

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

shrralis avatar Mar 31 '23 15:03 shrralis

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

JensWinkler91 avatar May 19 '24 18:05 JensWinkler91

is this plugin dead?

sw-tracker avatar Jun 07 '24 10:06 sw-tracker