ccls/src/pipeline.hh

56 lines
1.2 KiB
C++
Raw Normal View History

2018-08-21 05:27:52 +00:00
// Copyright 2017-2018 ccls Authors
// SPDX-License-Identifier: Apache-2.0
#pragma once
#include "lsp_diagnostic.h"
2018-05-28 00:50:02 +00:00
#include "method.h"
#include "query.h"
2018-05-28 00:50:02 +00:00
#include <string>
#include <unordered_map>
2018-05-28 00:50:02 +00:00
#include <vector>
struct GroupMatch;
struct VFS;
struct Project;
struct WorkingFiles;
2018-05-28 00:50:02 +00:00
struct lsBaseOutMessage;
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);
};
namespace ccls {
enum class IndexMode {
NonInteractive,
OnChange,
Normal,
};
2018-05-28 00:50:02 +00:00
namespace pipeline {
2018-05-28 00:50:02 +00:00
void Init();
void LaunchStdin();
void LaunchStdout();
void Indexer_Main(DiagnosticsPublisher* diag_pub,
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,
IndexMode mode, lsRequestId id = {});
2018-05-28 00:50:02 +00:00
std::optional<std::string> LoadCachedFileContents(const std::string& path);
void WriteStdout(MethodType method, lsBaseOutMessage& response);
}
}