mirror of
https://github.com/MaskRay/ccls.git
synced 2024-12-01 20:07:08 +00:00
Merge 5d401fc95d
into 4331c89586
This commit is contained in:
commit
e71ab5eea1
@ -313,7 +313,7 @@ private:
|
|||||||
void textDocument_signatureHelp(TextDocumentPositionParam &, ReplyOnce &);
|
void textDocument_signatureHelp(TextDocumentPositionParam &, ReplyOnce &);
|
||||||
void textDocument_switchSourceHeader(TextDocumentIdentifier &, ReplyOnce &);
|
void textDocument_switchSourceHeader(TextDocumentIdentifier &, ReplyOnce &);
|
||||||
void textDocument_typeDefinition(TextDocumentPositionParam &, ReplyOnce &);
|
void textDocument_typeDefinition(TextDocumentPositionParam &, ReplyOnce &);
|
||||||
void workspace_didChangeConfiguration(EmptyParam &);
|
void workspace_didChangeConfiguration(JsonReader &);
|
||||||
void workspace_didChangeWatchedFiles(DidChangeWatchedFilesParam &);
|
void workspace_didChangeWatchedFiles(DidChangeWatchedFilesParam &);
|
||||||
void workspace_didChangeWorkspaceFolders(DidChangeWorkspaceFoldersParam &);
|
void workspace_didChangeWorkspaceFolders(DidChangeWorkspaceFoldersParam &);
|
||||||
void workspace_executeCommand(JsonReader &, ReplyOnce &);
|
void workspace_executeCommand(JsonReader &, ReplyOnce &);
|
||||||
|
@ -13,6 +13,9 @@
|
|||||||
#include <llvm/ADT/StringRef.h>
|
#include <llvm/ADT/StringRef.h>
|
||||||
#include <llvm/Support/Path.h>
|
#include <llvm/Support/Path.h>
|
||||||
|
|
||||||
|
#include <rapidjson/document.h>
|
||||||
|
#include <rapidjson/writer.h>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
@ -22,13 +25,31 @@ using namespace llvm;
|
|||||||
namespace ccls {
|
namespace ccls {
|
||||||
REFLECT_STRUCT(SymbolInformation, name, kind, location, containerName);
|
REFLECT_STRUCT(SymbolInformation, name, kind, location, containerName);
|
||||||
|
|
||||||
void MessageHandler::workspace_didChangeConfiguration(EmptyParam &) {
|
void MessageHandler::workspace_didChangeConfiguration(JsonReader &reader) {
|
||||||
|
auto it = reader.m->FindMember("settings");
|
||||||
|
if (!(it != reader.m->MemberEnd() && it->value.IsObject()))
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Similar to MessageHandler::initialize.
|
||||||
|
rapidjson::StringBuffer output;
|
||||||
|
rapidjson::Writer<rapidjson::StringBuffer> writer(output);
|
||||||
|
JsonReader m1(&it->value);
|
||||||
|
it->value.Accept(writer);
|
||||||
|
LOG_S(INFO) << "didChangeConfiguration: " << output.GetString();
|
||||||
|
try {
|
||||||
|
reflect(m1, *g_config);
|
||||||
|
} catch (std::invalid_argument &) {
|
||||||
|
reader.path_.push_back("settings");
|
||||||
|
reader.path_.insert(reader.path_.end(), m1.path_.begin(), m1.path_.end());
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
|
||||||
for (auto &[folder, _] : g_config->workspaceFolders)
|
for (auto &[folder, _] : g_config->workspaceFolders)
|
||||||
project->load(folder);
|
project->load(folder);
|
||||||
project->index(wfiles, RequestId());
|
project->index(wfiles, RequestId());
|
||||||
|
|
||||||
manager->clear();
|
manager->clear();
|
||||||
};
|
}
|
||||||
|
|
||||||
void MessageHandler::workspace_didChangeWatchedFiles(
|
void MessageHandler::workspace_didChangeWatchedFiles(
|
||||||
DidChangeWatchedFilesParam ¶m) {
|
DidChangeWatchedFilesParam ¶m) {
|
||||||
|
Loading…
Reference in New Issue
Block a user