ceylon-web-ide-backend icon indicating copy to clipboard operation
ceylon-web-ide-backend copied to clipboard

Multi-byte unicode char leads to multi-line string alignment error

Open tombentley opened this issue 8 years ago • 4 comments

Per https://github.com/ceylon/ceylon/issues/6284, and as shown by http://try.ceylon-lang.org/?gist=9b84d5688cef18c56bfa685efbedf3fd, a multi-byte character seems to upset the parser.

tombentley avatar May 19 '16 09:05 tombentley

As mentioned in https://github.com/ceylon/ceylon-ide-intellij/issues/153, this is because the indent is made of 1 tab + 3 spaces instead of 7 spaces. If the tab is replaced with 4 spaces, the problem disappears, so I don't think it's a bug.

bjansen avatar May 19 '16 11:05 bjansen

If that's the case surely tab in the web IDE should insert spaces and not tabs? And the error should be clear that there are tabs and spaces in the indentation.

tombentley avatar May 19 '16 12:05 tombentley

So it only worked in Eclipse because when I copied and pasted Eclipse kindly converted the tab into spaces.

Amusingly I can appease the typechecker by inserting extra spaces:

shared void m() {
    print("Hello ❄
              world!");
}

So it now looks unaligned in the source, but prints aligned when run.

tombentley avatar May 19 '16 12:05 tombentley

the web IDE should insert spaces and not tabs

👍. I've also had tab alignment issues with the way code appears in gists vs. the web ide.

jvasileff avatar May 19 '16 13:05 jvasileff