Question

In Pharo 2.0 image, when i try to format my code on nautilus browser i get the code scrambled in an unexpected way.

For example

testStrings
| a b |
a := 'AAAAA'.
b := 'BBBBB'.
^a,b

If this method is typed and after saving, try to format it. What i got was this, note the duplicated string-

testStrings
    | a b |
    b := 'BBBBB'.
    b := 'BBBBB'.
    ^ a , b.

Has anyone come across this before? Any way out of this?

Was it helpful?

Solution

I had the AST-Core package reloaded from the repo and the problem was solved. it seems something i loaded in the image caused some of the AST classes(like RBLiteralValueNode) to move to Unclassified package, and also some instance vars were undeclared. This cause the formatting statemets preparation to fail. however on loading all latest it solved the issue.

OTHER TIPS

I tried to reproduce this problem in the latest Pharo 2.0 and I could not... it formats perfectly fine.

Do you load any other packages in addition? Maybe something that breaks the AST formatter?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top