Xcode crashes when replacing buffer in a source editor extension

Originator:kpa
Number:rdar://29001007 Date Originated:
Status:Duplicate (27980447) Resolved:
Product:Developer Tools Product Version:8.1
Classification:Serious Bug Reproducible:Always
 
Summary:
Xcode crashes when replacing buffer in a source editor extension.

Steps to Reproduce:
In an editor extension set `invocation.buffer.completeBuffer = ""`


Expected Results:
The buffer to be empty


Actual Results:
Xcode crashes


Version:
8.1

Notes:
The crasher seems to happen when setting completeBuffer. This also crashes:

    let newBuffer = invocation.buffer.completeBuffer
    invocation.buffer.completeBuffer = newBuffer

Whereas removing all lines works as expected:

    invocation.buffer.lines.removeAllObjects()

Sample project and crash report attached

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!