Files
swift-mirror/test/SourceKit/CursorInfo/cursor_after_edit.swift
Ben Barham ab95dba720 [CursorInfo] Pass primary path to allow comparing previous ASTs
Update the cursor requests to also pass in their primary file. Snapshots
should be compared using this file, not the input buffer name. This
fixes AST re-use when the AST is usable with snapshots.

Resolves rdar://110344363.
2023-06-23 20:00:19 -07:00

12 lines
591 B
Swift

// RUN: %empty-directory(%t)
// RUN: touch %t/empty.swift
// RUN: echo "func foo() {}" >> %t/func.swift
// Edit previously did not update the syntax info. Cursor info was using its
// buffer to calculate line and column (before rdar://78161348).
// RUN: %sourcekitd-test \
// RUN: -req=open -text-input %t/empty.swift %t/func.swift -- %t/func.swift == \
// RUN: -req=edit -offset=0 -length=0 -replace="func foo() {}" -req-opts=enablesyntaxmap=0,enablesubstructure=0,enablediagnostics=0 %t/func.swift -- %t/func.swift == \
// RUN: -req=cursor -offset=5 %t/func.swift -- %t/func.swift