[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.
This commit is contained in:
Ben Barham
2023-06-23 16:18:59 -07:00
parent 3ddab3e9b0
commit ab95dba720
7 changed files with 105 additions and 62 deletions

View File

@@ -660,8 +660,9 @@ public:
Receiver) override;
void getNameInfo(
StringRef Filename, unsigned Offset, NameTranslatingInfo &Input,
ArrayRef<const char *> Args, SourceKitCancellationToken CancellationToken,
StringRef PrimaryFilePath, StringRef InputBufferName, unsigned Offset,
NameTranslatingInfo &Input, ArrayRef<const char *> Args,
SourceKitCancellationToken CancellationToken,
std::function<void(const RequestResult<NameTranslatingInfo> &)> Receiver)
override;