@@ -2,15 +2,15 @@ use std::borrow::Cow;
22use std:: collections:: BTreeMap ;
33use std:: path:: Path ;
44
5+ use full:: FullRenderer ;
56use ruff_annotate_snippets:: {
67 Annotation as AnnotateAnnotation , Level as AnnotateLevel , Message as AnnotateMessage ,
7- Renderer as AnnotateRenderer , Snippet as AnnotateSnippet ,
8+ Snippet as AnnotateSnippet ,
89} ;
910use ruff_notebook:: { Notebook , NotebookIndex } ;
1011use ruff_source_file:: { LineIndex , OneIndexed , SourceCode } ;
1112use ruff_text_size:: { TextLen , TextRange , TextSize } ;
1213
13- use crate :: diagnostic:: stylesheet:: DiagnosticStylesheet ;
1414use crate :: {
1515 Db ,
1616 files:: File ,
@@ -111,37 +111,7 @@ impl std::fmt::Display for DisplayDiagnostics<'_> {
111111 ConciseRenderer :: new ( self . resolver , self . config ) . render ( f, self . diagnostics ) ?;
112112 }
113113 DiagnosticFormat :: Full => {
114- let stylesheet = if self . config . color {
115- DiagnosticStylesheet :: styled ( )
116- } else {
117- DiagnosticStylesheet :: plain ( )
118- } ;
119-
120- let mut renderer = if self . config . color {
121- AnnotateRenderer :: styled ( )
122- } else {
123- AnnotateRenderer :: plain ( )
124- }
125- . cut_indicator ( "…" ) ;
126-
127- renderer = renderer
128- . error ( stylesheet. error )
129- . warning ( stylesheet. warning )
130- . info ( stylesheet. info )
131- . note ( stylesheet. note )
132- . help ( stylesheet. help )
133- . line_no ( stylesheet. line_no )
134- . emphasis ( stylesheet. emphasis )
135- . none ( stylesheet. none ) ;
136-
137- for diag in self . diagnostics {
138- let resolved = Resolved :: new ( self . resolver , diag, self . config ) ;
139- let renderable = resolved. to_renderable ( self . config . context ) ;
140- for diag in renderable. diagnostics . iter ( ) {
141- writeln ! ( f, "{}" , renderer. render( diag. to_annotate( ) ) ) ?;
142- }
143- writeln ! ( f) ?;
144- }
114+ FullRenderer :: new ( self . resolver , self . config ) . render ( f, self . diagnostics ) ?;
145115 }
146116 DiagnosticFormat :: Azure => {
147117 AzureRenderer :: new ( self . resolver ) . render ( f, self . diagnostics ) ?;
0 commit comments