eclipse-archived / ceylon.formatter

A formatter for the Ceylon programming language, written in Ceylon.
Apache License 2.0
14 stars 11 forks source link

Formatter produce invalid code for string interpolation with metainfo #136

Closed MikhailMalyutin closed 7 years ago

MikhailMalyutin commented 7 years ago

Next code:

shared void subscribeToDownUpConversion<D, T>(HashMap<Key,T> convertedCache, T(D) adaptFunction) given T satisfies BaseEntity
        given D satisfies BaseEntity {
    ebSubscribe<D>(getUpVersionTopic(`D`)).subscribe((key-> D user) {
        log.info("Down to up conversion from`` `D`.string`` to `` `T`.string`` ``user``");
        convertedCache.put(user.id, adaptFunction(user));
    });
}

Of I try to reformat - I obtain invalid code:

shared void subscribeToDownUpConversion<D, T>(HashMap<Key,T> convertedCache, T(D) adaptFunction) given T satisfies BaseEntity
        given D satisfies BaseEntity {
    ebSubscribe<D>(getUpVersionTopic(`D`)).subscribe((key-> D user) {
        log.info("Down to up conversion from```D`.string`` to ```T`.string`` ``user``");
        convertedCache.put(user.id, adaptFunction(user));
    });
}
lucaswerkmeister commented 7 years ago

I can’t reproduce this – both on 1.3.2 and on current master, the string template remains correct. Can you tell me a bit more about the situation where you’re getting this?

(For the record, this bug used to exist, but I fixed it ages ago, before even the first release: see #47.)

MikhailMalyutin commented 7 years ago

May be this is not formatter, but IDEA plugin. I reformat the code in IDEA

lucaswerkmeister commented 7 years ago

Yeah, the IntelliJ plugin doesn’t use ceylon.formatter. Please open an issue in ceylon/ceylon-ide-intellij.