mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[IDE/SourceKit] New SourceKit request for filtered method list
`source.request.conformingmethods` is a new SourceKit request which receives a source position and a list of protocol namses, returns a list of methods whose return type conforms to the requested protocols. rdar://problem/44699573
This commit is contained in:
@@ -306,6 +306,13 @@ public:
|
||||
return CCCache;
|
||||
}
|
||||
|
||||
/// Copy a memory buffer inserting '0' at the position of \c origBuf.
|
||||
// TODO: Share with code completion.
|
||||
static std::unique_ptr<llvm::MemoryBuffer>
|
||||
makeCodeCompletionMemoryBuffer(const llvm::MemoryBuffer *origBuf,
|
||||
unsigned &Offset,
|
||||
const std::string bufferIdentifier);
|
||||
|
||||
static SourceKit::UIdent getUIDForDecl(const swift::Decl *D,
|
||||
bool IsRef = false);
|
||||
static SourceKit::UIdent getUIDForExtensionOfDecl(const swift::Decl *D);
|
||||
@@ -381,6 +388,14 @@ public:
|
||||
static void
|
||||
printFullyAnnotatedGenericReq(const swift::GenericSignature *Sig,
|
||||
llvm::raw_ostream &OS);
|
||||
|
||||
/// Print 'description' or 'sourcetext' the given \p VD to \p OS. If
|
||||
/// \p usePlaceholder is \c true, call argument positions are substituted with
|
||||
/// a typed editor placeholders which is suitable for 'sourcetext'.
|
||||
static void
|
||||
printMemberDeclDescription(const swift::ValueDecl *VD, swift::Type baseTy,
|
||||
bool usePlaceholder, llvm::raw_ostream &OS);
|
||||
|
||||
/// Tries to resolve the path to the real file-system path. If it fails it
|
||||
/// returns the original path;
|
||||
static std::string resolvePathSymlinks(StringRef FilePath);
|
||||
@@ -528,6 +543,11 @@ public:
|
||||
ArrayRef<const char *> Args,
|
||||
TypeContextInfoConsumer &Consumer) override;
|
||||
|
||||
void getConformingMethodList(llvm::MemoryBuffer *inputBuf, unsigned Offset,
|
||||
ArrayRef<const char *> Args,
|
||||
ArrayRef<const char *> ExpectedTypes,
|
||||
ConformingMethodListConsumer &Consumer) override;
|
||||
|
||||
void getStatistics(StatisticsReceiver) override;
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user