Refactor Index.

This commit is contained in:
ykiko
2024-12-06 19:06:59 +08:00
parent fdad191b29
commit faebd0123e
23 changed files with 684 additions and 1671 deletions

View File

@@ -70,7 +70,7 @@ struct File {
};
class Scheduler {
public:
private:
async::promise<void> updatePCH(llvm::StringRef path,
llvm::StringRef content,
llvm::ArrayRef<const char*> args);
@@ -81,10 +81,7 @@ public:
async::promise<void> buildAST(llvm::StringRef path, llvm::StringRef content);
async::promise<proto::CompletionResult> codeComplete(llvm::StringRef path,
unsigned int line,
unsigned int column);
public:
async::promise<void> add(llvm::StringRef path, llvm::StringRef content);
async::promise<void> update(llvm::StringRef path, llvm::StringRef content);
@@ -93,6 +90,10 @@ public:
async::promise<void> close(llvm::StringRef path);
async::promise<proto::CompletionResult> codeComplete(llvm::StringRef path,
unsigned int line,
unsigned int column);
/// Schedule a task for a file. If the file is building, the task will be
/// appended to the task list of the file and wait for the building to finish.
/// Otherwise, the task will be executed immediately.