mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[SourceKit] Don't realpath the primary file path
If the file didn’t exist on disk, `fileSystem->getRealPath` returns an empty string, which means we can’t find the `InputBuffer` and thsu won’t run solver-based cursor info. There’s no reason to realpath `PrimaryInputPath`, `getMemoryBuffer` already does that. rdar://120737244
This commit is contained in:
@@ -2119,11 +2119,9 @@ void SwiftLangSupport::getCursorInfo(
|
||||
std::shared_ptr<llvm::MemoryBuffer> InputBuffer;
|
||||
if (InputBufferName.empty() && Length == 0) {
|
||||
std::string InputFileError;
|
||||
llvm::SmallString<128> RealInputFilePath;
|
||||
fileSystem->getRealPath(PrimaryFilePath, RealInputFilePath);
|
||||
InputBuffer =
|
||||
std::shared_ptr<llvm::MemoryBuffer>(getASTManager()->getMemoryBuffer(
|
||||
RealInputFilePath, fileSystem, InputFileError));
|
||||
PrimaryFilePath, fileSystem, InputFileError));
|
||||
}
|
||||
|
||||
// Receiver is async, so be careful about captured values. This is all
|
||||
|
||||
Reference in New Issue
Block a user