2017-12-24 01:30:52 +00:00
|
|
|
#pragma once
|
|
|
|
|
2018-06-08 04:53:41 +00:00
|
|
|
#include "lsp_diagnostic.h"
|
2018-05-28 00:50:02 +00:00
|
|
|
#include "method.h"
|
|
|
|
#include "query.h"
|
2018-05-13 16:52:19 +00:00
|
|
|
|
2018-05-28 00:50:02 +00:00
|
|
|
#include <string>
|
2018-05-13 16:52:19 +00:00
|
|
|
#include <unordered_map>
|
2018-05-28 00:50:02 +00:00
|
|
|
#include <vector>
|
2017-12-24 01:30:52 +00:00
|
|
|
|
2018-06-08 04:53:41 +00:00
|
|
|
struct GroupMatch;
|
2018-05-05 22:29:17 +00:00
|
|
|
struct VFS;
|
2017-12-29 15:52:43 +00:00
|
|
|
struct Project;
|
2017-12-24 01:30:52 +00:00
|
|
|
struct WorkingFiles;
|
2018-05-28 00:50:02 +00:00
|
|
|
struct lsBaseOutMessage;
|
2017-12-24 01:30:52 +00:00
|
|
|
|
2018-06-08 04:53:41 +00:00
|
|
|
class DiagnosticsPublisher {
|
|
|
|
std::unique_ptr<GroupMatch> match_;
|
|
|
|
int64_t nextPublish_ = 0;
|
|
|
|
int frequencyMs_;
|
|
|
|
|
|
|
|
public:
|
|
|
|
void Init();
|
|
|
|
void Publish(WorkingFiles* working_files,
|
|
|
|
std::string path,
|
|
|
|
std::vector<lsDiagnostic> diagnostics);
|
|
|
|
};
|
|
|
|
|
2018-05-28 00:50:02 +00:00
|
|
|
namespace ccls::pipeline {
|
|
|
|
|
|
|
|
void Init();
|
2018-06-01 03:06:09 +00:00
|
|
|
void LaunchStdin();
|
|
|
|
void LaunchStdout();
|
2018-06-03 07:29:33 +00:00
|
|
|
void Indexer_Main(DiagnosticsPublisher* diag_pub,
|
2018-05-05 22:29:17 +00:00
|
|
|
VFS* vfs,
|
2017-12-29 15:56:34 +00:00
|
|
|
Project* project,
|
2018-05-28 00:50:02 +00:00
|
|
|
WorkingFiles* working_files);
|
|
|
|
void MainLoop();
|
|
|
|
|
|
|
|
void Index(const std::string& path,
|
|
|
|
const std::vector<std::string>& args,
|
|
|
|
bool is_interactive,
|
|
|
|
lsRequestId id = {});
|
2017-12-29 15:52:43 +00:00
|
|
|
|
2018-05-28 00:50:02 +00:00
|
|
|
std::optional<std::string> LoadCachedFileContents(const std::string& path);
|
|
|
|
void WriteStdout(MethodType method, lsBaseOutMessage& response);
|
|
|
|
}
|