File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -264,10 +264,16 @@ private void Emit(CompileResult result)
264264 }
265265 }
266266
267- private static string GetDiagnosticString ( Diagnostic diagnostic , string type )
267+ private string GetDiagnosticString ( Diagnostic diagnostic , string type )
268268 {
269269 var line = diagnostic . Location . GetLineSpan ( ) ;
270- return $ "{ line . Path } ({ line . StartLinePosition . Line + 1 } ,{ line . StartLinePosition . Character + 1 } ): " + $ "{ type } { diagnostic . Id } : { diagnostic . GetMessage ( ) } ";
270+
271+ // Unity3d must have a relative path starting with "Assets/".
272+ var path = ( line . Path . StartsWith ( _options . WorkDirectory + "/" ) || line . Path . StartsWith ( _options . WorkDirectory + "\\ " ) )
273+ ? line . Path . Substring ( _options . WorkDirectory . Length + 1 )
274+ : line . Path ;
275+
276+ return $ "{ path } ({ line . StartLinePosition . Line + 1 } ,{ line . StartLinePosition . Character + 1 } ): " + $ "{ type } { diagnostic . Id } : { diagnostic . GetMessage ( ) } ";
271277 }
272278
273279 public static int ConvertPdb2Mdb ( string dllFile )
You can’t perform that action at this time.
0 commit comments