mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-24 08:35:08 +00:00
*.h -> *.hh
This commit is contained in:
parent
ea1271a84e
commit
df20969788
@ -18,8 +18,8 @@ limitations under the License.
|
|||||||
#include "clang_tu.hh"
|
#include "clang_tu.hh"
|
||||||
#include "filesystem.hh"
|
#include "filesystem.hh"
|
||||||
#include "log.hh"
|
#include "log.hh"
|
||||||
#include "match.h"
|
#include "match.hh"
|
||||||
#include "platform.h"
|
#include "platform.hh"
|
||||||
|
|
||||||
#include <clang/Lex/PreprocessorOptions.h>
|
#include <clang/Lex/PreprocessorOptions.h>
|
||||||
#include <clang/Sema/CodeCompleteConsumer.h>
|
#include <clang/Sema/CodeCompleteConsumer.h>
|
||||||
@ -417,7 +417,7 @@ void *CompletionMain(void *manager_) {
|
|||||||
|
|
||||||
DiagnosticConsumer DC;
|
DiagnosticConsumer DC;
|
||||||
WorkingFiles::Snapshot snapshot =
|
WorkingFiles::Snapshot snapshot =
|
||||||
manager->working_files_->AsSnapshot({StripFileType(path)});
|
manager->wfiles_->AsSnapshot({StripFileType(path)});
|
||||||
std::vector<std::unique_ptr<llvm::MemoryBuffer>> Bufs;
|
std::vector<std::unique_ptr<llvm::MemoryBuffer>> Bufs;
|
||||||
auto Clang = BuildCompilerInstance(*session, std::move(CI), FS, DC,
|
auto Clang = BuildCompilerInstance(*session, std::move(CI), FS, DC,
|
||||||
preamble.get(), snapshot, Bufs);
|
preamble.get(), snapshot, Bufs);
|
||||||
@ -491,7 +491,7 @@ void *DiagnosticMain(void *manager_) {
|
|||||||
CI->getLangOpts()->SpellChecking = g_config->diagnostics.spellChecking;
|
CI->getLangOpts()->SpellChecking = g_config->diagnostics.spellChecking;
|
||||||
StoreDiags DC(path);
|
StoreDiags DC(path);
|
||||||
WorkingFiles::Snapshot snapshot =
|
WorkingFiles::Snapshot snapshot =
|
||||||
manager->working_files_->AsSnapshot({StripFileType(path)});
|
manager->wfiles_->AsSnapshot({StripFileType(path)});
|
||||||
std::vector<std::unique_ptr<llvm::MemoryBuffer>> Bufs;
|
std::vector<std::unique_ptr<llvm::MemoryBuffer>> Bufs;
|
||||||
auto Clang = BuildCompilerInstance(*session, std::move(CI), FS, DC,
|
auto Clang = BuildCompilerInstance(*session, std::move(CI), FS, DC,
|
||||||
preamble.get(), snapshot, Bufs);
|
preamble.get(), snapshot, Bufs);
|
||||||
@ -575,10 +575,10 @@ std::shared_ptr<PreambleData> CompletionSession::GetPreamble() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
CompletionManager::CompletionManager(Project *project,
|
CompletionManager::CompletionManager(Project *project,
|
||||||
WorkingFiles *working_files,
|
WorkingFiles *wfiles,
|
||||||
OnDiagnostic on_diagnostic,
|
OnDiagnostic on_diagnostic,
|
||||||
OnDropped on_dropped)
|
OnDropped on_dropped)
|
||||||
: project_(project), working_files_(working_files),
|
: project_(project), wfiles_(wfiles),
|
||||||
on_diagnostic_(on_diagnostic), on_dropped_(on_dropped),
|
on_diagnostic_(on_diagnostic), on_dropped_(on_dropped),
|
||||||
preloads(kMaxPreloadedSessions),
|
preloads(kMaxPreloadedSessions),
|
||||||
sessions(kMaxCompletionSessions),
|
sessions(kMaxCompletionSessions),
|
||||||
@ -637,7 +637,7 @@ bool CompletionManager::EnsureCompletionOrCreatePreloadSession(
|
|||||||
|
|
||||||
// No CompletionSession, create new one.
|
// No CompletionSession, create new one.
|
||||||
auto session = std::make_shared<ccls::CompletionSession>(
|
auto session = std::make_shared<ccls::CompletionSession>(
|
||||||
project_->FindEntry(path, false), working_files_, PCH);
|
project_->FindEntry(path, false), wfiles_, PCH);
|
||||||
if (session->file.filename != path) {
|
if (session->file.filename != path) {
|
||||||
session->inferred = true;
|
session->inferred = true;
|
||||||
session->file.filename = path;
|
session->file.filename = path;
|
||||||
@ -666,7 +666,7 @@ CompletionManager::TryGetSession(const std::string &path, bool preload,
|
|||||||
session = sessions.TryGet(path);
|
session = sessions.TryGet(path);
|
||||||
if (!session && !preload) {
|
if (!session && !preload) {
|
||||||
session = std::make_shared<ccls::CompletionSession>(
|
session = std::make_shared<ccls::CompletionSession>(
|
||||||
project_->FindEntry(path, false), working_files_, PCH);
|
project_->FindEntry(path, false), wfiles_, PCH);
|
||||||
sessions.Insert(path, session);
|
sessions.Insert(path, session);
|
||||||
LOG_S(INFO) << "create session for " << path;
|
LOG_S(INFO) << "create session for " << path;
|
||||||
if (is_open)
|
if (is_open)
|
||||||
|
@ -16,11 +16,11 @@ limitations under the License.
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "clang_tu.hh"
|
#include "clang_tu.hh"
|
||||||
#include "lru_cache.h"
|
#include "lru_cache.hh"
|
||||||
#include "lsp.hh"
|
#include "lsp.hh"
|
||||||
#include "project.hh"
|
#include "project.hh"
|
||||||
#include "threaded_queue.h"
|
#include "threaded_queue.hh"
|
||||||
#include "working_files.h"
|
#include "working_files.hh"
|
||||||
|
|
||||||
#include <clang/Frontend/CompilerInstance.h>
|
#include <clang/Frontend/CompilerInstance.h>
|
||||||
#include <clang/Frontend/FrontendActions.h>
|
#include <clang/Frontend/FrontendActions.h>
|
||||||
@ -108,7 +108,7 @@ struct CompletionManager {
|
|||||||
int64_t debounce;
|
int64_t debounce;
|
||||||
};
|
};
|
||||||
|
|
||||||
CompletionManager(Project *project, WorkingFiles *working_files,
|
CompletionManager(Project *project, WorkingFiles *wfiles,
|
||||||
OnDiagnostic on_diagnostic, OnDropped on_dropped);
|
OnDiagnostic on_diagnostic, OnDropped on_dropped);
|
||||||
|
|
||||||
// Request a diagnostics update.
|
// Request a diagnostics update.
|
||||||
@ -141,7 +141,7 @@ struct CompletionManager {
|
|||||||
|
|
||||||
// Global state.
|
// Global state.
|
||||||
Project *project_;
|
Project *project_;
|
||||||
WorkingFiles *working_files_;
|
WorkingFiles *wfiles_;
|
||||||
OnDiagnostic on_diagnostic_;
|
OnDiagnostic on_diagnostic_;
|
||||||
OnDropped on_dropped_;
|
OnDropped on_dropped_;
|
||||||
|
|
||||||
|
@ -15,8 +15,8 @@ limitations under the License.
|
|||||||
|
|
||||||
#include "clang_tu.hh"
|
#include "clang_tu.hh"
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.hh"
|
||||||
#include "platform.h"
|
#include "platform.hh"
|
||||||
|
|
||||||
#include <clang/AST/Type.h>
|
#include <clang/AST/Type.h>
|
||||||
#include <clang/Lex/Lexer.h>
|
#include <clang/Lex/Lexer.h>
|
||||||
|
@ -15,7 +15,7 @@ limitations under the License.
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "position.h"
|
#include "position.hh"
|
||||||
|
|
||||||
#include <clang/Basic/LangOptions.h>
|
#include <clang/Basic/LangOptions.h>
|
||||||
#include <clang/Basic/FileManager.h>
|
#include <clang/Basic/FileManager.h>
|
||||||
|
@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
==============================================================================*/
|
==============================================================================*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.hh"
|
||||||
|
|
||||||
namespace ccls {
|
namespace ccls {
|
||||||
Config *g_config;
|
Config *g_config;
|
||||||
|
@ -16,7 +16,7 @@ limitations under the License.
|
|||||||
#include "filesystem.hh"
|
#include "filesystem.hh"
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
#include "utils.h"
|
#include "utils.hh"
|
||||||
|
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
==============================================================================*/
|
==============================================================================*/
|
||||||
|
|
||||||
#include "fuzzy_match.h"
|
#include "fuzzy_match.hh"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
@ -13,11 +13,11 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
==============================================================================*/
|
==============================================================================*/
|
||||||
|
|
||||||
#include "include_complete.h"
|
#include "include_complete.hh"
|
||||||
|
|
||||||
#include "filesystem.hh"
|
#include "filesystem.hh"
|
||||||
#include "match.h"
|
#include "match.hh"
|
||||||
#include "platform.h"
|
#include "platform.hh"
|
||||||
#include "project.hh"
|
#include "project.hh"
|
||||||
|
|
||||||
#include <llvm/ADT/Twine.h>
|
#include <llvm/ADT/Twine.h>
|
||||||
|
@ -13,14 +13,14 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
==============================================================================*/
|
==============================================================================*/
|
||||||
|
|
||||||
#include "indexer.h"
|
#include "indexer.hh"
|
||||||
|
|
||||||
#include "clang_complete.hh"
|
#include "clang_complete.hh"
|
||||||
#include "clang_tu.hh"
|
#include "clang_tu.hh"
|
||||||
#include "log.hh"
|
#include "log.hh"
|
||||||
#include "match.h"
|
#include "match.hh"
|
||||||
#include "pipeline.hh"
|
#include "pipeline.hh"
|
||||||
#include "platform.h"
|
#include "platform.hh"
|
||||||
#include "serializer.hh"
|
#include "serializer.hh"
|
||||||
|
|
||||||
#include <clang/AST/AST.h>
|
#include <clang/AST/AST.h>
|
||||||
|
@ -16,10 +16,10 @@ limitations under the License.
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "lsp.hh"
|
#include "lsp.hh"
|
||||||
#include "maybe.h"
|
#include "maybe.hh"
|
||||||
#include "position.h"
|
#include "position.hh"
|
||||||
#include "serializer.hh"
|
#include "serializer.hh"
|
||||||
#include "utils.h"
|
#include "utils.hh"
|
||||||
|
|
||||||
#include <clang/Basic/FileManager.h>
|
#include <clang/Basic/FileManager.h>
|
||||||
#include <clang/Basic/Specifiers.h>
|
#include <clang/Basic/Specifiers.h>
|
@ -16,7 +16,7 @@ limitations under the License.
|
|||||||
#include "lsp.hh"
|
#include "lsp.hh"
|
||||||
|
|
||||||
#include "log.hh"
|
#include "log.hh"
|
||||||
#include "serializers/json.h"
|
#include "serializers/json.hh"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
@ -15,9 +15,9 @@ limitations under the License.
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.hh"
|
||||||
#include "serializer.hh"
|
#include "serializer.hh"
|
||||||
#include "utils.h"
|
#include "utils.hh"
|
||||||
|
|
||||||
#include <rapidjson/fwd.h>
|
#include <rapidjson/fwd.h>
|
||||||
|
|
||||||
|
@ -15,11 +15,11 @@ limitations under the License.
|
|||||||
|
|
||||||
#include "log.hh"
|
#include "log.hh"
|
||||||
#include "pipeline.hh"
|
#include "pipeline.hh"
|
||||||
#include "platform.h"
|
#include "platform.hh"
|
||||||
#include "serializer.hh"
|
#include "serializer.hh"
|
||||||
#include "serializers/json.h"
|
#include "serializers/json.hh"
|
||||||
#include "test.h"
|
#include "test.hh"
|
||||||
#include "working_files.h"
|
#include "working_files.hh"
|
||||||
|
|
||||||
#include <llvm/Support/CommandLine.h>
|
#include <llvm/Support/CommandLine.h>
|
||||||
#include <llvm/Support/CrashRecoveryContext.h>
|
#include <llvm/Support/CrashRecoveryContext.h>
|
||||||
|
@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
==============================================================================*/
|
==============================================================================*/
|
||||||
|
|
||||||
#include "match.h"
|
#include "match.hh"
|
||||||
|
|
||||||
#include "lsp.hh"
|
#include "lsp.hh"
|
||||||
#include "pipeline.hh"
|
#include "pipeline.hh"
|
||||||
|
@ -16,11 +16,11 @@ limitations under the License.
|
|||||||
#include "message_handler.hh"
|
#include "message_handler.hh"
|
||||||
|
|
||||||
#include "log.hh"
|
#include "log.hh"
|
||||||
#include "match.h"
|
#include "match.hh"
|
||||||
#include "pipeline.hh"
|
#include "pipeline.hh"
|
||||||
#include "project.hh"
|
#include "project.hh"
|
||||||
#include "query_utils.h"
|
#include "query_utils.hh"
|
||||||
#include "serializers/json.h"
|
#include "serializers/json.hh"
|
||||||
|
|
||||||
using namespace clang;
|
using namespace clang;
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ limitations under the License.
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "lsp.hh"
|
#include "lsp.hh"
|
||||||
#include "query.h"
|
#include "query.hh"
|
||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
@ -196,7 +196,7 @@ struct MessageHandler {
|
|||||||
DB *db = nullptr;
|
DB *db = nullptr;
|
||||||
Project *project = nullptr;
|
Project *project = nullptr;
|
||||||
VFS *vfs = nullptr;
|
VFS *vfs = nullptr;
|
||||||
WorkingFiles *working_files = nullptr;
|
WorkingFiles *wfiles = nullptr;
|
||||||
CompletionManager *clang_complete = nullptr;
|
CompletionManager *clang_complete = nullptr;
|
||||||
IncludeComplete *include_complete = nullptr;
|
IncludeComplete *include_complete = nullptr;
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ limitations under the License.
|
|||||||
#include "hierarchy.hh"
|
#include "hierarchy.hh"
|
||||||
#include "message_handler.hh"
|
#include "message_handler.hh"
|
||||||
#include "pipeline.hh"
|
#include "pipeline.hh"
|
||||||
#include "query_utils.h"
|
#include "query_utils.hh"
|
||||||
|
|
||||||
#include <unordered_set>
|
#include <unordered_set>
|
||||||
|
|
||||||
@ -85,7 +85,7 @@ bool Expand(MessageHandler *m, Out_cclsCall *entry, bool callee,
|
|||||||
Out_cclsCall entry1;
|
Out_cclsCall entry1;
|
||||||
entry1.id = std::to_string(sym.usr);
|
entry1.id = std::to_string(sym.usr);
|
||||||
entry1.usr = sym.usr;
|
entry1.usr = sym.usr;
|
||||||
if (auto loc = GetLsLocation(m->db, m->working_files,
|
if (auto loc = GetLsLocation(m->db, m->wfiles,
|
||||||
Use{{sym.range, sym.role}, file_id}))
|
Use{{sym.range, sym.role}, file_id}))
|
||||||
entry1.location = *loc;
|
entry1.location = *loc;
|
||||||
entry1.callType = call_type1;
|
entry1.callType = call_type1;
|
||||||
@ -175,7 +175,7 @@ std::optional<Out_cclsCall> BuildInitial(MessageHandler *m, Usr root_usr,
|
|||||||
entry.usr = root_usr;
|
entry.usr = root_usr;
|
||||||
entry.callType = CallType::Direct;
|
entry.callType = CallType::Direct;
|
||||||
if (def->spell) {
|
if (def->spell) {
|
||||||
if (auto loc = GetLsLocation(m->db, m->working_files, *def->spell))
|
if (auto loc = GetLsLocation(m->db, m->wfiles, *def->spell))
|
||||||
entry.location = *loc;
|
entry.location = *loc;
|
||||||
}
|
}
|
||||||
Expand(m, &entry, callee, call_type, qualified, levels);
|
Expand(m, &entry, callee, call_type, qualified, levels);
|
||||||
@ -205,7 +205,7 @@ void MessageHandler::ccls_call(Reader &reader, ReplyOnce &reply) {
|
|||||||
if (!file)
|
if (!file)
|
||||||
return;
|
return;
|
||||||
WorkingFile *working_file =
|
WorkingFile *working_file =
|
||||||
working_files->GetFileByFilename(file->def->path);
|
wfiles->GetFileByFilename(file->def->path);
|
||||||
for (SymbolRef sym :
|
for (SymbolRef sym :
|
||||||
FindSymbolsAtLocation(working_file, file, param.position)) {
|
FindSymbolsAtLocation(working_file, file, param.position)) {
|
||||||
if (sym.kind == SymbolKind::Func) {
|
if (sym.kind == SymbolKind::Func) {
|
||||||
|
@ -16,7 +16,7 @@ limitations under the License.
|
|||||||
#include "message_handler.hh"
|
#include "message_handler.hh"
|
||||||
#include "pipeline.hh"
|
#include "pipeline.hh"
|
||||||
#include "project.hh"
|
#include "project.hh"
|
||||||
#include "query_utils.h"
|
#include "query_utils.hh"
|
||||||
|
|
||||||
namespace ccls {
|
namespace ccls {
|
||||||
MAKE_REFLECT_STRUCT(QueryFile::Def, path, args, language, skipped_ranges,
|
MAKE_REFLECT_STRUCT(QueryFile::Def, path, args, language, skipped_ranges,
|
||||||
|
@ -16,7 +16,7 @@ limitations under the License.
|
|||||||
#include "hierarchy.hh"
|
#include "hierarchy.hh"
|
||||||
#include "message_handler.hh"
|
#include "message_handler.hh"
|
||||||
#include "pipeline.hh"
|
#include "pipeline.hh"
|
||||||
#include "query_utils.h"
|
#include "query_utils.hh"
|
||||||
|
|
||||||
#include <unordered_set>
|
#include <unordered_set>
|
||||||
|
|
||||||
@ -64,10 +64,10 @@ bool ExpandHelper(MessageHandler *m, Out_cclsInheritance *entry, bool derived,
|
|||||||
if (def) {
|
if (def) {
|
||||||
entry->name = def->Name(qualified);
|
entry->name = def->Name(qualified);
|
||||||
if (def->spell) {
|
if (def->spell) {
|
||||||
if (auto loc = GetLsLocation(m->db, m->working_files, *def->spell))
|
if (auto loc = GetLsLocation(m->db, m->wfiles, *def->spell))
|
||||||
entry->location = *loc;
|
entry->location = *loc;
|
||||||
} else if (entity.declarations.size()) {
|
} else if (entity.declarations.size()) {
|
||||||
if (auto loc = GetLsLocation(m->db, m->working_files, entity.declarations[0]))
|
if (auto loc = GetLsLocation(m->db, m->wfiles, entity.declarations[0]))
|
||||||
entry->location = *loc;
|
entry->location = *loc;
|
||||||
}
|
}
|
||||||
} else if (!derived) {
|
} else if (!derived) {
|
||||||
@ -150,7 +150,7 @@ void Inheritance(MessageHandler *m, Param ¶m, ReplyOnce &reply) {
|
|||||||
QueryFile *file = m->FindFile(reply, param.textDocument.uri.GetPath());
|
QueryFile *file = m->FindFile(reply, param.textDocument.uri.GetPath());
|
||||||
if (!file)
|
if (!file)
|
||||||
return;
|
return;
|
||||||
WorkingFile *wfile = m->working_files->GetFileByFilename(file->def->path);
|
WorkingFile *wfile = m->wfiles->GetFileByFilename(file->def->path);
|
||||||
|
|
||||||
for (SymbolRef sym : FindSymbolsAtLocation(wfile, file, param.position))
|
for (SymbolRef sym : FindSymbolsAtLocation(wfile, file, param.position))
|
||||||
if (sym.kind == SymbolKind::Func || sym.kind == SymbolKind::Type) {
|
if (sym.kind == SymbolKind::Func || sym.kind == SymbolKind::Type) {
|
||||||
|
@ -17,7 +17,7 @@ limitations under the License.
|
|||||||
#include "hierarchy.hh"
|
#include "hierarchy.hh"
|
||||||
#include "message_handler.hh"
|
#include "message_handler.hh"
|
||||||
#include "pipeline.hh"
|
#include "pipeline.hh"
|
||||||
#include "query_utils.h"
|
#include "query_utils.hh"
|
||||||
|
|
||||||
#include <clang/AST/Type.h>
|
#include <clang/AST/Type.h>
|
||||||
#include <llvm/ADT/DenseSet.h>
|
#include <llvm/ADT/DenseSet.h>
|
||||||
@ -90,7 +90,7 @@ void DoField(MessageHandler *m, Out_cclsMember *entry, const QueryVar &var,
|
|||||||
}
|
}
|
||||||
if (def1->spell) {
|
if (def1->spell) {
|
||||||
if (std::optional<lsLocation> loc =
|
if (std::optional<lsLocation> loc =
|
||||||
GetLsLocation(m->db, m->working_files, *def1->spell))
|
GetLsLocation(m->db, m->wfiles, *def1->spell))
|
||||||
entry1.location = *loc;
|
entry1.location = *loc;
|
||||||
}
|
}
|
||||||
if (def1->type) {
|
if (def1->type) {
|
||||||
@ -145,13 +145,13 @@ bool Expand(MessageHandler *m, Out_cclsMember *entry, bool qualified,
|
|||||||
if (def1 && def1->spell) {
|
if (def1 && def1->spell) {
|
||||||
// The declaration of target type.
|
// The declaration of target type.
|
||||||
if (std::optional<lsLocation> loc =
|
if (std::optional<lsLocation> loc =
|
||||||
GetLsLocation(m->db, m->working_files, *def1->spell))
|
GetLsLocation(m->db, m->wfiles, *def1->spell))
|
||||||
entry1.location = *loc;
|
entry1.location = *loc;
|
||||||
} else if (def->spell) {
|
} else if (def->spell) {
|
||||||
// Builtin types have no declaration but the typedef declaration
|
// Builtin types have no declaration but the typedef declaration
|
||||||
// itself is useful.
|
// itself is useful.
|
||||||
if (std::optional<lsLocation> loc =
|
if (std::optional<lsLocation> loc =
|
||||||
GetLsLocation(m->db, m->working_files, *def->spell))
|
GetLsLocation(m->db, m->wfiles, *def->spell))
|
||||||
entry1.location = *loc;
|
entry1.location = *loc;
|
||||||
}
|
}
|
||||||
if (def1 && qualified)
|
if (def1 && qualified)
|
||||||
@ -173,10 +173,10 @@ bool Expand(MessageHandler *m, Out_cclsMember *entry, bool qualified,
|
|||||||
entry1.fieldName = def1->Name(false);
|
entry1.fieldName = def1->Name(false);
|
||||||
if (def1->spell) {
|
if (def1->spell) {
|
||||||
if (auto loc =
|
if (auto loc =
|
||||||
GetLsLocation(m->db, m->working_files, *def1->spell))
|
GetLsLocation(m->db, m->wfiles, *def1->spell))
|
||||||
entry1.location = *loc;
|
entry1.location = *loc;
|
||||||
} else if (func1.declarations.size()) {
|
} else if (func1.declarations.size()) {
|
||||||
if (auto loc = GetLsLocation(m->db, m->working_files,
|
if (auto loc = GetLsLocation(m->db, m->wfiles,
|
||||||
func1.declarations[0]))
|
func1.declarations[0]))
|
||||||
entry1.location = *loc;
|
entry1.location = *loc;
|
||||||
}
|
}
|
||||||
@ -194,10 +194,10 @@ bool Expand(MessageHandler *m, Out_cclsMember *entry, bool qualified,
|
|||||||
entry1.fieldName = def1->Name(false);
|
entry1.fieldName = def1->Name(false);
|
||||||
if (def1->spell) {
|
if (def1->spell) {
|
||||||
if (auto loc =
|
if (auto loc =
|
||||||
GetLsLocation(m->db, m->working_files, *def1->spell))
|
GetLsLocation(m->db, m->wfiles, *def1->spell))
|
||||||
entry1.location = *loc;
|
entry1.location = *loc;
|
||||||
} else if (type1.declarations.size()) {
|
} else if (type1.declarations.size()) {
|
||||||
if (auto loc = GetLsLocation(m->db, m->working_files,
|
if (auto loc = GetLsLocation(m->db, m->wfiles,
|
||||||
type1.declarations[0]))
|
type1.declarations[0]))
|
||||||
entry1.location = *loc;
|
entry1.location = *loc;
|
||||||
}
|
}
|
||||||
@ -236,7 +236,7 @@ std::optional<Out_cclsMember> BuildInitial(MessageHandler *m, SymbolKind kind,
|
|||||||
// Not type, |id| is invalid.
|
// Not type, |id| is invalid.
|
||||||
entry.name = def->Name(qualified);
|
entry.name = def->Name(qualified);
|
||||||
if (def->spell) {
|
if (def->spell) {
|
||||||
if (auto loc = GetLsLocation(m->db, m->working_files, *def->spell))
|
if (auto loc = GetLsLocation(m->db, m->wfiles, *def->spell))
|
||||||
entry.location = *loc;
|
entry.location = *loc;
|
||||||
}
|
}
|
||||||
for (Usr usr : def->vars) {
|
for (Usr usr : def->vars) {
|
||||||
@ -255,7 +255,7 @@ std::optional<Out_cclsMember> BuildInitial(MessageHandler *m, SymbolKind kind,
|
|||||||
entry.id = std::to_string(root_usr);
|
entry.id = std::to_string(root_usr);
|
||||||
entry.usr = root_usr;
|
entry.usr = root_usr;
|
||||||
if (def->spell) {
|
if (def->spell) {
|
||||||
if (auto loc = GetLsLocation(m->db, m->working_files, *def->spell))
|
if (auto loc = GetLsLocation(m->db, m->wfiles, *def->spell))
|
||||||
entry.location = *loc;
|
entry.location = *loc;
|
||||||
}
|
}
|
||||||
Expand(m, &entry, qualified, levels, memberKind);
|
Expand(m, &entry, qualified, levels, memberKind);
|
||||||
@ -286,7 +286,7 @@ void MessageHandler::ccls_member(Reader &reader, ReplyOnce &reply) {
|
|||||||
QueryFile *file = FindFile(reply, param.textDocument.uri.GetPath());
|
QueryFile *file = FindFile(reply, param.textDocument.uri.GetPath());
|
||||||
if (!file)
|
if (!file)
|
||||||
return;
|
return;
|
||||||
WorkingFile *wfile = working_files->GetFileByFilename(file->def->path);
|
WorkingFile *wfile = wfiles->GetFileByFilename(file->def->path);
|
||||||
for (SymbolRef sym :
|
for (SymbolRef sym :
|
||||||
FindSymbolsAtLocation(wfile, file, param.position)) {
|
FindSymbolsAtLocation(wfile, file, param.position)) {
|
||||||
switch (sym.kind) {
|
switch (sym.kind) {
|
||||||
|
@ -14,7 +14,7 @@ limitations under the License.
|
|||||||
==============================================================================*/
|
==============================================================================*/
|
||||||
|
|
||||||
#include "message_handler.hh"
|
#include "message_handler.hh"
|
||||||
#include "query_utils.h"
|
#include "query_utils.hh"
|
||||||
|
|
||||||
namespace ccls {
|
namespace ccls {
|
||||||
namespace {
|
namespace {
|
||||||
@ -46,7 +46,7 @@ void MessageHandler::ccls_navigate(Reader &reader,
|
|||||||
if (!file)
|
if (!file)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
WorkingFile *wfile = working_files->GetFileByFilename(file->def->path);
|
WorkingFile *wfile = wfiles->GetFileByFilename(file->def->path);
|
||||||
lsPosition ls_pos = param.position;
|
lsPosition ls_pos = param.position;
|
||||||
if (wfile && wfile->index_lines.size())
|
if (wfile && wfile->index_lines.size())
|
||||||
if (auto line = wfile->GetIndexPosFromBufferPos(ls_pos.line,
|
if (auto line = wfile->GetIndexPosFromBufferPos(ls_pos.line,
|
||||||
|
@ -14,11 +14,11 @@ limitations under the License.
|
|||||||
==============================================================================*/
|
==============================================================================*/
|
||||||
|
|
||||||
#include "clang_complete.hh"
|
#include "clang_complete.hh"
|
||||||
#include "match.h"
|
#include "match.hh"
|
||||||
#include "message_handler.hh"
|
#include "message_handler.hh"
|
||||||
#include "pipeline.hh"
|
#include "pipeline.hh"
|
||||||
#include "project.hh"
|
#include "project.hh"
|
||||||
#include "working_files.h"
|
#include "working_files.hh"
|
||||||
|
|
||||||
#include <queue>
|
#include <queue>
|
||||||
#include <unordered_set>
|
#include <unordered_set>
|
||||||
@ -40,7 +40,7 @@ void MessageHandler::ccls_reload(Reader &reader) {
|
|||||||
if (param.whitelist.empty() && param.blacklist.empty()) {
|
if (param.whitelist.empty() && param.blacklist.empty()) {
|
||||||
vfs->Clear();
|
vfs->Clear();
|
||||||
db->clear();
|
db->clear();
|
||||||
project->Index(working_files, lsRequestId());
|
project->Index(wfiles, lsRequestId());
|
||||||
clang_complete->FlushAllSessions();
|
clang_complete->FlushAllSessions();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ limitations under the License.
|
|||||||
|
|
||||||
#include "message_handler.hh"
|
#include "message_handler.hh"
|
||||||
#include "pipeline.hh"
|
#include "pipeline.hh"
|
||||||
#include "query_utils.h"
|
#include "query_utils.hh"
|
||||||
|
|
||||||
namespace ccls {
|
namespace ccls {
|
||||||
namespace {
|
namespace {
|
||||||
@ -34,7 +34,7 @@ void MessageHandler::ccls_vars(Reader &reader, ReplyOnce &reply) {
|
|||||||
QueryFile *file = FindFile(reply, param.textDocument.uri.GetPath());
|
QueryFile *file = FindFile(reply, param.textDocument.uri.GetPath());
|
||||||
if (!file)
|
if (!file)
|
||||||
return;
|
return;
|
||||||
WorkingFile *working_file = working_files->GetFileByFilename(file->def->path);
|
WorkingFile *working_file = wfiles->GetFileByFilename(file->def->path);
|
||||||
|
|
||||||
std::vector<lsLocation> result;
|
std::vector<lsLocation> result;
|
||||||
for (SymbolRef sym :
|
for (SymbolRef sym :
|
||||||
@ -52,7 +52,7 @@ void MessageHandler::ccls_vars(Reader &reader, ReplyOnce &reply) {
|
|||||||
}
|
}
|
||||||
case SymbolKind::Type:
|
case SymbolKind::Type:
|
||||||
result = GetLsLocations(
|
result = GetLsLocations(
|
||||||
db, working_files,
|
db, wfiles,
|
||||||
GetVarDeclarations(db, db->Type(usr).instances, param.kind));
|
GetVarDeclarations(db, db->Type(usr).instances, param.kind));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -15,14 +15,14 @@ limitations under the License.
|
|||||||
|
|
||||||
#include "clang_complete.hh"
|
#include "clang_complete.hh"
|
||||||
#include "filesystem.hh"
|
#include "filesystem.hh"
|
||||||
#include "include_complete.h"
|
#include "include_complete.hh"
|
||||||
#include "log.hh"
|
#include "log.hh"
|
||||||
#include "message_handler.hh"
|
#include "message_handler.hh"
|
||||||
#include "pipeline.hh"
|
#include "pipeline.hh"
|
||||||
#include "platform.h"
|
#include "platform.hh"
|
||||||
#include "project.hh"
|
#include "project.hh"
|
||||||
#include "serializers/json.h"
|
#include "serializers/json.hh"
|
||||||
#include "working_files.h"
|
#include "working_files.hh"
|
||||||
|
|
||||||
#include <llvm/ADT/Twine.h>
|
#include <llvm/ADT/Twine.h>
|
||||||
#include <llvm/Support/Threading.h>
|
#include <llvm/Support/Threading.h>
|
||||||
@ -361,7 +361,7 @@ void *Indexer(void *arg_) {
|
|||||||
std::string name = "indexer" + std::to_string(idx);
|
std::string name = "indexer" + std::to_string(idx);
|
||||||
set_thread_name(name.c_str());
|
set_thread_name(name.c_str());
|
||||||
pipeline::Indexer_Main(h->clang_complete, h->vfs, h->project,
|
pipeline::Indexer_Main(h->clang_complete, h->vfs, h->project,
|
||||||
h->working_files);
|
h->wfiles);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
} // namespace
|
} // namespace
|
||||||
@ -457,7 +457,7 @@ void Initialize(MessageHandler *m, lsInitializeParams ¶m, ReplyOnce &reply)
|
|||||||
m->include_complete->Rescan();
|
m->include_complete->Rescan();
|
||||||
|
|
||||||
LOG_S(INFO) << "dispatch initial index requests";
|
LOG_S(INFO) << "dispatch initial index requests";
|
||||||
m->project->Index(m->working_files, reply.id);
|
m->project->Index(m->wfiles, reply.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MessageHandler::initialize(Reader &reader, ReplyOnce &reply) {
|
void MessageHandler::initialize(Reader &reader, ReplyOnce &reply) {
|
||||||
|
@ -15,8 +15,8 @@ limitations under the License.
|
|||||||
|
|
||||||
#include "message_handler.hh"
|
#include "message_handler.hh"
|
||||||
#include "pipeline.hh"
|
#include "pipeline.hh"
|
||||||
#include "query_utils.h"
|
#include "query_utils.hh"
|
||||||
#include "serializers/json.h"
|
#include "serializers/json.hh"
|
||||||
|
|
||||||
#include <llvm/Support/FormatVariadic.h>
|
#include <llvm/Support/FormatVariadic.h>
|
||||||
|
|
||||||
@ -34,13 +34,13 @@ MAKE_REFLECT_STRUCT(CodeAction, title, kind, edit);
|
|||||||
void MessageHandler::textDocument_codeAction(CodeActionParam ¶m,
|
void MessageHandler::textDocument_codeAction(CodeActionParam ¶m,
|
||||||
ReplyOnce &reply) {
|
ReplyOnce &reply) {
|
||||||
WorkingFile *wfile =
|
WorkingFile *wfile =
|
||||||
working_files->GetFileByFilename(param.textDocument.uri.GetPath());
|
wfiles->GetFileByFilename(param.textDocument.uri.GetPath());
|
||||||
if (!wfile) {
|
if (!wfile) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
std::vector<CodeAction> result;
|
std::vector<CodeAction> result;
|
||||||
std::vector<lsDiagnostic> diagnostics;
|
std::vector<lsDiagnostic> diagnostics;
|
||||||
working_files->DoAction([&]() { diagnostics = wfile->diagnostics_; });
|
wfiles->DoAction([&]() { diagnostics = wfile->diagnostics_; });
|
||||||
for (lsDiagnostic &diag : diagnostics)
|
for (lsDiagnostic &diag : diagnostics)
|
||||||
if (diag.fixits_.size()) {
|
if (diag.fixits_.size()) {
|
||||||
CodeAction &cmd = result.emplace_back();
|
CodeAction &cmd = result.emplace_back();
|
||||||
@ -95,7 +95,7 @@ void MessageHandler::textDocument_codeLens(TextDocumentParam ¶m,
|
|||||||
|
|
||||||
QueryFile *file = FindFile(reply, path);
|
QueryFile *file = FindFile(reply, path);
|
||||||
WorkingFile *wfile =
|
WorkingFile *wfile =
|
||||||
file ? working_files->GetFileByFilename(file->def->path) : nullptr;
|
file ? wfiles->GetFileByFilename(file->def->path) : nullptr;
|
||||||
if (!wfile) {
|
if (!wfile) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -188,7 +188,7 @@ void MessageHandler::workspace_executeCommand(Reader &reader,
|
|||||||
std::vector<lsLocation> result;
|
std::vector<lsLocation> result;
|
||||||
auto Map = [&](auto &&uses) {
|
auto Map = [&](auto &&uses) {
|
||||||
for (auto &use : uses)
|
for (auto &use : uses)
|
||||||
if (auto loc = GetLsLocation(db, working_files, use))
|
if (auto loc = GetLsLocation(db, wfiles, use))
|
||||||
result.push_back(std::move(*loc));
|
result.push_back(std::move(*loc));
|
||||||
};
|
};
|
||||||
switch (cmd.kind) {
|
switch (cmd.kind) {
|
||||||
|
@ -14,12 +14,12 @@ limitations under the License.
|
|||||||
==============================================================================*/
|
==============================================================================*/
|
||||||
|
|
||||||
#include "clang_complete.hh"
|
#include "clang_complete.hh"
|
||||||
#include "fuzzy_match.h"
|
#include "fuzzy_match.hh"
|
||||||
#include "include_complete.h"
|
#include "include_complete.hh"
|
||||||
#include "log.hh"
|
#include "log.hh"
|
||||||
#include "message_handler.hh"
|
#include "message_handler.hh"
|
||||||
#include "pipeline.hh"
|
#include "pipeline.hh"
|
||||||
#include "working_files.h"
|
#include "working_files.hh"
|
||||||
|
|
||||||
#include <clang/Sema/CodeCompleteConsumer.h>
|
#include <clang/Sema/CodeCompleteConsumer.h>
|
||||||
#include <clang/Sema/Sema.h>
|
#include <clang/Sema/Sema.h>
|
||||||
@ -453,7 +453,7 @@ void MessageHandler::textDocument_completion(lsCompletionParams ¶m,
|
|||||||
static CompleteConsumerCache<std::vector<lsCompletionItem>> cache;
|
static CompleteConsumerCache<std::vector<lsCompletionItem>> cache;
|
||||||
lsCompletionList result;
|
lsCompletionList result;
|
||||||
std::string path = param.textDocument.uri.GetPath();
|
std::string path = param.textDocument.uri.GetPath();
|
||||||
WorkingFile *file = working_files->GetFileByFilename(path);
|
WorkingFile *file = wfiles->GetFileByFilename(path);
|
||||||
if (!file) {
|
if (!file) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@ limitations under the License.
|
|||||||
==============================================================================*/
|
==============================================================================*/
|
||||||
|
|
||||||
#include "message_handler.hh"
|
#include "message_handler.hh"
|
||||||
#include "query_utils.h"
|
#include "query_utils.hh"
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
@ -54,7 +54,7 @@ void MessageHandler::textDocument_definition(TextDocumentPositionParam ¶m,
|
|||||||
|
|
||||||
std::vector<lsLocation> result;
|
std::vector<lsLocation> result;
|
||||||
Maybe<Use> on_def;
|
Maybe<Use> on_def;
|
||||||
WorkingFile *wfile = working_files->GetFileByFilename(file->def->path);
|
WorkingFile *wfile = wfiles->GetFileByFilename(file->def->path);
|
||||||
lsPosition &ls_pos = param.position;
|
lsPosition &ls_pos = param.position;
|
||||||
|
|
||||||
for (SymbolRef sym : FindSymbolsAtLocation(wfile, file, ls_pos, true)) {
|
for (SymbolRef sym : FindSymbolsAtLocation(wfile, file, ls_pos, true)) {
|
||||||
@ -87,7 +87,7 @@ void MessageHandler::textDocument_definition(TextDocumentPositionParam ¶m,
|
|||||||
if (uses.empty() && on_def)
|
if (uses.empty() && on_def)
|
||||||
uses.push_back(*on_def);
|
uses.push_back(*on_def);
|
||||||
}
|
}
|
||||||
auto locs = GetLsLocations(db, working_files, uses);
|
auto locs = GetLsLocations(db, wfiles, uses);
|
||||||
result.insert(result.end(), locs.begin(), locs.end());
|
result.insert(result.end(), locs.begin(), locs.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -158,7 +158,7 @@ void MessageHandler::textDocument_definition(TextDocumentPositionParam ¶m,
|
|||||||
if (best_sym.kind != SymbolKind::Invalid) {
|
if (best_sym.kind != SymbolKind::Invalid) {
|
||||||
Maybe<DeclRef> dr = GetDefinitionSpell(db, best_sym);
|
Maybe<DeclRef> dr = GetDefinitionSpell(db, best_sym);
|
||||||
assert(dr);
|
assert(dr);
|
||||||
if (auto loc = GetLsLocation(db, working_files, *dr))
|
if (auto loc = GetLsLocation(db, wfiles, *dr))
|
||||||
result.push_back(*loc);
|
result.push_back(*loc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -172,18 +172,18 @@ void MessageHandler::textDocument_typeDefinition(
|
|||||||
QueryFile *file = FindFile(reply, param.textDocument.uri.GetPath());
|
QueryFile *file = FindFile(reply, param.textDocument.uri.GetPath());
|
||||||
if (!file)
|
if (!file)
|
||||||
return;
|
return;
|
||||||
WorkingFile *working_file = working_files->GetFileByFilename(file->def->path);
|
WorkingFile *working_file = wfiles->GetFileByFilename(file->def->path);
|
||||||
|
|
||||||
std::vector<lsLocation> result;
|
std::vector<lsLocation> result;
|
||||||
auto Add = [&](const QueryType &type) {
|
auto Add = [&](const QueryType &type) {
|
||||||
for (const auto &def : type.def)
|
for (const auto &def : type.def)
|
||||||
if (def.spell) {
|
if (def.spell) {
|
||||||
if (auto ls_loc = GetLsLocation(db, working_files, *def.spell))
|
if (auto ls_loc = GetLsLocation(db, wfiles, *def.spell))
|
||||||
result.push_back(*ls_loc);
|
result.push_back(*ls_loc);
|
||||||
}
|
}
|
||||||
if (result.empty())
|
if (result.empty())
|
||||||
for (const DeclRef &dr : type.declarations)
|
for (const DeclRef &dr : type.declarations)
|
||||||
if (auto ls_loc = GetLsLocation(db, working_files, dr))
|
if (auto ls_loc = GetLsLocation(db, wfiles, dr))
|
||||||
result.push_back(*ls_loc);
|
result.push_back(*ls_loc);
|
||||||
};
|
};
|
||||||
for (SymbolRef sym :
|
for (SymbolRef sym :
|
||||||
|
@ -14,16 +14,16 @@ limitations under the License.
|
|||||||
==============================================================================*/
|
==============================================================================*/
|
||||||
|
|
||||||
#include "clang_complete.hh"
|
#include "clang_complete.hh"
|
||||||
#include "include_complete.h"
|
#include "include_complete.hh"
|
||||||
#include "message_handler.hh"
|
#include "message_handler.hh"
|
||||||
#include "pipeline.hh"
|
#include "pipeline.hh"
|
||||||
#include "project.hh"
|
#include "project.hh"
|
||||||
#include "working_files.h"
|
#include "working_files.hh"
|
||||||
|
|
||||||
namespace ccls {
|
namespace ccls {
|
||||||
void MessageHandler::textDocument_didChange(TextDocumentDidChangeParam ¶m) {
|
void MessageHandler::textDocument_didChange(TextDocumentDidChangeParam ¶m) {
|
||||||
std::string path = param.textDocument.uri.GetPath();
|
std::string path = param.textDocument.uri.GetPath();
|
||||||
working_files->OnChange(param);
|
wfiles->OnChange(param);
|
||||||
if (g_config->index.onChange)
|
if (g_config->index.onChange)
|
||||||
pipeline::Index(path, {}, IndexMode::OnChange);
|
pipeline::Index(path, {}, IndexMode::OnChange);
|
||||||
clang_complete->NotifyView(path);
|
clang_complete->NotifyView(path);
|
||||||
@ -33,13 +33,13 @@ void MessageHandler::textDocument_didChange(TextDocumentDidChangeParam ¶m) {
|
|||||||
|
|
||||||
void MessageHandler::textDocument_didClose(TextDocumentParam ¶m) {
|
void MessageHandler::textDocument_didClose(TextDocumentParam ¶m) {
|
||||||
std::string path = param.textDocument.uri.GetPath();
|
std::string path = param.textDocument.uri.GetPath();
|
||||||
working_files->OnClose(param.textDocument);
|
wfiles->OnClose(param.textDocument);
|
||||||
clang_complete->OnClose(path);
|
clang_complete->OnClose(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MessageHandler::textDocument_didOpen(DidOpenTextDocumentParam ¶m) {
|
void MessageHandler::textDocument_didOpen(DidOpenTextDocumentParam ¶m) {
|
||||||
std::string path = param.textDocument.uri.GetPath();
|
std::string path = param.textDocument.uri.GetPath();
|
||||||
WorkingFile *working_file = working_files->OnOpen(param.textDocument);
|
WorkingFile *working_file = wfiles->OnOpen(param.textDocument);
|
||||||
if (std::optional<std::string> cached_file_contents =
|
if (std::optional<std::string> cached_file_contents =
|
||||||
pipeline::LoadIndexedContent(path))
|
pipeline::LoadIndexedContent(path))
|
||||||
working_file->SetIndexContent(*cached_file_contents);
|
working_file->SetIndexContent(*cached_file_contents);
|
||||||
|
@ -15,7 +15,7 @@ limitations under the License.
|
|||||||
|
|
||||||
#include "message_handler.hh"
|
#include "message_handler.hh"
|
||||||
#include "pipeline.hh"
|
#include "pipeline.hh"
|
||||||
#include "query_utils.h"
|
#include "query_utils.hh"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
@ -48,7 +48,7 @@ void MessageHandler::textDocument_documentHighlight(
|
|||||||
if (!file)
|
if (!file)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
WorkingFile *wfile = working_files->GetFileByFilename(file->def->path);
|
WorkingFile *wfile = wfiles->GetFileByFilename(file->def->path);
|
||||||
std::vector<DocumentHighlight> result;
|
std::vector<DocumentHighlight> result;
|
||||||
|
|
||||||
std::vector<SymbolRef> syms =
|
std::vector<SymbolRef> syms =
|
||||||
@ -62,7 +62,7 @@ void MessageHandler::textDocument_documentHighlight(
|
|||||||
return usr == sym1.usr && kind == sym1.kind;
|
return usr == sym1.usr && kind == sym1.kind;
|
||||||
}))
|
}))
|
||||||
continue;
|
continue;
|
||||||
if (auto loc = GetLsLocation(db, working_files, sym, file_id)) {
|
if (auto loc = GetLsLocation(db, wfiles, sym, file_id)) {
|
||||||
DocumentHighlight highlight;
|
DocumentHighlight highlight;
|
||||||
highlight.range = loc->range;
|
highlight.range = loc->range;
|
||||||
if (sym.role & Role::Write)
|
if (sym.role & Role::Write)
|
||||||
@ -148,7 +148,7 @@ void MessageHandler::textDocument_documentSymbol(Reader &reader,
|
|||||||
QueryFile *file = FindFile(reply, param.textDocument.uri.GetPath(), &file_id);
|
QueryFile *file = FindFile(reply, param.textDocument.uri.GetPath(), &file_id);
|
||||||
if (!file)
|
if (!file)
|
||||||
return;
|
return;
|
||||||
WorkingFile *wfile = working_files->GetFileByFilename(file->def->path);
|
WorkingFile *wfile = wfiles->GetFileByFilename(file->def->path);
|
||||||
if (!wfile)
|
if (!wfile)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -158,7 +158,7 @@ void MessageHandler::textDocument_documentSymbol(Reader &reader,
|
|||||||
if (refcnt > 0 && (param.all || sym.extent.Valid()) &&
|
if (refcnt > 0 && (param.all || sym.extent.Valid()) &&
|
||||||
param.startLine <= sym.range.start.line &&
|
param.startLine <= sym.range.start.line &&
|
||||||
sym.range.start.line <= param.endLine)
|
sym.range.start.line <= param.endLine)
|
||||||
if (auto loc = GetLsLocation(db, working_files, sym, file_id))
|
if (auto loc = GetLsLocation(db, wfiles, sym, file_id))
|
||||||
result.push_back(loc->range);
|
result.push_back(loc->range);
|
||||||
std::sort(result.begin(), result.end());
|
std::sort(result.begin(), result.end());
|
||||||
reply(result);
|
reply(result);
|
||||||
@ -250,7 +250,7 @@ void MessageHandler::textDocument_documentSymbol(Reader &reader,
|
|||||||
Ignore(db->GetType(sym).AnyDef())) ||
|
Ignore(db->GetType(sym).AnyDef())) ||
|
||||||
(sym.kind == SymbolKind::Var && Ignore(db->GetVar(sym).AnyDef())))
|
(sym.kind == SymbolKind::Var && Ignore(db->GetVar(sym).AnyDef())))
|
||||||
continue;
|
continue;
|
||||||
if (auto loc = GetLsLocation(db, working_files, sym, file_id)) {
|
if (auto loc = GetLsLocation(db, wfiles, sym, file_id)) {
|
||||||
info->location = *loc;
|
info->location = *loc;
|
||||||
result.push_back(*info);
|
result.push_back(*info);
|
||||||
}
|
}
|
||||||
|
@ -16,8 +16,8 @@ limitations under the License.
|
|||||||
#include "message_handler.hh"
|
#include "message_handler.hh"
|
||||||
#include "pipeline.hh"
|
#include "pipeline.hh"
|
||||||
#include "project.hh"
|
#include "project.hh"
|
||||||
#include "query_utils.h"
|
#include "query_utils.hh"
|
||||||
#include "working_files.h"
|
#include "working_files.hh"
|
||||||
|
|
||||||
namespace ccls {
|
namespace ccls {
|
||||||
namespace {
|
namespace {
|
||||||
@ -34,7 +34,7 @@ void MessageHandler::textDocument_foldingRange(TextDocumentParam ¶m,
|
|||||||
QueryFile *file = FindFile(reply, param.textDocument.uri.GetPath());
|
QueryFile *file = FindFile(reply, param.textDocument.uri.GetPath());
|
||||||
if (!file)
|
if (!file)
|
||||||
return;
|
return;
|
||||||
WorkingFile *wfile = working_files->GetFileByFilename(file->def->path);
|
WorkingFile *wfile = wfiles->GetFileByFilename(file->def->path);
|
||||||
if (!wfile)
|
if (!wfile)
|
||||||
return;
|
return;
|
||||||
std::vector<FoldingRange> result;
|
std::vector<FoldingRange> result;
|
||||||
|
@ -15,7 +15,7 @@ limitations under the License.
|
|||||||
|
|
||||||
#include "message_handler.hh"
|
#include "message_handler.hh"
|
||||||
#include "pipeline.hh"
|
#include "pipeline.hh"
|
||||||
#include "working_files.h"
|
#include "working_files.hh"
|
||||||
|
|
||||||
#include <clang/Format/Format.h>
|
#include <clang/Format/Format.h>
|
||||||
#include <clang/Tooling/Core/Replacement.h>
|
#include <clang/Tooling/Core/Replacement.h>
|
||||||
@ -87,7 +87,7 @@ void MessageHandler::textDocument_formatting(DocumentFormattingParam ¶m,
|
|||||||
QueryFile *file = FindFile(reply, param.textDocument.uri.GetPath());
|
QueryFile *file = FindFile(reply, param.textDocument.uri.GetPath());
|
||||||
if (!file)
|
if (!file)
|
||||||
return;
|
return;
|
||||||
WorkingFile *wfile = working_files->GetFileByFilename(file->def->path);
|
WorkingFile *wfile = wfiles->GetFileByFilename(file->def->path);
|
||||||
if (!wfile)
|
if (!wfile)
|
||||||
return;
|
return;
|
||||||
Format(reply, wfile, {0, (unsigned)wfile->buffer_content.size()});
|
Format(reply, wfile, {0, (unsigned)wfile->buffer_content.size()});
|
||||||
@ -98,7 +98,7 @@ void MessageHandler::textDocument_onTypeFormatting(
|
|||||||
QueryFile *file = FindFile(reply, param.textDocument.uri.GetPath());
|
QueryFile *file = FindFile(reply, param.textDocument.uri.GetPath());
|
||||||
if (!file)
|
if (!file)
|
||||||
return;
|
return;
|
||||||
WorkingFile *wfile = working_files->GetFileByFilename(file->def->path);
|
WorkingFile *wfile = wfiles->GetFileByFilename(file->def->path);
|
||||||
if (!wfile)
|
if (!wfile)
|
||||||
return;
|
return;
|
||||||
std::string_view code = wfile->buffer_content;
|
std::string_view code = wfile->buffer_content;
|
||||||
@ -114,7 +114,7 @@ void MessageHandler::textDocument_rangeFormatting(
|
|||||||
QueryFile *file = FindFile(reply, param.textDocument.uri.GetPath());
|
QueryFile *file = FindFile(reply, param.textDocument.uri.GetPath());
|
||||||
if (!file)
|
if (!file)
|
||||||
return;
|
return;
|
||||||
WorkingFile *wfile = working_files->GetFileByFilename(file->def->path);
|
WorkingFile *wfile = wfiles->GetFileByFilename(file->def->path);
|
||||||
if (!wfile)
|
if (!wfile)
|
||||||
return;
|
return;
|
||||||
std::string_view code = wfile->buffer_content;
|
std::string_view code = wfile->buffer_content;
|
||||||
|
@ -14,7 +14,7 @@ limitations under the License.
|
|||||||
==============================================================================*/
|
==============================================================================*/
|
||||||
|
|
||||||
#include "message_handler.hh"
|
#include "message_handler.hh"
|
||||||
#include "query_utils.h"
|
#include "query_utils.hh"
|
||||||
|
|
||||||
namespace ccls {
|
namespace ccls {
|
||||||
namespace {
|
namespace {
|
||||||
@ -97,12 +97,12 @@ void MessageHandler::textDocument_hover(TextDocumentPositionParam ¶m,
|
|||||||
if (!file)
|
if (!file)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
WorkingFile *wfile = working_files->GetFileByFilename(file->def->path);
|
WorkingFile *wfile = wfiles->GetFileByFilename(file->def->path);
|
||||||
Hover result;
|
Hover result;
|
||||||
|
|
||||||
for (SymbolRef sym : FindSymbolsAtLocation(wfile, file, param.position)) {
|
for (SymbolRef sym : FindSymbolsAtLocation(wfile, file, param.position)) {
|
||||||
std::optional<lsRange> ls_range = GetLsRange(
|
std::optional<lsRange> ls_range = GetLsRange(
|
||||||
working_files->GetFileByFilename(file->def->path), sym.range);
|
wfiles->GetFileByFilename(file->def->path), sym.range);
|
||||||
if (!ls_range)
|
if (!ls_range)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ limitations under the License.
|
|||||||
==============================================================================*/
|
==============================================================================*/
|
||||||
|
|
||||||
#include "message_handler.hh"
|
#include "message_handler.hh"
|
||||||
#include "query_utils.h"
|
#include "query_utils.hh"
|
||||||
|
|
||||||
#include <unordered_set>
|
#include <unordered_set>
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ void MessageHandler::textDocument_references(Reader &reader, ReplyOnce &reply) {
|
|||||||
if (!file)
|
if (!file)
|
||||||
return;
|
return;
|
||||||
std::vector<lsLocation> result;
|
std::vector<lsLocation> result;
|
||||||
WorkingFile *wfile = working_files->GetFileByFilename(file->def->path);
|
WorkingFile *wfile = wfiles->GetFileByFilename(file->def->path);
|
||||||
if (!file)
|
if (!file)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -64,7 +64,7 @@ void MessageHandler::textDocument_references(Reader &reader, ReplyOnce &reply) {
|
|||||||
if (Role(use.role & param.context.role) == param.context.role &&
|
if (Role(use.role & param.context.role) == param.context.role &&
|
||||||
!(use.role & param.context.excludeRole) &&
|
!(use.role & param.context.excludeRole) &&
|
||||||
seen_uses.insert(use).second)
|
seen_uses.insert(use).second)
|
||||||
if (auto loc = GetLsLocation(db, working_files, use)) {
|
if (auto loc = GetLsLocation(db, wfiles, use)) {
|
||||||
result.push_back(*loc);
|
result.push_back(*loc);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -14,17 +14,17 @@ limitations under the License.
|
|||||||
==============================================================================*/
|
==============================================================================*/
|
||||||
|
|
||||||
#include "message_handler.hh"
|
#include "message_handler.hh"
|
||||||
#include "query_utils.h"
|
#include "query_utils.hh"
|
||||||
|
|
||||||
namespace ccls {
|
namespace ccls {
|
||||||
namespace {
|
namespace {
|
||||||
lsWorkspaceEdit BuildWorkspaceEdit(DB *db, WorkingFiles *working_files,
|
lsWorkspaceEdit BuildWorkspaceEdit(DB *db, WorkingFiles *wfiles,
|
||||||
SymbolRef sym, const std::string &new_text) {
|
SymbolRef sym, const std::string &new_text) {
|
||||||
std::unordered_map<int, lsTextDocumentEdit> path_to_edit;
|
std::unordered_map<int, lsTextDocumentEdit> path_to_edit;
|
||||||
|
|
||||||
EachOccurrence(db, sym, true, [&](Use use) {
|
EachOccurrence(db, sym, true, [&](Use use) {
|
||||||
std::optional<lsLocation> ls_location =
|
std::optional<lsLocation> ls_location =
|
||||||
GetLsLocation(db, working_files, use);
|
GetLsLocation(db, wfiles, use);
|
||||||
if (!ls_location)
|
if (!ls_location)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -39,7 +39,7 @@ lsWorkspaceEdit BuildWorkspaceEdit(DB *db, WorkingFiles *working_files,
|
|||||||
const std::string &path = file.def->path;
|
const std::string &path = file.def->path;
|
||||||
path_to_edit[file_id].textDocument.uri = lsDocumentUri::FromPath(path);
|
path_to_edit[file_id].textDocument.uri = lsDocumentUri::FromPath(path);
|
||||||
|
|
||||||
WorkingFile *working_file = working_files->GetFileByFilename(path);
|
WorkingFile *working_file = wfiles->GetFileByFilename(path);
|
||||||
if (working_file)
|
if (working_file)
|
||||||
path_to_edit[file_id].textDocument.version = working_file->version;
|
path_to_edit[file_id].textDocument.version = working_file->version;
|
||||||
}
|
}
|
||||||
@ -67,10 +67,10 @@ void MessageHandler::textDocument_rename(RenameParam ¶m, ReplyOnce &reply) {
|
|||||||
if (!file)
|
if (!file)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
WorkingFile *wfile = working_files->GetFileByFilename(file->def->path);
|
WorkingFile *wfile = wfiles->GetFileByFilename(file->def->path);
|
||||||
lsWorkspaceEdit result;
|
lsWorkspaceEdit result;
|
||||||
for (SymbolRef sym : FindSymbolsAtLocation(wfile, file, param.position)) {
|
for (SymbolRef sym : FindSymbolsAtLocation(wfile, file, param.position)) {
|
||||||
result = BuildWorkspaceEdit(db, working_files, sym, param.newName);
|
result = BuildWorkspaceEdit(db, wfiles, sym, param.newName);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -156,7 +156,7 @@ void MessageHandler::textDocument_signatureHelp(
|
|||||||
|
|
||||||
std::string path = param.textDocument.uri.GetPath();
|
std::string path = param.textDocument.uri.GetPath();
|
||||||
lsPosition begin_pos = param.position;
|
lsPosition begin_pos = param.position;
|
||||||
if (WorkingFile *file = working_files->GetFileByFilename(path)) {
|
if (WorkingFile *file = wfiles->GetFileByFilename(path)) {
|
||||||
std::string completion_text;
|
std::string completion_text;
|
||||||
lsPosition end_pos = param.position;
|
lsPosition end_pos = param.position;
|
||||||
begin_pos = file->FindStableCompletionSource(param.position,
|
begin_pos = file->FindStableCompletionSource(param.position,
|
||||||
|
@ -14,12 +14,12 @@ limitations under the License.
|
|||||||
==============================================================================*/
|
==============================================================================*/
|
||||||
|
|
||||||
#include "clang_complete.hh"
|
#include "clang_complete.hh"
|
||||||
#include "fuzzy_match.h"
|
#include "fuzzy_match.hh"
|
||||||
#include "log.hh"
|
#include "log.hh"
|
||||||
#include "message_handler.hh"
|
#include "message_handler.hh"
|
||||||
#include "pipeline.hh"
|
#include "pipeline.hh"
|
||||||
#include "project.hh"
|
#include "project.hh"
|
||||||
#include "query_utils.h"
|
#include "query_utils.hh"
|
||||||
|
|
||||||
#include <llvm/ADT/STLExtras.h>
|
#include <llvm/ADT/STLExtras.h>
|
||||||
|
|
||||||
@ -34,7 +34,7 @@ MAKE_REFLECT_STRUCT(lsSymbolInformation, name, kind, location, containerName);
|
|||||||
void MessageHandler::workspace_didChangeConfiguration(EmptyParam &) {
|
void MessageHandler::workspace_didChangeConfiguration(EmptyParam &) {
|
||||||
for (const std::string &folder : g_config->workspaceFolders)
|
for (const std::string &folder : g_config->workspaceFolders)
|
||||||
project->Load(folder);
|
project->Load(folder);
|
||||||
project->Index(working_files, lsRequestId());
|
project->Index(wfiles, lsRequestId());
|
||||||
|
|
||||||
clang_complete->FlushAllSessions();
|
clang_complete->FlushAllSessions();
|
||||||
};
|
};
|
||||||
@ -43,7 +43,7 @@ void MessageHandler::workspace_didChangeWatchedFiles(
|
|||||||
DidChangeWatchedFilesParam ¶m) {
|
DidChangeWatchedFilesParam ¶m) {
|
||||||
for (auto &event : param.changes) {
|
for (auto &event : param.changes) {
|
||||||
std::string path = event.uri.GetPath();
|
std::string path = event.uri.GetPath();
|
||||||
IndexMode mode = working_files->GetFileByFilename(path)
|
IndexMode mode = wfiles->GetFileByFilename(path)
|
||||||
? IndexMode::Normal
|
? IndexMode::Normal
|
||||||
: IndexMode::NonInteractive;
|
: IndexMode::NonInteractive;
|
||||||
switch (event.type) {
|
switch (event.type) {
|
||||||
@ -88,7 +88,7 @@ void MessageHandler::workspace_didChangeWorkspaceFolders(
|
|||||||
project->Load(root);
|
project->Load(root);
|
||||||
}
|
}
|
||||||
|
|
||||||
project->Index(working_files, lsRequestId());
|
project->Index(wfiles, lsRequestId());
|
||||||
|
|
||||||
clang_complete->FlushAllSessions();
|
clang_complete->FlushAllSessions();
|
||||||
}
|
}
|
||||||
@ -96,7 +96,7 @@ void MessageHandler::workspace_didChangeWorkspaceFolders(
|
|||||||
namespace {
|
namespace {
|
||||||
// Lookup |symbol| in |db| and insert the value into |result|.
|
// Lookup |symbol| in |db| and insert the value into |result|.
|
||||||
bool AddSymbol(
|
bool AddSymbol(
|
||||||
DB *db, WorkingFiles *working_files, SymbolIdx sym, bool use_detailed,
|
DB *db, WorkingFiles *wfiles, SymbolIdx sym, bool use_detailed,
|
||||||
std::vector<std::tuple<lsSymbolInformation, int, SymbolIdx>> *result) {
|
std::vector<std::tuple<lsSymbolInformation, int, SymbolIdx>> *result) {
|
||||||
std::optional<lsSymbolInformation> info = GetSymbolInfo(db, sym, true);
|
std::optional<lsSymbolInformation> info = GetSymbolInfo(db, sym, true);
|
||||||
if (!info)
|
if (!info)
|
||||||
@ -112,7 +112,7 @@ bool AddSymbol(
|
|||||||
loc = decls[0];
|
loc = decls[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
std::optional<lsLocation> ls_location = GetLsLocation(db, working_files, loc);
|
std::optional<lsLocation> ls_location = GetLsLocation(db, wfiles, loc);
|
||||||
if (!ls_location)
|
if (!ls_location)
|
||||||
return false;
|
return false;
|
||||||
info->location = *ls_location;
|
info->location = *ls_location;
|
||||||
@ -141,7 +141,7 @@ void MessageHandler::workspace_symbol(WorkspaceSymbolParam ¶m,
|
|||||||
std::string_view detailed_name = db->GetSymbolName(sym, true);
|
std::string_view detailed_name = db->GetSymbolName(sym, true);
|
||||||
int pos = ReverseSubseqMatch(query_without_space, detailed_name, sensitive);
|
int pos = ReverseSubseqMatch(query_without_space, detailed_name, sensitive);
|
||||||
return pos >= 0 &&
|
return pos >= 0 &&
|
||||||
AddSymbol(db, working_files, sym,
|
AddSymbol(db, wfiles, sym,
|
||||||
detailed_name.find(':', pos) != std::string::npos,
|
detailed_name.find(':', pos) != std::string::npos,
|
||||||
&cands) &&
|
&cands) &&
|
||||||
cands.size() >= g_config->workspaceSymbol.maxNum;
|
cands.size() >= g_config->workspaceSymbol.maxNum;
|
||||||
|
@ -16,17 +16,17 @@ limitations under the License.
|
|||||||
#include "pipeline.hh"
|
#include "pipeline.hh"
|
||||||
|
|
||||||
#include "clang_complete.hh"
|
#include "clang_complete.hh"
|
||||||
#include "config.h"
|
#include "config.hh"
|
||||||
#include "include_complete.h"
|
#include "include_complete.hh"
|
||||||
#include "log.hh"
|
#include "log.hh"
|
||||||
#include "lsp.hh"
|
#include "lsp.hh"
|
||||||
#include "match.h"
|
#include "match.hh"
|
||||||
#include "message_handler.hh"
|
#include "message_handler.hh"
|
||||||
#include "pipeline.hh"
|
#include "pipeline.hh"
|
||||||
#include "platform.h"
|
#include "platform.hh"
|
||||||
#include "project.hh"
|
#include "project.hh"
|
||||||
#include "query_utils.h"
|
#include "query_utils.hh"
|
||||||
#include "serializers/json.h"
|
#include "serializers/json.hh"
|
||||||
|
|
||||||
#include <rapidjson/document.h>
|
#include <rapidjson/document.h>
|
||||||
#include <rapidjson/writer.h>
|
#include <rapidjson/writer.h>
|
||||||
@ -377,12 +377,12 @@ void Indexer_Main(CompletionManager *completion, VFS *vfs, Project *project,
|
|||||||
indexer_waiter->Wait(index_request);
|
indexer_waiter->Wait(index_request);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Main_OnIndexed(DB *db, WorkingFiles *working_files, IndexUpdate *update) {
|
void Main_OnIndexed(DB *db, WorkingFiles *wfiles, IndexUpdate *update) {
|
||||||
if (update->refresh) {
|
if (update->refresh) {
|
||||||
LOG_S(INFO)
|
LOG_S(INFO)
|
||||||
<< "loaded project. Refresh semantic highlight for all working file.";
|
<< "loaded project. Refresh semantic highlight for all working file.";
|
||||||
std::lock_guard<std::mutex> lock(working_files->files_mutex);
|
std::lock_guard<std::mutex> lock(wfiles->files_mutex);
|
||||||
for (auto &f : working_files->files) {
|
for (auto &f : wfiles->files) {
|
||||||
std::string filename = LowerPathIfInsensitive(f->filename);
|
std::string filename = LowerPathIfInsensitive(f->filename);
|
||||||
if (db->name2file_id.find(filename) == db->name2file_id.end())
|
if (db->name2file_id.find(filename) == db->name2file_id.end())
|
||||||
continue;
|
continue;
|
||||||
@ -401,7 +401,7 @@ void Main_OnIndexed(DB *db, WorkingFiles *working_files, IndexUpdate *update) {
|
|||||||
if (update->files_def_update) {
|
if (update->files_def_update) {
|
||||||
auto &def_u = *update->files_def_update;
|
auto &def_u = *update->files_def_update;
|
||||||
if (WorkingFile *wfile =
|
if (WorkingFile *wfile =
|
||||||
working_files->GetFileByFilename(def_u.first.path)) {
|
wfiles->GetFileByFilename(def_u.first.path)) {
|
||||||
// FIXME With index.onChange: true, use buffer_content only for
|
// FIXME With index.onChange: true, use buffer_content only for
|
||||||
// request.path
|
// request.path
|
||||||
wfile->SetIndexContent(g_config->index.onChange ? wfile->buffer_content
|
wfile->SetIndexContent(g_config->index.onChange ? wfile->buffer_content
|
||||||
@ -487,11 +487,11 @@ void LaunchStdout() {
|
|||||||
|
|
||||||
void MainLoop() {
|
void MainLoop() {
|
||||||
Project project;
|
Project project;
|
||||||
WorkingFiles working_files;
|
WorkingFiles wfiles;
|
||||||
VFS vfs;
|
VFS vfs;
|
||||||
|
|
||||||
CompletionManager clang_complete(
|
CompletionManager clang_complete(
|
||||||
&project, &working_files,
|
&project, &wfiles,
|
||||||
[&](std::string path, std::vector<lsDiagnostic> diagnostics) {
|
[&](std::string path, std::vector<lsDiagnostic> diagnostics) {
|
||||||
lsPublishDiagnosticsParams params;
|
lsPublishDiagnosticsParams params;
|
||||||
params.uri = lsDocumentUri::FromPath(path);
|
params.uri = lsDocumentUri::FromPath(path);
|
||||||
@ -515,7 +515,7 @@ void MainLoop() {
|
|||||||
handler.db = &db;
|
handler.db = &db;
|
||||||
handler.project = &project;
|
handler.project = &project;
|
||||||
handler.vfs = &vfs;
|
handler.vfs = &vfs;
|
||||||
handler.working_files = &working_files;
|
handler.wfiles = &wfiles;
|
||||||
handler.clang_complete = &clang_complete;
|
handler.clang_complete = &clang_complete;
|
||||||
handler.include_complete = &include_complete;
|
handler.include_complete = &include_complete;
|
||||||
|
|
||||||
@ -533,7 +533,7 @@ void MainLoop() {
|
|||||||
break;
|
break;
|
||||||
did_work = true;
|
did_work = true;
|
||||||
indexed = true;
|
indexed = true;
|
||||||
Main_OnIndexed(&db, &working_files, &*update);
|
Main_OnIndexed(&db, &wfiles, &*update);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (did_work)
|
if (did_work)
|
||||||
@ -556,7 +556,7 @@ void Standalone(const std::string &root) {
|
|||||||
|
|
||||||
MessageHandler handler;
|
MessageHandler handler;
|
||||||
handler.project = &project;
|
handler.project = &project;
|
||||||
handler.working_files = &wfiles;
|
handler.wfiles = &wfiles;
|
||||||
handler.vfs = &vfs;
|
handler.vfs = &vfs;
|
||||||
handler.include_complete = &complete;
|
handler.include_complete = &complete;
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "lsp.hh"
|
#include "lsp.hh"
|
||||||
#include "query.h"
|
#include "query.hh"
|
||||||
|
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
|
@ -14,9 +14,9 @@ limitations under the License.
|
|||||||
==============================================================================*/
|
==============================================================================*/
|
||||||
|
|
||||||
#if defined(__unix__) || defined(__APPLE__)
|
#if defined(__unix__) || defined(__APPLE__)
|
||||||
#include "platform.h"
|
#include "platform.hh"
|
||||||
|
|
||||||
#include "utils.h"
|
#include "utils.hh"
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
@ -14,9 +14,9 @@ limitations under the License.
|
|||||||
==============================================================================*/
|
==============================================================================*/
|
||||||
|
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
#include "platform.h"
|
#include "platform.hh"
|
||||||
|
|
||||||
#include "utils.h"
|
#include "utils.hh"
|
||||||
|
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
#include <direct.h>
|
#include <direct.h>
|
||||||
|
@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
==============================================================================*/
|
==============================================================================*/
|
||||||
|
|
||||||
#include "position.h"
|
#include "position.hh"
|
||||||
|
|
||||||
#include "serializer.hh"
|
#include "serializer.hh"
|
||||||
|
|
||||||
|
@ -15,8 +15,8 @@ limitations under the License.
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "maybe.h"
|
#include "maybe.hh"
|
||||||
#include "utils.h"
|
#include "utils.hh"
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <string>
|
#include <string>
|
@ -17,12 +17,12 @@ limitations under the License.
|
|||||||
|
|
||||||
#include "filesystem.hh"
|
#include "filesystem.hh"
|
||||||
#include "log.hh"
|
#include "log.hh"
|
||||||
#include "match.h"
|
#include "match.hh"
|
||||||
#include "pipeline.hh"
|
#include "pipeline.hh"
|
||||||
#include "platform.h"
|
#include "platform.hh"
|
||||||
#include "serializers/json.h"
|
#include "serializers/json.hh"
|
||||||
#include "utils.h"
|
#include "utils.hh"
|
||||||
#include "working_files.h"
|
#include "working_files.hh"
|
||||||
|
|
||||||
#include <clang/Driver/Compilation.h>
|
#include <clang/Driver/Compilation.h>
|
||||||
#include <clang/Driver/Driver.h>
|
#include <clang/Driver/Driver.h>
|
||||||
|
@ -15,7 +15,7 @@ limitations under the License.
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.hh"
|
||||||
#include "lsp.hh"
|
#include "lsp.hh"
|
||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
@ -13,11 +13,11 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
==============================================================================*/
|
==============================================================================*/
|
||||||
|
|
||||||
#include "query.h"
|
#include "query.hh"
|
||||||
|
|
||||||
#include "indexer.h"
|
#include "indexer.hh"
|
||||||
#include "serializer.hh"
|
#include "serializer.hh"
|
||||||
#include "serializers/json.h"
|
#include "serializers/json.hh"
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
@ -15,7 +15,7 @@ limitations under the License.
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "indexer.h"
|
#include "indexer.hh"
|
||||||
#include "serializer.hh"
|
#include "serializer.hh"
|
||||||
|
|
||||||
#include <llvm/ADT/DenseMap.h>
|
#include <llvm/ADT/DenseMap.h>
|
@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
==============================================================================*/
|
==============================================================================*/
|
||||||
|
|
||||||
#include "query_utils.h"
|
#include "query_utils.hh"
|
||||||
|
|
||||||
#include "pipeline.hh"
|
#include "pipeline.hh"
|
||||||
|
|
||||||
|
@ -15,8 +15,8 @@ limitations under the License.
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "query.h"
|
#include "query.hh"
|
||||||
#include "working_files.h"
|
#include "working_files.hh"
|
||||||
|
|
||||||
#include <optional>
|
#include <optional>
|
||||||
|
|
@ -16,10 +16,10 @@ limitations under the License.
|
|||||||
#include "serializer.hh"
|
#include "serializer.hh"
|
||||||
|
|
||||||
#include "filesystem.hh"
|
#include "filesystem.hh"
|
||||||
#include "indexer.h"
|
#include "indexer.hh"
|
||||||
#include "log.hh"
|
#include "log.hh"
|
||||||
#include "serializers/binary.h"
|
#include "serializers/binary.hh"
|
||||||
#include "serializers/json.h"
|
#include "serializers/json.hh"
|
||||||
|
|
||||||
#include <llvm/ADT/CachedHashString.h>
|
#include <llvm/ADT/CachedHashString.h>
|
||||||
#include <llvm/ADT/DenseSet.h>
|
#include <llvm/ADT/DenseSet.h>
|
||||||
|
@ -15,7 +15,7 @@ limitations under the License.
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "maybe.h"
|
#include "maybe.hh"
|
||||||
|
|
||||||
#include <llvm/Support/Compiler.h>
|
#include <llvm/Support/Compiler.h>
|
||||||
|
|
||||||
|
@ -13,15 +13,15 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
==============================================================================*/
|
==============================================================================*/
|
||||||
|
|
||||||
#include "test.h"
|
#include "test.hh"
|
||||||
|
|
||||||
#include "clang_complete.hh"
|
#include "clang_complete.hh"
|
||||||
#include "filesystem.hh"
|
#include "filesystem.hh"
|
||||||
#include "indexer.h"
|
#include "indexer.hh"
|
||||||
#include "pipeline.hh"
|
#include "pipeline.hh"
|
||||||
#include "platform.h"
|
#include "platform.hh"
|
||||||
#include "serializer.hh"
|
#include "serializer.hh"
|
||||||
#include "utils.h"
|
#include "utils.hh"
|
||||||
|
|
||||||
#include <llvm/Config/llvm-config.h>
|
#include <llvm/Config/llvm-config.h>
|
||||||
#include <llvm/ADT/StringRef.h>
|
#include <llvm/ADT/StringRef.h>
|
||||||
|
@ -15,7 +15,7 @@ limitations under the License.
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "utils.h"
|
#include "utils.hh"
|
||||||
|
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <condition_variable>
|
#include <condition_variable>
|
@ -13,10 +13,10 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
==============================================================================*/
|
==============================================================================*/
|
||||||
|
|
||||||
#include "utils.h"
|
#include "utils.hh"
|
||||||
|
|
||||||
#include "log.hh"
|
#include "log.hh"
|
||||||
#include "platform.h"
|
#include "platform.hh"
|
||||||
|
|
||||||
#include <siphash.h>
|
#include <siphash.h>
|
||||||
|
|
||||||
|
@ -13,10 +13,10 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
==============================================================================*/
|
==============================================================================*/
|
||||||
|
|
||||||
#include "working_files.h"
|
#include "working_files.hh"
|
||||||
|
|
||||||
#include "log.hh"
|
#include "log.hh"
|
||||||
#include "position.h"
|
#include "position.hh"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <climits>
|
#include <climits>
|
||||||
|
@ -16,7 +16,7 @@ limitations under the License.
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "lsp.hh"
|
#include "lsp.hh"
|
||||||
#include "utils.h"
|
#include "utils.hh"
|
||||||
|
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <optional>
|
#include <optional>
|
Loading…
Reference in New Issue
Block a user