package Ġcom . jetbrains . fort ea . configuration . impl Ċ Ċ import Ġcom . intellij . openapi . application . Application Ċ import Ġcom . intellij . openapi . project . Project Ċ import Ġcom . jetbrains . fort ea . configuration . T 4 Build Session View Ċ import Ġcom . jetbrains . fort ea . configuration . T 4 Build Tool Window Factory Ċ import Ġcom . jetbrains . fort ea . configuration . to Build Result Kind Ċ import Ġcom . jetbrains . fort ea . model . T 4 Build Message Ċ import Ġcom . jetbrains . fort ea . model . T 4 Build Message Kind Ċ import Ġcom . jetbrains . fort ea . model . T 4 Build Result Ċ import Ġcom . jetbrains . fort ea . model . T 4 Pre processing Result Ċ import Ġcom . jetbrains . rd . platform . util . idea . Lifetime d Project Service Ċ import Ġcom . jetbrains . rd . util . reactive . View able Map Ċ import Ġcom . jetbrains . r ider . build . Build Tool Window Context Ċ import Ġcom . jetbrains . r ider . build . diagnostics . Build Diagnostic Ċ import Ġcom . jetbrains . r ider . build . diagnostics . Diagnostic Kind Ċ import Ġcom . jetbrains . r ider . model .* Ċ Ċ class ĠT 4 Build Session View Impl ( ĊĠ Ġproject : ĠProject , ĊĠ Ġprivate Ġval Ġwindow Factory : ĠT 4 Build Tool Window Factory , ĊĠ Ġprivate Ġval Ġapplication : ĠApplication Ċ ) Ġ: ĠL ifetime d Project Service ( project ), ĠT 4 Build Session View Ġ{ ĊĠ Ġoverride Ġfun Ġopen Window ( message : ĠString ) Ġ= Ġapplication . invoke Later Ġ{ ĊĠĠĠ Ġval Ġcontext Ġ= Ġinitialize Context ( Executing T 4 Build Header ) ĊĠĠĠ Ġcontext . clear () ĊĠĠĠ Ġcontext . show Tool Window If Hidden ( true ) ĊĠĠĠ Ġval Ġbuild Event Ġ= ĠMessage Build Event ( null , ĠBuild Message Kind . Message , Ġmessage ) ĊĠĠĠ Ġcontext . add Output Message ( build Event , ĠView able Map ()) ĊĠĠĠ Ġcontext . invalidate Panel Mode () ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġshow T 4 Build Result ( result : ĠT 4 Build Result , Ġfile : ĠString ) Ġ= Ġapplication . invoke Later Ġ{ ĊĠĠĠ Ġval Ġcontext Ġ= Ġinitialize Context ( Executing T 4 Build Header ) ĊĠĠĠ Ġcontext . update Status ( result . build Result Kind . to Build Result Kind , ĠT 4 Build Header ) ĊĠĠĠ Ġshow Messages ( result , Ġfile , Ġcontext ) ĊĠĠĠ Ġcontext . invalidate Panel Mode () ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġshow T 4 Pre processing Result ( result : ĠT 4 Pre processing Result , Ġfile : ĠString ) Ġ= Ġapplication . invoke Later Ġ{ ĊĠĠĠ Ġval Ġcontext Ġ= Ġinitialize Context ( Pre processing T 4 Header ) ĊĠĠĠ Ġval Ġsucceeded Ġ= ĊĠĠĠĠĠ Ġif Ġ( result . succeeded ) ĠBuild Result Kind . Successful ĊĠĠĠĠĠ Ġelse ĠBuild Result Kind . Has Errors ĊĠĠĠ Ġcontext . update Status ( succeeded , ĠT 4 Pre processing Header ) ĊĠĠĠ Ġresult . message . map Ġ{ Ġto Build Diagnostic ( it , Ġfile ) Ġ}. forEach ( context :: add Build Event ) ĊĠĠĠ Ġcontext . invalidate Panel Mode () ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġshow Messages ( ĊĠĠĠ Ġresult : ĠT 4 Build Result , ĊĠĠĠ Ġfile : ĠString , ĊĠĠĠ Ġcontext : ĠBuild Tool Window Context ĊĠ Ġ) Ġ= Ġresult . messages . map Ġ{ ĊĠĠĠ Ġto Build Diagnostic ( it , Ġfile ) ĊĠ Ġ}. forEach ( context :: add Build Event ) ĊĊĠ Ġprivate Ġfun Ġinitialize Context ( window Header : ĠString ): ĠBuild Tool Window Context Ġ{ ĊĠĠĠ Ġval Ġcontext Ġ= Ġwindow Factory . get OrCreate Context ( window Header ) ĊĠĠĠ Ġif Ġ(! context . isActive ) Ġcontext . show Tool Window If Hidden ( true ) ĊĠĠĠ Ġreturn Ġcontext ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġto Build Diagnostic ( ĊĠĠĠ Ġmessage : ĠT 4 Build Message , ĊĠĠĠ Ġfile : ĠString ĊĠ Ġ): ĠBuild Diagnostic Ġ{ ĊĠĠĠ Ġval Ġkind Ġ= Ġto Diagnostic Kind ( message . build Message Kind ) ĊĠĠĠ Ġval Ġline Ġ= Ġmessage . location . line Ġ+ Ġ 1 ĊĠĠĠ Ġval Ġcolumn Ġ= Ġmessage . location . column Ġ+ Ġ 1 ĊĠĠĠ Ġval ĠfilePath Ġ= Ġif Ġ(! message . file . isNull OrEmpty ()) Ġmessage . file Ġelse Ġfile ĊĠĠĠ Ġreturn ĠBuild Diagnostic ( kind , Ġmessage . content , Ġmessage . id , Ġmessage . projectId , Ġnull , ĠfilePath , Ġline , Ġcolumn ) ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġto Diagnostic Kind ( kind : ĠT 4 Build Message Kind ) Ġ= Ġwhen Ġ( kind ) Ġ{ ĊĠĠĠ ĠT 4 Build Message Kind . Error Ġ-> ĠDiagnostic Kind . Error ĊĠĠĠ ĠT 4 Build Message Kind . Warning Ġ-> ĠDiagnostic Kind . Warning ĊĠĠĠ ĠT 4 Build Message Kind . Message Ġ-> ĠDiagnostic Kind . Warning Ġ// Ġ? ĊĠĠĠ ĠT 4 Build Message Kind . Success Ġ-> ĠDiagnostic Kind . Warning Ġ// Ġ? ĊĠ Ġ} ĊĊĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠ Ġconst Ġval ĠExec uting T 4 Build Header Ġ= Ġ" Executing ĠT 4 ĠBuild ..." ĊĠĠĠ Ġconst Ġval ĠPre processing T 4 Header Ġ= Ġ" Pre processing ĠT 4 ..." ĊĠĠĠ Ġconst Ġval ĠT 4 Build Header Ġ= Ġ" T 4 ĠBuild " ĊĠĠĠ Ġconst Ġval ĠT 4 Pre processing Header Ġ= Ġ" T 4 ĠPre processing " ĊĠ Ġ} Ċ } Ċ