Commit d3d3e2ac authored by Nikolai Kosjar's avatar Nikolai Kosjar

CppTools: Simplify/Modernize SemanticInfo

Change-Id: I7bef1dee81678f77f5c0d8a6d22488aa63f981e7
Reviewed-by: Ivan Donchevskii's avatarIvan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: default avatarhjk <hjk@qt.io>
parent 210b9aa2
/****************************************************************************
**
** Copyright (C) 2016 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.
**
****************************************************************************/
#include "cppsemanticinfo.h"
using namespace CppTools;
SemanticInfo::SemanticInfo()
: revision(0), complete(true), localUsesUpdated(false)
{
}
......@@ -42,11 +42,9 @@ public:
{
const QString fileName;
const QByteArray code;
const unsigned revision;
const unsigned revision = 0;
CPlusPlus::Snapshot snapshot;
const bool force;
Source() : revision(0), force(false) {}
const bool force = false;
Source(const QString &fileName,
const QByteArray &code,
......@@ -62,20 +60,18 @@ public:
};
public:
typedef TextEditor::HighlightingResult Use;
typedef QHash<CPlusPlus::Symbol *, QList<Use> > LocalUseMap;
typedef QHashIterator<CPlusPlus::Symbol *, QList<Use> > LocalUseIterator;
SemanticInfo();
using Use = TextEditor::HighlightingResult;
using LocalUseMap = QHash<CPlusPlus::Symbol *, QList<Use>>;
using LocalUseIterator = QHashIterator<CPlusPlus::Symbol *, QList<Use>>;
unsigned revision;
bool complete;
// Document specific
unsigned revision = 0;
bool complete = true;
CPlusPlus::Snapshot snapshot;
CPlusPlus::Document::Ptr doc;
// Widget specific (e.g. related to cursor position)
bool localUsesUpdated;
bool localUsesUpdated = false;
LocalUseMap localUses;
};
......
......@@ -135,7 +135,6 @@ SOURCES += \
cpprawprojectpart.cpp \
cpprefactoringchanges.cpp \
cppselectionchanger.cpp \
cppsemanticinfo.cpp \
cppsemanticinfoupdater.cpp \
cppsourceprocessor.cpp \
cpptoolsjsextension.cpp \
......
......@@ -135,7 +135,6 @@ Project {
"cpprefactoringchanges.h",
"cppselectionchanger.cpp",
"cppselectionchanger.h",
"cppsemanticinfo.cpp",
"cppsemanticinfo.h",
"cppsemanticinfoupdater.cpp",
"cppsemanticinfoupdater.h",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment