mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[SourceKit] Add a request to get the semantic tokens of a file
We need this request for semantic highlighting in LSP. Previously, we were getting the semantic tokens using a 0,0 edit after a document update notification but that will no longer be possible if we open the documents in syntactic only mode.
This commit is contained in:
@@ -665,6 +665,13 @@ public:
|
||||
std::function<void(const RequestResult<DiagnosticsResult> &)>
|
||||
Receiver) override;
|
||||
|
||||
void getSemanticTokens(
|
||||
StringRef PrimaryFilePath, StringRef InputBufferName,
|
||||
ArrayRef<const char *> Args, llvm::Optional<VFSOptions> VfsOptions,
|
||||
SourceKitCancellationToken CancellationToken,
|
||||
std::function<void(const RequestResult<SemanticTokensResult> &)> Receiver)
|
||||
override;
|
||||
|
||||
void getNameInfo(
|
||||
StringRef PrimaryFilePath, StringRef InputBufferName, unsigned Offset,
|
||||
NameTranslatingInfo &Input, ArrayRef<const char *> Args,
|
||||
@@ -812,6 +819,10 @@ public:
|
||||
/// Disable expensive SIL options which do not affect indexing or diagnostics.
|
||||
void disableExpensiveSILOptions(swift::SILOptions &Opts);
|
||||
|
||||
swift::SourceFile *retrieveInputFile(StringRef inputBufferName,
|
||||
const swift::CompilerInstance &CI,
|
||||
bool haveRealPath = false);
|
||||
|
||||
} // namespace SourceKit
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user