eclipse-archived / ceylon-web-ide-backend

The Ceylon Web IDE
http://try.ceylon-lang.org/
Apache License 2.0
25 stars 11 forks source link

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

Open tombentley opened 8 years ago

tombentley commented 8 years ago

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.

bjansen commented 8 years ago

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.

tombentley commented 8 years ago

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 commented 8 years ago

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.

jvasileff commented 8 years ago

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.