Skip to content

Commit

Permalink
Refactoring of includes
Browse files Browse the repository at this point in the history
  • Loading branch information
casch-at committed Nov 4, 2015
1 parent 3318b55 commit f07afdc
Show file tree
Hide file tree
Showing 78 changed files with 401 additions and 353 deletions.
22 changes: 12 additions & 10 deletions src/ClangIndexer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,24 @@
along with RTags. If not, see <http://www.gnu.org/licenses/>. */

#define RTAGS_SINGLE_THREAD
#include <rct/SHA256.h>
#include "ClangIndexer.h"
#include "Diagnostic.h"
#include "QueryMessage.h"
#include "VisitFileMessage.h"
#include "VisitFileResponseMessage.h"
#include "FileMap.h"
#include <rct/Connection.h>
#include <rct/EventLoop.h>
#include "RTags.h"
#include "RClient.h"

#include <unistd.h>
#if CINDEX_VERSION >= CINDEX_VERSION_ENCODE(0, 25)
#include <clang-c/Documentation.h>
#endif

#include "Diagnostic.h"
#include "FileMap.h"
#include "QueryMessage.h"
#include "RClient.h"
#include "rct/Connection.h"
#include "rct/EventLoop.h"
#include "rct/SHA256.h"
#include "RTags.h"
#include "VisitFileMessage.h"
#include "VisitFileResponseMessage.h"

const CXSourceLocation ClangIndexer::nullLocation = clang_getNullLocation();
const CXCursor ClangIndexer::nullCursor = clang_getNullCursor();

Expand Down
13 changes: 7 additions & 6 deletions src/ClangIndexer.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,18 @@
#ifndef ClangIndexer_h
#define ClangIndexer_h

#include <rct/StopWatch.h>
#include <rct/Hash.h>
#include <rct/Serializer.h>
#include <rct/Path.h>
#include <rct/Connection.h>
#include <sys/stat.h>

#include "IndexDataMessage.h"
#include "IndexerJob.h"
#include "rct/Connection.h"
#include "rct/Hash.h"
#include "rct/Path.h"
#include "rct/Serializer.h"
#include "rct/StopWatch.h"
#include "RTagsClang.h"
#include "Symbol.h"
#include "Server.h"
#include "Symbol.h"

struct Unit;
class ClangIndexer
Expand Down
3 changes: 2 additions & 1 deletion src/ClassHierarchyJob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ You should have received a copy of the GNU General Public License
along with RTags. If not, see <http://www.gnu.org/licenses/>. */

#include "ClassHierarchyJob.h"

#include "Project.h"
#include "RTags.h"
#include "Server.h"
#include "Project.h"

ClassHierarchyJob::ClassHierarchyJob(const Location &loc,
const std::shared_ptr<QueryMessage> &query,
Expand Down
8 changes: 4 additions & 4 deletions src/ClassHierarchyJob.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ along with RTags. If not, see <http://www.gnu.org/licenses/>. */
#ifndef ClassHierarchyJob_h
#define ClassHierarchyJob_h

#include <rct/String.h>
#include <rct/List.h>
#include "RTags.h"
#include "QueryJob.h"
#include "Location.h"
#include "QueryJob.h"
#include "rct/List.h"
#include "rct/String.h"
#include "RTags.h"

class ClassHierarchyJob : public QueryJob
{
Expand Down
5 changes: 3 additions & 2 deletions src/CompilerManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ You should have received a copy of the GNU General Public License
along with RTags. If not, see <http://www.gnu.org/licenses/>. */

#include "CompilerManager.h"
#include <rct/Process.h>
#include <rct/Log.h>

#include "rct/Log.h"
#include "rct/Process.h"

static std::mutex sMutex;
struct Compiler {
Expand Down
8 changes: 4 additions & 4 deletions src/CompilerManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ along with RTags. If not, see <http://www.gnu.org/licenses/>. */
#ifndef CompilerManager_h
#define CompilerManager_h

#include <rct/Hash.h>
#include <rct/List.h>
#include <rct/Path.h>
#include <rct/String.h>
#include "rct/Hash.h"
#include "rct/List.h"
#include "rct/Path.h"
#include "rct/String.h"
#include "Source.h"

namespace CompilerManager
Expand Down
3 changes: 2 additions & 1 deletion src/CompletionThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@
You should have received a copy of the GNU General Public License
along with RTags. If not, see <http://www.gnu.org/licenses/>. */

#include "RTagsLogOutput.h"
#include "CompletionThread.h"

#include "RTagsClang.h"
#include "RTagsLogOutput.h"
#include "Server.h"
#include "Token.h"

Expand Down
23 changes: 12 additions & 11 deletions src/CompletionThread.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#ifndef CompletionThread_h
#define CompletionThread_h

/* This file is part of RTags (http://rtags.net).
RTags is free software: you can redistribute it and/or modify
Expand All @@ -16,18 +13,22 @@
You should have received a copy of the GNU General Public License
along with RTags. If not, see <http://www.gnu.org/licenses/>. */

#include <rct/Thread.h>
#ifndef CompletionThread_h
#define CompletionThread_h

#include <clang-c/Index.h>
#include <condition_variable>
#include <memory>
#include <mutex>
#include <condition_variable>

#include "Location.h"
#include "rct/Connection.h"
#include "rct/EmbeddedLinkedList.h"
#include "rct/Flags.h"
#include "rct/LinkedList.h"
#include "rct/Map.h"
#include "rct/Thread.h"
#include "Source.h"
#include <rct/Map.h>
#include <rct/LinkedList.h>
#include <clang-c/Index.h>
#include <rct/Connection.h>
#include <rct/Flags.h>
#include <rct/EmbeddedLinkedList.h>

class CompletionThread : public Thread
{
Expand Down
5 changes: 3 additions & 2 deletions src/DependenciesJob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ You should have received a copy of the GNU General Public License
along with RTags. If not, see <http://www.gnu.org/licenses/>. */

#include "DependenciesJob.h"
#include "RTags.h"
#include "Server.h"

#include "FileManager.h"
#include "Project.h"
#include "RTags.h"
#include "Server.h"

DependenciesJob::DependenciesJob(const std::shared_ptr<QueryMessage> &query, const std::shared_ptr<Project> &project)
: QueryJob(query, project, QuietJob)
Expand Down
1 change: 0 additions & 1 deletion src/DependenciesJob.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,3 @@ class DependenciesJob : public QueryJob
};

#endif

4 changes: 2 additions & 2 deletions src/Diagnostic.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
#ifndef Diagnostic_h
#define Diagnostic_h

#include <rct/String.h>
#include <rct/Serializer.h>
#include "rct/Serializer.h"
#include "rct/String.h"
#include "RTags.h"

struct Diagnostic
Expand Down
4 changes: 2 additions & 2 deletions src/DumpThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
along with RTags. If not, see <http://www.gnu.org/licenses/>. */

#include "DumpThread.h"
#include <rct/Connection.h>

#include "rct/Connection.h"
#include "RTagsClang.h"
#include "Server.h"

Expand Down Expand Up @@ -236,4 +237,3 @@ void DumpThread::checkIncludes()
delete it.second;
}
}

12 changes: 6 additions & 6 deletions src/DumpThread.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/* This file is part of RTags (http://rtags.net).
RTags is free software: you can redistribute it and/or modify
Expand All @@ -17,12 +16,13 @@
#ifndef DumpThread_h
#define DumpThread_h

#include <rct/Thread.h>
#include <Source.h>
#include <QueryMessage.h>
#include <clang-c/Index.h>
#include <RTagsClang.h>
#include <Project.h>

#include "Project.h"
#include "QueryMessage.h"
#include "rct/Thread.h"
#include "RTagsClang.h"
#include "Source.h"

class Connection;
class DumpThread : public Thread
Expand Down
6 changes: 3 additions & 3 deletions src/FileManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ You should have received a copy of the GNU General Public License
along with RTags. If not, see <http://www.gnu.org/licenses/>. */

#include "FileManager.h"
#include "ScanThread.h"
#include "Server.h"

#include "Filter.h"
#include "Project.h"
#include "ScanThread.h"
#include "Server.h"

FileManager::FileManager(const std::shared_ptr<Project> &project)
: mProject(project), mLastReloadTime(0)
Expand Down Expand Up @@ -175,4 +176,3 @@ void FileManager::clearFileSystemWatcher()
if (auto project = mProject.lock())
project->clearWatch(Project::Watch_FileManager);
}

11 changes: 6 additions & 5 deletions src/FileManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@ along with RTags. If not, see <http://www.gnu.org/licenses/>. */
#ifndef FileManager_h
#define FileManager_h

#include <rct/Path.h>
#include <rct/Timer.h>
#include <rct/List.h>
#include <rct/FileSystemWatcher.h>
#include "Location.h"
#include <mutex>

#include "Location.h"
#include "rct/FileSystemWatcher.h"
#include "rct/List.h"
#include "rct/Path.h"
#include "rct/Timer.h"

class Project;
class FileManager : public std::enable_shared_from_this<FileManager>
{
Expand Down
17 changes: 9 additions & 8 deletions src/FileMap.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#ifndef FileMap_h
#define FileMap_h

/* This file is part of RTags (http://rtags.net).
RTags is free software: you can redistribute it and/or modify
Expand All @@ -16,17 +13,21 @@
You should have received a copy of the GNU General Public License
along with RTags. If not, see <http://www.gnu.org/licenses/>. */

#ifndef FileMap_h
#define FileMap_h

#include <assert.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/file.h>
#include <sys/mman.h>
#include <rct/Serializer.h>
#include <rct/Rct.h>
#include <rct/StackBuffer.h>
#include "Location.h"
#include <sys/stat.h>
#include <functional>

#include "Location.h"
#include "rct/Rct.h"
#include "rct/Serializer.h"
#include "rct/StackBuffer.h"

template <typename T> inline static int compare(const T &l, const T &r)
{
if (l < r)
Expand Down
7 changes: 4 additions & 3 deletions src/Filter.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ along with RTags. If not, see <http://www.gnu.org/licenses/>. */
#ifndef Filter_h
#define Filter_h

#include <rct/Path.h>
#include <rct/List.h>
#include <rct/String.h>
#include <fnmatch.h>

#include "rct/List.h"
#include "rct/Path.h"
#include "rct/String.h"

namespace Filter {
enum Result {
Filtered,
Expand Down
5 changes: 3 additions & 2 deletions src/FindFileJob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ You should have received a copy of the GNU General Public License
along with RTags. If not, see <http://www.gnu.org/licenses/>. */

#include "FindFileJob.h"
#include "RTags.h"
#include "Server.h"

#include "FileManager.h"
#include "Project.h"
#include "RTags.h"
#include "Server.h"

static Flags<QueryJob::JobFlag> flags(Flags<QueryMessage::Flag> queryFlags)
{
Expand Down
11 changes: 6 additions & 5 deletions src/FindFileJob.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@ along with RTags. If not, see <http://www.gnu.org/licenses/>. */
#ifndef FindFileJob_h
#define FindFileJob_h

#include <rct/String.h>
#include <rct/List.h>
#include "RTagsClang.h"
#include "QueryJob.h"
#include "Location.h"
#include <regex>

#include "Location.h"
#include "QueryJob.h"
#include "rct/List.h"
#include "rct/String.h"
#include "RTagsClang.h"

class FindFileJob : public QueryJob
{
public:
Expand Down
7 changes: 4 additions & 3 deletions src/FindSymbolsJob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ You should have received a copy of the GNU General Public License
along with RTags. If not, see <http://www.gnu.org/licenses/>. */

#include "FindSymbolsJob.h"
#include "Server.h"
#include <rct/Log.h>
#include "RTagsClang.h"

#include "Project.h"
#include "rct/Log.h"
#include "RTagsClang.h"
#include "Server.h"

static inline Flags<QueryJob::JobFlag> jobFlags(Flags<QueryMessage::Flag> queryFlags)
{
Expand Down
6 changes: 3 additions & 3 deletions src/FindSymbolsJob.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ along with RTags. If not, see <http://www.gnu.org/licenses/>. */
#ifndef FindSymbolsJob_h
#define FindSymbolsJob_h

#include <rct/String.h>
#include <rct/List.h>
#include "QueryMessage.h"
#include "QueryJob.h"
#include "QueryMessage.h"
#include "rct/List.h"
#include "rct/String.h"

class FindSymbolsJob : public QueryJob
{
Expand Down
5 changes: 3 additions & 2 deletions src/FixIt.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ along with RTags. If not, see <http://www.gnu.org/licenses/>. */
#define FixIt_h

#include <stdint.h>
#include <rct/String.h>
#include <rct/Serializer.h>

#include "rct/Serializer.h"
#include "rct/String.h"

struct FixIt
{
Expand Down
Loading

0 comments on commit f07afdc

Please sign in to comment.