Unity3d console error, jump to the corresponding line


#1

Hi guys,

I’m a unity3d dev, and I’m switching to Atom from st3. I’m on osx yosemite.
If I choose atom as the default editor in Unity preferences, atom opens up as expected, when I click on an error or warning in the Unity console.
It opens the right file but the cursor doesn’t jump to the line that has the error.

Is there a way to implement this, or is there something I’m missing?

Thanks for the help in advance!


#2

Try https://atom.io/packages/log-console


#3

@yongkangchen

Thanks for the tip!

I’ve installed log console, created the .log-console.json file in the “project” root. Then I’ve edited the file, pasted the sample code for unity and set the log path to point to the unity log file.
The console appears in atom but its empty. Any ideas?


#4

I guess you should command palette log-console:reload-config after you add or modify .log-console.json. restart atom would be ok too.
If not work still, please check two step:
1、make sure unity log file path is correct, see http://docs.unity3d.com/Manual/LogFiles.html
2、check blockSep in config file, I am use mac os x, and not sure the blockSep is the same on other platform such as win.


#5

Any question can be submit to https://github.com/yongkangchen/log-console/issues


#6

log-console:reload-config helped, now the plugin is working. It seems to be very useful, but it is not exactly what I’m looking for.

I just want to open atom from unity whenever I click inside unity’s console, and I want to open the corresponding file at the corresponding line, where the error/warning is. The same functionality when you use mono by default.


#7

Got it. You can refer they do for sublime text:


Just change the command to [task setLaunchPath:@"/usr/local/bin/atom"];


#8

This could actually work! Thank you!


#9

Is there a way to fix this without getting a whole error log thing? Just only jumping to the right line when clicking the error in Unity?

Note: I’m using OSX 10.8.


#10

Stick this in the “External Script Editing Args” of unitys preferences: "(File):(Line)"
It should give you what you want.


#11

I don’t see this option… anyone else?


#12

nvm, windows only :confused: http://docs.unity3d.com/Manual/Preferences.html


#13

This works, but it opens the files up in a new window rather than in an existing project window. Trying to figure out how to change that.


#14

Yeah disappointing. Still haven’t been able to get Atom working correctly.


#15

Anyone ever figure this out?

Atom jumps to the right file, but not the line number. :frowning:

It’s a real workflow killer to not have the ability to jump the the specific line when double-clicking on error in the Unity console.

Out of curiosity, where would I start in terms of writing a plugin to handle incoming requests from Unity? Though, I guess it would be good to determine if Unity is actually sending the line number first …

If Unity is sending the proper information to Atom (file/line #), then how would I get Atom to jump to incoming line number?

Are there any Atom plugins out there that do this for other tools? Might be good to see an example. :slightly_smiling:

Thanks!


#16

to anyone still needing this, i copied a bunch of stuff from the vscode project (https://github.com/dotBunny/VSCode) and while it’s a bit of a hack, it seems to work ok: