When installing the excellent Atom Editor with Platformio-ide, the main window inside the editor would hang on my new Mac. I uninstalled the program and deleted the
.atom directory and tried to reinstall, the application would freeze the main window, and I had to force-quit the program. After a lot of experiments, I finally found a way to fix the problem.
(Having a problem with the Atom editor asking to restart over and over? Jump over here)
How to fix Atom Editor from freezing up when installing platformio-ide
The fix we are going to try will delete all the installed modules and settings, but it’s the only way I managed to get it to work.
Open the Terminal application and type the following commands:
cd sudo rm -r .atom/
These commands will remove any remnants of earlier installations.
Start the Atom Editor. It will recreate the .atom directory, which we will need.
Quit the Atom editor.
Go back to the Terminal application so we can install some needed packages manually. Write the following into the Terminal window:
apm install build platformio-ide-terminal platformio-ide-debugger autocomplete-clang linter-gcc2 language-ini tool-bar linter-ui-default intentions linter file-icons busy-signal
Now we have all the requisite libraries we need to install platformio-ide. But there is a bug in the script that checks that the installation is complete. The script checks to see if you have clang installed. Check that you have clang installed. It comes installed with the XCode developer kit. Check if it’s available with the following command:
You should get a response similar back in the terminal window:
Apple clang version 11.0.3 (clang-1188.8.131.52) Target: x86_64-apple-darwin19.5.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
Now you can start the Atom Editor. Go to “Install a package” and search for platformio-ide. Press install. You are now going to find another bug in Atom.
The dreaded “PlatformIO IDE has been successfully installed!” and “Please restart Atom to apply the changes.”
Unfortunately, when you restart the application, the same pesky dialog box comes up again! You can keep on pressing the restart button again and again, but the installation will never finish.
Just quit the Atom Editor for now, and let’s fix the installation bug.
Fixing the Atom Editor restart loop
code-completion-engine.jswhich you can find here:
open the file code-completion-engine.js with your favorite text editor. Replace the following text at line 42:
clang_installed = await this.clangInstalled();
clang_installed = 1;
We are fooling the program to think that the check for clang completed successfully, thus never running the code that doesn’t work.
If you start the Atom Editor now, everything should be up and running.
Hopefully, they’ll fix this bug. Many people on other platforms, like Linux and Windows, have a similar question, but I’ve only tried it on, Macintosh.