@@ -66,27 +66,28 @@ function Items({
6666 ) ;
6767 }
6868
69+ const uniqueIds : Map < string , number > = new Map ( ) ;
70+
6971 return (
7072 < ul className = "space-y-0.5 grow overflow-y-scroll" >
71- { diagnostics . map ( ( diagnostic , index ) => {
73+ { diagnostics . map ( ( diagnostic ) => {
74+ const row = diagnostic . start_location . row ;
75+ const column = diagnostic . start_location . column ;
76+ const mostlyUniqueId = `${ row } :${ column } -${ diagnostic . code } ` ;
77+
78+ const disambiguator = uniqueIds . get ( mostlyUniqueId ) ?? 0 ;
79+ uniqueIds . set ( mostlyUniqueId , disambiguator + 1 ) ;
80+
7281 return (
73- < li
74- key = { `${ diagnostic . start_location . row } :${ diagnostic . start_location . column } -${ diagnostic . code ?? index } ` }
75- >
82+ < li key = { `${ mostlyUniqueId } -${ disambiguator } ` } >
7683 < button
77- onClick = { ( ) =>
78- onGoTo (
79- diagnostic . start_location . row ,
80- diagnostic . start_location . column ,
81- )
82- }
84+ onClick = { ( ) => onGoTo ( row , column ) }
8385 className = "w-full text-start cursor-pointer select-text"
8486 >
8587 { diagnostic . message } { " " }
8688 < span className = "text-gray-500" >
87- { diagnostic . code != null && `(${ diagnostic . code } )` } [Ln{ " " }
88- { diagnostic . start_location . row } , Col{ " " }
89- { diagnostic . start_location . column } ]
89+ { diagnostic . code != null && `(${ diagnostic . code } )` } [Ln { row } ,
90+ Col { column } ]
9091 </ span >
9192 </ button >
9293 </ li >
0 commit comments