Search Unity

Atom editor with Unity

Discussion in 'External Tools' started by LemonLimeGames, Jul 8, 2017.

  1. LemonLimeGames

    LemonLimeGames

    Joined:
    Jul 8, 2014
    Posts:
    15
    I use Atom.io as a text editor and Unity won't open files when I select it as my main text editor. It opens Atom, but a blank page, not the actual file.
     
  2. larku

    larku

    Joined:
    Mar 14, 2013
    Posts:
    1,411
  3. LemonLimeGames

    LemonLimeGames

    Joined:
    Jul 8, 2014
    Posts:
    15
  4. larku

    larku

    Joined:
    Mar 14, 2013
    Posts:
    1,411
    You'll need to give far more details if you're wanting help.

    How are you invoking it?
    What platform are you using?
    What version of Unity are you using?
    What have you tried?

    etc.
     
  5. LemonLimeGames

    LemonLimeGames

    Joined:
    Jul 8, 2014
    Posts:
    15
    That would probably help wouldn't it? I'm using Windows 10, unity 5.6. I went to preferences>external tools and changed the default text editor to Atom. I'm not sure if there are any other steps I need to perform?
     
  6. larku

    larku

    Joined:
    Mar 14, 2013
    Posts:
    1,411
    Can you show exactly how you're invoking it? What binary did you point it to?
     
  7. eses

    eses

    Joined:
    Feb 26, 2013
    Posts:
    1,263
    @Sexy-Stache-Studios

    - Just asking,

    why not just use VS Code instead?

    Is it just that you want to use Atom instead ?
     
  8. LemonLimeGames

    LemonLimeGames

    Joined:
    Jul 8, 2014
    Posts:
    15
    I apologize, I'm almost a complete Unity noob, you lost me there bud.

    Yeah, I just prefer Atom, I love its flexibility.
     
  9. mystman12

    mystman12

    Joined:
    Jul 20, 2017
    Posts:
    3
    I'm trying to do the same thing too. I want to use Atom just because I'm familiar with it, and Visual Studio just didn't run well at all. I've done exactly what the OP has, changed the default external script editor to "Atom.exe". When I try to open scripts, however, it opens Atom, but not with the script. The external script editor args box contains ""$(File)"". (The inner quotes included.) I have no idea what that means though, I'm a total noob to Unity as well.

    Edit: Wait, nevermind, the link larku posted is the solution. I was using the .exe in the "atom" folder, not the one in the folder for the latest version. Op, find the atom folder ("C:\Users\Username\AppData\Local\atom") and then continue to the folder named "app-1.##.#" with the highest number (My atom folder had "app-1.15.0" and "app-1.16.0". I used 1.16.)
     
    Last edited: Jul 20, 2017
    LemonLimeGames and larku like this.
  10. GamerWang

    GamerWang

    Joined:
    Jun 25, 2017
    Posts:
    1
    Edit-Preferences-External Tools
    open External Script Editor and find atom root
    replace the default External Script Editor Args with this: n -a "$(ProjectPath)" "$(File)"
    hope it helps
     
    Overnaut and LemonLimeGames like this.
  11. Overnaut

    Overnaut

    Joined:
    Aug 25, 2017
    Posts:
    19
    I did exactly this, path to atom 1.19.2 x64 on Ubuntu 17.04 is:
    Code (csharp):
    1. /usr/bin/atom
    and I use Unity 3D 2017.2 for Linux which worked fine. But now I cannot edit my scripts, nothing happens on selection, double click, or open. But it gets worse, when I change the editor back to MonoDevelop (buildin) still nothing is happening on open script.

    I remember before any change only internal was selected as External Script Editor but now I only can choose between MonoDevelop (buildin) and atom.
     
    Last edited: Aug 25, 2017
    Ekwav likes this.
  12. dlurner

    dlurner

    Joined:
    Jan 5, 2018
    Posts:
    1
    To get it working on macOS (10.13.2) I:
    1. Used Atom 1.23.1 (the version Ihad installed) and Unity 2017.3.0f3 Personal.
    2. In Unity > Preferences (Edit > Preferences on Windows IIRC) on the External Tools tab I selected Atom by choosing the Browse… item from the External Script Editor dropdown menu and navigating to the Atom app (/Applications/Atom.app) in the file picker. At this point you can test and Unity should launch Atom, but Atom won't open with your file.
    3. To get it to open your file you need to set the External Script Editor Args, I used the arguments suggested by @GamerWang but added a leading dash before the 'n' – I'm pretty sure the omission was a "cut-and-paste o" in their post. My final preferences ended up looking like this: Screen Shot 2018-01-06 at 2.05.04 PM.png
     
    Last edited: Jan 7, 2018
    Lars-Steenhoff likes this.
  13. eses

    eses

    Joined:
    Feb 26, 2013
    Posts:
    1,263
    hi,

    I have been following this thread...

    In December I started to have problems with VS Code + autocomplete (something with omnisharp), so I decided to try Atom. I do use it occasionally for other stuff.

    I thought I'd need omnisharp for Atom/C# unity auto completion... I didn't find much info about this, so I just went ahead and installed it.

    However, I get errors related to omnisharp, when I open Atom. Same happens if I open C# file from Unity with Atom as external editor.

    "Uncaught TypeError: atom.grammars.startIdForScope is not a function..."

    I'm using latest Atom 1.24.0-beta2 x64, Win10 Pro, Unity 2017.3.0p1
     
  14. eses

    eses

    Joined:
    Feb 26, 2013
    Posts:
    1,263
    ...Bump

    Anyone actually got Atom working properly with OmniSharp now in 2018?

    I've tried Atom 1.23.3 / omnisharp-atom 0.31.2 / Windows 10 Pro x64

    Does not seem to be working, can't get the omnisharp icon turn green / activate omnisharp.

    If I try to Start / restart Omnisharp in Atom, I get the previously mentioned Uncaught TypeError.

    And like I mentioned, in the latest Atom 1.24.0-beta2 or 1.24.0-beta3 x64 - Same thing, omnisharp does not start, but different error message.

    I've also tried Sublime Text 3, in it's implementation omnisharp works just fine. I can get autocomplete/intellisense stuff, and omnisharp commands too work. So maybe Sublime Text addon does something differently.
     
  15. Overnaut

    Overnaut

    Joined:
    Aug 25, 2017
    Posts:
    19
    I managed to work with the Atom Editor and Unity on Windows 10, due to unvesolvable Unity Linux Editor bugs, when I enter in
    Code (CSharp):
    1. Unity/Edit/Prefences/External Tools
    under External Script Editor:
    Code (CSharp):
    1. C:\Users\MY_USERNAME\AppData\Local\atom\atom.exe
    and paste in External Script Editor Args:
    Code (CSharp):
    1. -n -a "$(ProjectPath)" "$(File):$(Line)"
    /Edit: Line support, just double click on the error console to open the file on the line where error occurs.
     
    Last edited: Jan 31, 2018
    epiccharliegao likes this.
  16. obuga

    obuga

    Joined:
    Sep 3, 2019
    Posts:
    1
    So I was having problems with opening Atom when double clicking on a cs file in Unity, even after having this arguments:
    Code (CSharp):
    1. -n -a "$(ProjectPath)" "$(File):$(Line)"
    What solved the problem, is removing the "-a" argument. So now it looks like:
    Code (CSharp):
    1. -n "$(ProjectPath)" "$(File):$(Line)"
    Atom version: 1.40.1
    Unity vesion: 2019.2.4f