2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
2022-12-21 10:12:09 +01:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2010-11-16 13:54:50 +01:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2010-11-16 13:54:50 +01:00
|
|
|
|
2022-06-20 12:35:13 +02:00
|
|
|
#include <utils/filepath.h>
|
2010-11-16 13:54:50 +01:00
|
|
|
#include <qmljs/qmljsdocument.h>
|
|
|
|
|
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QObject>
|
|
|
|
|
#include <QHash>
|
2014-09-19 13:57:20 +02:00
|
|
|
#include <QMutex>
|
2010-11-16 13:54:50 +01:00
|
|
|
|
|
|
|
|
namespace QmlJSTools {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
|
|
|
|
class LocatorData : public QObject
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
2018-02-08 10:40:29 +01:00
|
|
|
LocatorData();
|
2018-11-24 10:22:37 +01:00
|
|
|
~LocatorData() override;
|
2010-11-16 13:54:50 +01:00
|
|
|
|
|
|
|
|
enum EntryType
|
|
|
|
|
{
|
2010-12-16 12:05:48 +01:00
|
|
|
Function
|
2010-11-16 13:54:50 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class Entry
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
EntryType type;
|
|
|
|
|
QString symbolName;
|
|
|
|
|
QString displayName;
|
|
|
|
|
QString extraInfo;
|
2022-06-20 12:35:13 +02:00
|
|
|
Utils::FilePath fileName;
|
2010-11-16 13:54:50 +01:00
|
|
|
int line;
|
|
|
|
|
int column;
|
|
|
|
|
};
|
|
|
|
|
|
2022-06-20 12:35:13 +02:00
|
|
|
QHash<Utils::FilePath, QList<Entry>> entries() const;
|
2010-11-16 13:54:50 +01:00
|
|
|
|
2016-06-27 22:25:11 +03:00
|
|
|
private:
|
2010-11-16 13:54:50 +01:00
|
|
|
void onDocumentUpdated(const QmlJS::Document::Ptr &doc);
|
2022-06-20 12:35:13 +02:00
|
|
|
void onAboutToRemoveFiles(const Utils::FilePaths &files);
|
2010-11-16 13:54:50 +01:00
|
|
|
|
2014-09-19 13:57:20 +02:00
|
|
|
mutable QMutex m_mutex;
|
2022-06-20 12:35:13 +02:00
|
|
|
QHash<Utils::FilePath, QList<Entry>> m_entries;
|
2010-11-16 13:54:50 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace QmlJSTools
|