mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
add custom fs to editor.open and cursorinfo
This commit is contained in:
@@ -1611,6 +1611,7 @@ static void resolveRange(SwiftLangSupport &Lang,
|
||||
void SwiftLangSupport::getCursorInfo(
|
||||
StringRef InputFile, unsigned Offset, unsigned Length, bool Actionables,
|
||||
bool CancelOnSubsequentRequest, ArrayRef<const char *> Args,
|
||||
llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> FileSystem,
|
||||
std::function<void(const RequestResult<CursorInfoData> &)> Receiver) {
|
||||
|
||||
if (auto IFaceGenRef = IFaceGenContexts.get(InputFile)) {
|
||||
@@ -1644,7 +1645,8 @@ void SwiftLangSupport::getCursorInfo(
|
||||
}
|
||||
|
||||
std::string Error;
|
||||
SwiftInvocationRef Invok = ASTMgr->getInvocation(Args, InputFile, Error);
|
||||
SwiftInvocationRef Invok =
|
||||
ASTMgr->getInvocation(Args, InputFile, Error, FileSystem);
|
||||
if (!Invok) {
|
||||
LOG_WARN_FUNC("failed to create an ASTInvocation: " << Error);
|
||||
Receiver(RequestResult<CursorInfoData>::fromError(Error));
|
||||
@@ -1846,6 +1848,7 @@ resolveCursorFromUSR(SwiftLangSupport &Lang, StringRef InputFile, StringRef USR,
|
||||
void SwiftLangSupport::getCursorInfoFromUSR(
|
||||
StringRef filename, StringRef USR, bool CancelOnSubsequentRequest,
|
||||
ArrayRef<const char *> Args,
|
||||
llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> FileSystem,
|
||||
std::function<void(const RequestResult<CursorInfoData> &)> Receiver) {
|
||||
if (auto IFaceGenRef = IFaceGenContexts.get(filename)) {
|
||||
LOG_WARN_FUNC("Info from usr for generated interface not implemented yet.");
|
||||
@@ -1857,6 +1860,7 @@ void SwiftLangSupport::getCursorInfoFromUSR(
|
||||
|
||||
std::string Error;
|
||||
SwiftInvocationRef Invok = ASTMgr->getInvocation(Args, filename, Error);
|
||||
ASTMgr->getInvocation(Args, filename, Error, FileSystem);
|
||||
if (!Invok) {
|
||||
LOG_WARN_FUNC("failed to create an ASTInvocation: " << Error);
|
||||
Receiver(RequestResult<CursorInfoData>::fromError(Error));
|
||||
|
||||
Reference in New Issue
Block a user