File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
playground/knot/src/Editor Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,8 @@ function Items({
6262 ) ;
6363 }
6464
65+ const uniqueIds : Map < string , number > = new Map ( ) ;
66+
6567 return (
6668 < ul className = "space-y-0.5 grow overflow-y-scroll" >
6769 { diagnostics . map ( ( diagnostic , index ) => {
@@ -72,8 +74,13 @@ function Items({
7274 const startLine = start ?. line ?? 1 ;
7375 const startColumn = start ?. column ?? 1 ;
7476
77+ const mostlyUniqueId = `${ startLine } :${ startColumn } -${ id } ` ;
78+
79+ const disambiguator = uniqueIds . get ( mostlyUniqueId ) ?? 0 ;
80+ uniqueIds . set ( mostlyUniqueId , disambiguator + 1 ) ;
81+
7582 return (
76- < li key = { `${ startLine } : ${ startColumn } -${ id ?? index } ` } >
83+ < li key = { `${ mostlyUniqueId } -${ disambiguator } ` } >
7784 < button
7885 onClick = { ( ) => onGoTo ( startLine , startColumn ) }
7986 className = "w-full text-start cursor-pointer select-text"
You can’t perform that action at this time.
0 commit comments