Skip to content
Permalink
Browse files

Override.

  • Loading branch information...
Andersbakken committed Nov 8, 2019
1 parent c0a4218 commit b3017d51cba6eab80d58e85c63adabaaef7cd771
Showing with 32 additions and 32 deletions.
  1. +18 −18 src/ClangThread.cpp
  2. +1 −1 src/ClangThread.h
  3. +2 −2 src/IndexDataMessage.h
  4. +2 −2 src/LogOutputMessage.h
  5. +3 −3 src/QueryJob.h
  6. +1 −1 src/RTags.cpp
  7. +2 −2 src/VisitFileMessage.h
  8. +2 −2 src/VisitFileResponseMessage.h
  9. +1 −1 src/rct
@@ -116,7 +116,7 @@ CXChildVisitResult ClangThread::visit(const CXCursor &cursor)

printCursor(cursor);

writeToConnetion(message);
writeToConnection(message);
if (refSpecialized) {
visit(ref);
}
@@ -152,7 +152,7 @@ void ClangThread::run()
warning() << "parseTime" << parseTime;
{
if (mQueryMessage->type() == QueryMessage::DumpFile && mQueryMessage->flags() & QueryMessage::DumpCheckIncludes)
writeToConnetion(String::format<128>("Indexed: %s => %s", translationUnit->clangLine.constData(), translationUnit ? "success" : "failure"));
writeToConnection(String::format<128>("Indexed: %s => %s", translationUnit->clangLine.constData(), translationUnit ? "success" : "failure"));

if (translationUnit) {
clang_visitChildren(clang_getTranslationUnitCursor(translationUnit->unit), ClangThread::visitor, this);
@@ -165,19 +165,19 @@ void ClangThread::run()
mConnection->disconnected().disconnect(key);
std::weak_ptr<Connection> conn = mConnection;
EventLoop::mainEventLoop()->callLater([conn]() {
if (auto c = conn.lock())
c->finish();
});
if (auto c = conn.lock())
c->finish();
});
}

void ClangThread::writeToConnetion(const String &message)
void ClangThread::writeToConnection(const String &message)
{
std::weak_ptr<Connection> conn = mConnection;
EventLoop::mainEventLoop()->callLater([conn, message]() {
if (auto c = conn.lock()) {
c->write(message);
}
});
if (auto c = conn.lock()) {
c->write(message);
}
});
}

void ClangThread::handleInclude(Location loc, const CXCursor &cursor)
@@ -277,9 +277,9 @@ void ClangThread::checkIncludes()
for (const auto &dep : it.second->includes) {
Set<uint32_t> seen;
if (!validateNeedsInclude(it.second, static_cast<Dep*>(dep.second), seen)) {
writeToConnetion(String::format<128>("%s includes %s for no reason",
path.constData(),
Location::path(dep.second->fileId).constData()));
writeToConnection(String::format<128>("%s includes %s for no reason",
path.constData(),
Location::path(dep.second->fileId).constData()));
}
}

@@ -298,12 +298,12 @@ void ClangThread::checkIncludes()
log << r.first << "=>" << r.second;
reasons << reason;
}
writeToConnetion(String::format<128>("%s should include %s (%s)",
Location::path(it.first).constData(),
Location::path(ref.first).constData(),
String::join(reasons, " ").constData()));
writeToConnection(String::format<128>("%s should include %s (%s)",
Location::path(it.first).constData(),
Location::path(ref.first).constData(),
String::join(reasons, " ").constData()));
// for (const auto &incs : mDependencies[ref.first]->dependents) {
// writeToConnetion(String::format<128>("GOT INCLUDER %s:%d", Location::path(incs.first).constData(),
// writeToConnection(String::format<128>("GOT INCLUDER %s:%d", Location::path(incs.first).constData(),
// incs.first));
// }
}
@@ -41,7 +41,7 @@ class ClangThread : public Thread
CXChildVisitResult visit(const CXCursor &cursor);
void checkIncludes(Location location, const CXCursor &cursor);

void writeToConnetion(const String &message);
void writeToConnection(const String &message);
void handleInclude(Location loc, const CXCursor &cursor);
void handleReference(Location loc, const CXCursor &ref);
void checkIncludes();
@@ -36,8 +36,8 @@ class IndexDataMessage : public RTagsMessage
: RTagsMessage(MessageId), mParseTime(0), mId(0), mBytesWritten(0)
{}

void encode(Serializer &serializer) const;
void decode(Deserializer &deserializer);
void encode(Serializer &serializer) const override;
void decode(Deserializer &deserializer) override;

enum Flag {
None = 0x0,
@@ -32,12 +32,12 @@ class LogOutputMessage : public RTagsMessage
LogLevel level() const { return mLevel; }
Flags<QueryMessage::Flag> flags() const { return mFlags; }

void encode(Serializer &serializer) const
void encode(Serializer &serializer) const override
{
serializer << mCommandLine << mLevel << mFlags;
}

void decode(Deserializer &deserializer)
void decode(Deserializer &deserializer) override
{
deserializer >> mCommandLine >> mLevel >> mFlags;
}
@@ -111,15 +111,15 @@ class QueryJob : public Project::FileMapScopeScope
{
public:
PathFilter(const Path &p) : pattern(p) {}
virtual bool match(uint32_t, const Path &path) const { return path.startsWith(pattern); }
virtual bool match(uint32_t, const Path &path) const override { return path.startsWith(pattern); }

const Path pattern;
};
class RegexFilter : public Filter
{
public:
RegexFilter(const String &str, bool caseInsensitive) : regex(str.ref(), caseInsensitive ? std::regex::icase : std::regex::ECMAScript) {}
virtual bool match(uint32_t, const Path &path) const { return std::regex_search(path.constData(), regex); }
virtual bool match(uint32_t, const Path &path) const override { return std::regex_search(path.constData(), regex); }

const std::regex regex;
};
@@ -128,7 +128,7 @@ class QueryJob : public Project::FileMapScopeScope
{
public:
DependencyFilter(uint32_t f, const std::shared_ptr<Project> &p) : fileId(f), project(p) {}
virtual bool match(uint32_t f, const Path &) const { return project->dependsOn(fileId, f); }
virtual bool match(uint32_t f, const Path &) const override { return project->dependsOn(fileId, f); }

const uint32_t fileId;
const std::shared_ptr<Project> project;
@@ -1157,7 +1157,7 @@ String typeString(const CXType &type)
class ElispFormatter : public Value::Formatter
{
public:
virtual void format(const Value &value, std::function<void(const char *, size_t)> output) const
virtual void format(const Value &value, std::function<void(const char *, size_t)> output) const override
{
switch (value.type()) {
case Value::Type_Invalid:
@@ -31,8 +31,8 @@ class VisitFileMessage : public RTagsMessage
Path project() const { return mProject; }
Path file() const { return mFile; }
uint32_t sourceFileId() const { return mSourceFileId; }
void encode(Serializer &serializer) const { serializer << mProject << mFile << mSourceFileId; }
void decode(Deserializer &deserializer) { deserializer >> mProject >> mFile >> mSourceFileId; }
void encode(Serializer &serializer) const override { serializer << mProject << mFile << mSourceFileId; }
void decode(Deserializer &deserializer) override { deserializer >> mProject >> mFile >> mSourceFileId; }
private:
Path mFile, mProject;
uint32_t mSourceFileId;
@@ -31,8 +31,8 @@ class VisitFileResponseMessage : public RTagsMessage
uint32_t fileId() const { return mFileId; }
bool visit() const { return mVisit; }

void encode(Serializer &serializer) const { serializer << mFileId << mVisit; }
void decode(Deserializer &deserializer) { deserializer >> mFileId >> mVisit; }
void encode(Serializer &serializer) const override { serializer << mFileId << mVisit; }
void decode(Deserializer &deserializer) override { deserializer >> mFileId >> mVisit; }
private:
uint32_t mFileId;
bool mVisit;

0 comments on commit b3017d5

Please sign in to comment.
You can’t perform that action at this time.