SaladLab/Unity3D.IncrementalCompiler

Console stacktrace double click not working due to absolute paths in messages

Closed this issue · 3 comments

Unity version: 5.3.5f1
Incremental Compiler version: 1.2.5
Issue occurs with compiler Incremental6, but not with Mono3. It also does not occur if the IncrementalCompiler is not installed (not a Unity bug).

How to reproduce
Simply create a new project and add the IncrementalCompiler 1.2.5 set to use the Incremental6 compiler. Have a script generate a warning and try double clicking the warning in the console. It will do nothing.

Investigation
I Created a simple script with a field x, which I assigned but never used. This generates a warning. Without using the Unity3D.IncrementalCompiler at all, the default behavior for Unity when we single click the error on the console is to highlight the corresponding script.
Double clicking should open the configured editor (usually Visual Studio) at the offending line.

Without using the IncrementalCompiler at all, this works nicely. The same when using Mono3 in the compiler settings.
The warning generated in those cases is like this:

Assets/AAA.cs(7,9): warning CS0414: The field 'AAA.x' is assigned but its value is never used

But, when using Incremetal6, the warning is like this:

V:\tmp\TESTING\Assets/AAAZ.cs(7,9): warning CS0414: The field 'AAA.x' is assigned but its value is never used

This breaks Unity's internal AssetDatabase so it no longer can highlight the offending script, neither can it open the script in the editor. In the default console, no error or warning will be shown. It will simply do nothing.

To try to investigate it a bit further, I imported an enhanced console I regularly use (Editor Console Pro). This enhanced console, then, gave me the proper warning that Unity was not showing. When double clicking the warning, I got this:

Invalid AssetDatabase path: V:\tmp\TESTING\Assets/AAA.cs. Use path relative to the project folder.

The gist is that Unity can only deal with assets on paths relative to the Assets folder, but the IncrementalCompiler is somehow outputting messages with absolute paths when compiling.

One more test: I downloaded a fresh copy of alexzzzz's C# 6.0 compiler for Unity and confirmed that it does not suffer from this issue.

Thanks for report and detailed investigation! 👍 It should've worked like what you said but this bug sneaked in while working on Support Visual Studio Code. This bug is fixed 1.2.6 and please try it.

Just tested 1.2.6 and the issue is gone!

Thanks for the quick fix!