@@ -15,7 +15,7 @@ if (process.platform !== 'linux') {
1515 console . warn ( 'node-pty not available on Linux — using child_process fallback for terminal' ) ;
1616}
1717import { FileHandler , filterLineToVisibleColumns , ColumnConfig } from './fileHandler' ;
18- import { IPC , SearchOptions , Bookmark , Highlight , HighlightGroup , SearchConfig , SearchConfigSession , ActivityEntry , LocalFileData , LiveConnectionInfo , ContextDefinition , ContextPattern , ContextMatchGroup , Annotation } from '../shared/types' ;
18+ import { IPC , SearchOptions , Bookmark , Highlight , HighlightGroup , SearchConfig , SearchConfigSession , ActivityEntry , LocalFileData , ContextDefinition , ContextMatchGroup , Annotation } from '../shared/types' ;
1919import * as Diff from 'diff' ;
2020import { analyzerRegistry , AnalyzerOptions , AnalysisResult } from './analyzers' ;
2121import { loadDatadogConfig , saveDatadogConfig , clearDatadogConfig , fetchDatadogLogs , DatadogConfig , DatadogFetchParams } from './datadogClient' ;
@@ -1348,7 +1348,6 @@ app.whenReady().then(() => {
13481348 // Scan the range
13491349 const levelCounts : Record < string , number > = { } ;
13501350 const crashes : { lineNumber : number ; keyword : string ; text : string } [ ] = [ ] ;
1351- const componentMentions : Record < string , { lineCount : number ; errorCount : number } > = { } ;
13521351 const CRASH_KEYWORDS = [ 'fatal' , 'panic' , 'crash' , 'exception' , 'segfault' , 'abort' , 'oom' , 'killed' , 'core dump' ] ;
13531352 const timeGaps : { lineNumber : number ; gapSeconds : number ; prevTimestamp : string ; currTimestamp : string } [ ] = [ ] ;
13541353 let prevTimestamp : Date | null = null ;
@@ -2593,7 +2592,6 @@ ipcMain.handle(IPC.SEARCH, async (_, options: SearchOptions) => {
25932592
25942593 // Check for hidden column matches (matches in columns that are filtered out)
25952594 if ( options . columnConfig ) {
2596- const visibleCols = options . columnConfig . columns . filter ( c => c . visible ) . map ( c => c . index ) ;
25972595 const hiddenCols = options . columnConfig . columns . filter ( c => ! c . visible ) . map ( c => c . index ) ;
25982596 if ( hiddenCols . length > 0 ) {
25992597 // Do a full-text search (without column config) to find matches in hidden columns
@@ -4521,70 +4519,11 @@ interface TimeGap {
45214519 linePreview : string ;
45224520}
45234521
4524- // Timestamp patterns for parsing
4525- const TIME_GAP_PATTERNS = [
4526- // ISO format: 2024-01-25T10:00:01 or 2024-01-25 10:00:01
4527- / ( \d { 4 } ) - ( \d { 2 } ) - ( \d { 2 } ) [ T ] ( \d { 2 } ) : ( \d { 2 } ) : ( \d { 2 } ) / ,
4528- // European format: DD.MM.YYYY HH:mm:ss (e.g., 02.01.2026 18:16:01.061)
4529- / ( \d { 2 } ) \. ( \d { 2 } ) \. ( \d { 4 } ) \s + ( \d { 2 } ) : ( \d { 2 } ) : ( \d { 2 } ) / ,
4530- // Syslog format: Jan 25 10:00:01 (assumes current year)
4531- / ( [ A - Z ] [ a - z ] { 2 } ) \s + ( \d { 1 , 2 } ) \s + ( \d { 2 } ) : ( \d { 2 } ) : ( \d { 2 } ) / ,
4532- ] ;
4533-
45344522const MONTH_MAP : Record < string , number > = {
45354523 'Jan' : 0 , 'Feb' : 1 , 'Mar' : 2 , 'Apr' : 3 , 'May' : 4 , 'Jun' : 5 ,
45364524 'Jul' : 6 , 'Aug' : 7 , 'Sep' : 8 , 'Oct' : 9 , 'Nov' : 10 , 'Dec' : 11
45374525} ;
45384526
4539- function parseTimestamp ( text : string ) : Date | null {
4540- const sample = text . length > 100 ? text . substring ( 0 , 100 ) : text ;
4541-
4542- // Try ISO format first
4543- const isoMatch = sample . match ( TIME_GAP_PATTERNS [ 0 ] ) ;
4544- if ( isoMatch ) {
4545- const [ , year , month , day , hour , min , sec ] = isoMatch ;
4546- return new Date (
4547- parseInt ( year ) , parseInt ( month ) - 1 , parseInt ( day ) ,
4548- parseInt ( hour ) , parseInt ( min ) , parseInt ( sec )
4549- ) ;
4550- }
4551-
4552- // Try European format: DD.MM.YYYY HH:mm:ss
4553- const euroMatch = sample . match ( TIME_GAP_PATTERNS [ 1 ] ) ;
4554- if ( euroMatch ) {
4555- const [ , day , month , year , hour , min , sec ] = euroMatch ;
4556- return new Date (
4557- parseInt ( year ) , parseInt ( month ) - 1 , parseInt ( day ) ,
4558- parseInt ( hour ) , parseInt ( min ) , parseInt ( sec )
4559- ) ;
4560- }
4561-
4562- // Try syslog format
4563- const syslogMatch = sample . match ( TIME_GAP_PATTERNS [ 2 ] ) ;
4564- if ( syslogMatch ) {
4565- const [ , monthStr , day , hour , min , sec ] = syslogMatch ;
4566- const month = MONTH_MAP [ monthStr ] ;
4567- if ( month !== undefined ) {
4568- const now = new Date ( ) ;
4569- return new Date (
4570- now . getFullYear ( ) , month , parseInt ( day ) ,
4571- parseInt ( hour ) , parseInt ( min ) , parseInt ( sec )
4572- ) ;
4573- }
4574- }
4575-
4576- return null ;
4577- }
4578-
4579- function extractTimestampString ( text : string ) : string | null {
4580- const sample = text . length > 100 ? text . substring ( 0 , 100 ) : text ;
4581- for ( const pattern of TIME_GAP_PATTERNS ) {
4582- const match = sample . match ( pattern ) ;
4583- if ( match ) return match [ 0 ] ;
4584- }
4585- return null ;
4586- }
4587-
45884527interface TimeGapOptions {
45894528 thresholdSeconds : number ;
45904529 startLine ?: number ;
0 commit comments