Xcode Crashes in Uncommited Changes Editor

Hello i recently noticed that i cannot do commits in Xcode because when viewing certain files in xcode it just closes.

Through Console App i can find a crash report i think the interesting part is the following:

-------------------------------------
Translated Report (Full Report Below)
-------------------------------------

Process:               Xcode [20882]
Path:                  /Applications/Xcode.app/Contents/MacOS/Xcode
Identifier:            com.apple.dt.Xcode
Version:               15.0.1 (22266)
Build Info:            IDEApplication-22266000000000000~15 (15A507)
App Item ID:           497799835
App External ID:       860559424
Code Type:             X86-64 (Native)
Parent Process:        launchd [1]
User ID:               501

Date/Time:             2023-12-05 09:54:10.4014 +0100
OS Version:            macOS 13.6.1 (22G313)
Report Version:        12
Bridge OS Version:     3.0 (14Y910)
Anonymous UUID:        89B2C43B-7387-5700-4DCB-B81C57F74CCD

Sleep/Wake UUID:       B06BCCD2-833B-4632-A255-26C7EA819118

Time Awake Since Boot: 18000 seconds
Time Since Wake:       860 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_INSTRUCTION (SIGILL)
Exception Codes:       0x0000000000000001, 0x0000000000000000

Termination Reason:    Namespace SIGNAL, Code 4 Illegal instruction: 4
Terminating Process:   exc handler [20882]

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   SourceEditor                  	       0x11a1d7b74 SourceEditorDataSource.contentRangeForLineRange(_:) + 228
1   IDEDelta                      	       0x157ce15c3 specialized Collection.map<A>(_:) + 163
2   IDEDelta                      	       0x157cddae0 SourceCodeGalleryExhibitEditor.delta_collapseToSuggestedLineRanges(for:) + 112
3   IDEDelta                      	       0x157cdf3b4 SourceCodeGalleryExhibitEditor.GalleryComparisonContextObserver.sessionDidChange(_:) + 564
4   IDEDelta                      	       0x157ca5c3d ComparisonContext.sessionDidScrapeDiffResults(_:) + 253
5   IDEDelta                      	       0x157ca5d9f @objc ComparisonContext.sessionDidScrapeDiffResults(_:) + 47
6   DeltaFoundation               	       0x1315b2d64 -[DESession _notifySessionDidScrape] + 274
7   DeltaFoundation               	       0x1315b271d -[DESession _scrapeResults] + 526
8   Foundation                    	    0x7ff81aae5743 __NSThreadPerformPerform + 177
9   CoreFoundation                	    0x7ff819c3aeba __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
10  CoreFoundation                	    0x7ff819c3ae5c __CFRunLoopDoSource0 + 157
11  CoreFoundation                	    0x7ff819c3ac35 __CFRunLoopDoSources0 + 217
12  CoreFoundation                	    0x7ff819c398bf __CFRunLoopRun + 916
13  CoreFoundation                	    0x7ff819c38ec1 CFRunLoopRunSpecific + 560
14  HIToolbox                     	    0x7ff8236baf3d RunCurrentEventLoopInMode + 292
15  HIToolbox                     	    0x7ff8236bad4e ReceiveNextEventCommon + 657
16  HIToolbox                     	    0x7ff8236baaa8 _BlockUntilNextEventMatchingListInModeWithFilter + 64
17  AppKit                        	    0x7ff81ccd525c _DPSNextEvent + 858
18  AppKit                        	    0x7ff81ccd4106 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1214
19  DVTKit                        	       0x1079fba25 -[DVTApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 366
20  AppKit                        	    0x7ff81ccc6788 -[NSApplication run] + 586
21  DVTKit                        	       0x1079faa61 -[DVTApplication run] + 54
22  AppKit                        	    0x7ff81cc9a9a1 NSApplicationMain + 817
23  dyld                          	    0x7ff81980541f start + 1903

What can i do about this?

I found out that the same crash happened when I had some range issues in localise.strings files. I mean Xcode have incorrectly defined range of changes in my strings file, and that change was at the end of file. That why there is SourceEditorDataSource.contentRangeForLineRange in logs, I think.

To handle this issue you can just move your changes somewhere in the middle of the file, so changed range would be not after the end.