2017-08-02 16:00:55 +02:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
|
|
|
|
** Copyright (C) 2017 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
|
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator.
|
|
|
|
|
**
|
|
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
|
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
|
|
|
|
**
|
|
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
|
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2018-02-08 17:49:02 +01:00
|
|
|
#include "filestatuscache.h"
|
2018-08-28 12:08:37 +02:00
|
|
|
#include "symbolindexertaskqueueinterface.h"
|
2017-08-02 16:00:55 +02:00
|
|
|
#include "symbolstorageinterface.h"
|
2017-10-26 13:23:27 +02:00
|
|
|
#include "clangpathwatcher.h"
|
2017-08-02 16:00:55 +02:00
|
|
|
|
|
|
|
|
#include <projectpartcontainerv2.h>
|
2017-08-17 12:44:52 +02:00
|
|
|
#include <filecontainerv2.h>
|
2017-08-02 16:00:55 +02:00
|
|
|
|
|
|
|
|
namespace ClangBackEnd {
|
|
|
|
|
|
2018-08-28 12:08:37 +02:00
|
|
|
class SymbolsCollectorInterface;
|
|
|
|
|
|
2018-09-03 14:38:01 +02:00
|
|
|
class SymbolIndexer final : public ClangPathWatcherNotifier
|
2017-08-02 16:00:55 +02:00
|
|
|
{
|
|
|
|
|
public:
|
2018-08-28 12:08:37 +02:00
|
|
|
SymbolIndexer(SymbolIndexerTaskQueueInterface &symbolIndexerTaskQueue,
|
2017-10-26 13:23:27 +02:00
|
|
|
SymbolStorageInterface &symbolStorage,
|
2018-01-22 14:21:01 +01:00
|
|
|
ClangPathWatcherInterface &pathWatcher,
|
|
|
|
|
FilePathCachingInterface &filePathCache,
|
2018-02-08 17:49:02 +01:00
|
|
|
FileStatusCache &fileStatusCache,
|
2018-01-22 14:21:01 +01:00
|
|
|
Sqlite::TransactionInterface &transactionInterface);
|
2017-08-02 16:00:55 +02:00
|
|
|
|
2018-09-03 14:38:01 +02:00
|
|
|
void updateProjectParts(V2::ProjectPartContainers &&projectParts);
|
|
|
|
|
void updateProjectPart(V2::ProjectPartContainer &&projectPart);
|
2017-08-02 16:00:55 +02:00
|
|
|
|
2017-12-27 13:20:24 +01:00
|
|
|
void pathsWithIdsChanged(const Utils::SmallStringVector &ids) override;
|
|
|
|
|
void pathsChanged(const FilePathIds &filePathIds) override;
|
2018-08-28 12:08:37 +02:00
|
|
|
void updateChangedPath(FilePathId filePath,
|
|
|
|
|
std::vector<SymbolIndexerTask> &symbolIndexerTask);
|
2017-12-27 13:20:24 +01:00
|
|
|
|
2018-02-08 12:48:46 +01:00
|
|
|
bool compilerMacrosOrIncludeSearchPathsAreDifferent(
|
2018-02-20 12:43:05 +01:00
|
|
|
const V2::ProjectPartContainer &projectPart,
|
|
|
|
|
const Utils::optional<ProjectPartArtefact> &optionalArtefact) const;
|
2018-02-07 16:18:16 +01:00
|
|
|
|
2018-02-08 17:49:02 +01:00
|
|
|
FilePathIds filterChangedFiles(
|
|
|
|
|
const V2::ProjectPartContainer &projectPart) const;
|
|
|
|
|
|
2018-02-20 12:43:05 +01:00
|
|
|
FilePathIds updatableFilePathIds(const V2::ProjectPartContainer &projectPart,
|
|
|
|
|
const Utils::optional<ProjectPartArtefact> &optionalArtefact) const;
|
|
|
|
|
|
|
|
|
|
Utils::SmallStringVector compilerArguments(const V2::ProjectPartContainer &projectPart,
|
|
|
|
|
const Utils::optional<ProjectPartArtefact> &optionalArtefact) const;
|
|
|
|
|
Utils::SmallStringVector compilerArguments(Utils::SmallStringVector arguments,
|
|
|
|
|
int projectPartId) const;
|
2018-02-08 17:49:02 +01:00
|
|
|
|
2017-08-02 16:00:55 +02:00
|
|
|
private:
|
2018-08-28 12:08:37 +02:00
|
|
|
SymbolIndexerTaskQueueInterface &m_symbolIndexerTaskQueue;
|
2017-08-02 16:00:55 +02:00
|
|
|
SymbolStorageInterface &m_symbolStorage;
|
2017-10-26 13:23:27 +02:00
|
|
|
ClangPathWatcherInterface &m_pathWatcher;
|
2018-01-22 14:21:01 +01:00
|
|
|
FilePathCachingInterface &m_filePathCache;
|
2018-02-08 17:49:02 +01:00
|
|
|
FileStatusCache &m_fileStatusCache;
|
2018-01-22 14:21:01 +01:00
|
|
|
Sqlite::TransactionInterface &m_transactionInterface;
|
2017-08-02 16:00:55 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace ClangBackEnd
|