Search code examples
smalltalkpharo

How to fix the auto code formatting in Pharo?


When I save a method and get back to it later, all of my variable names become temp and all of my parameters becomes arg and the code indentation get changed. Any thoughts on how I can fix this?


Solution

  • The behaviour that you are experiencing is not code formatting at all. You immage is experiencing an issue where it can't access original source code. Thus it uses a backup solution and decomples method bytecode. During the compilation process the variable names are erased, so they can't be re-created during the decompilation, and generic substitudes are used instead.

    Now, why you are missing sources is another question. First of all it's important to check if you get some exceptions. Often these happen when you open or save your image, but also thaty may occur when you save methods.

    Depending on the Pharo version you may be missing .changes or .sources files. This often happens when you more an image without moving other supporting files.