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 CompletionManager;
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-09-18 01:03:59 +00:00
extern int64_t loaded_ts, tick;
2018-05-28 00:50:02 +00:00
void Init();
void LaunchStdin();
void LaunchStdout();
2018-09-08 23:00:14 +00:00
void Indexer_Main(CompletionManager *completion, VFS *vfs, Project *project,
WorkingFiles *wfiles);
2018-05-28 00:50:02 +00:00
void MainLoop();
2018-09-19 16:31:45 +00:00
void Index(const std::string &path, const std::vector<const char *> &args,
IndexMode mode, lsRequestId id = {});
std::optional<std::string> LoadIndexedContent(const std::string& path);
void WriteStdout(MethodType method, lsBaseOutMessage &response);
} // namespace pipeline
} // namespace ccls