Basic support C++20 named module. (#12)

This commit is contained in:
ykiko
2024-12-14 13:40:13 +08:00
committed by GitHub
parent 7d42b4e1ec
commit 5326480cd6
30 changed files with 1082 additions and 593 deletions

View File

@@ -5,25 +5,24 @@ namespace clice {
async::promise<void> Server::onDidOpen(const proto::DidOpenTextDocumentParams& params) {
auto path = URI::resolve(params.textDocument.uri);
llvm::StringRef content = params.textDocument.text;
co_await scheduler.add(path, content);
co_await scheduler.update(path, content, synchronizer);
}
async::promise<void> Server::onDidChange(const proto::DidChangeTextDocumentParams& document) {
auto path = URI::resolve(document.textDocument.uri);
llvm::StringRef content = document.contentChanges[0].text;
co_await scheduler.update(path, content);
co_await scheduler.update(path, content, synchronizer);
}
async::promise<void> Server::onDidSave(const proto::DidSaveTextDocumentParams& document) {
auto path = URI::resolve(document.textDocument.uri);
co_await scheduler.save(path);
/// co_await scheduler.save(path);
co_return;
}
async::promise<void> Server::onDidClose(const proto::DidCloseTextDocumentParams& document) {
auto path = URI::resolve(document.textDocument.uri);
co_await scheduler.close(path);
/// co_await scheduler.close(path);
co_return;
}