forked from qt-creator/qt-creator
Clang: Provide the language option to the backend
Provide the language option (e.g. "-x c++-header") when registering a translation unit for the editor. Task-number: QTCREATORBUG-14787 Change-Id: Ie06f9fdab302f1b21ba72cdb65b6aabf9f7bc04c Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
This commit is contained in:
@@ -54,9 +54,11 @@ FileContainer::FileContainer(const Utf8String &filePath,
|
||||
|
||||
FileContainer::FileContainer(const Utf8String &filePath,
|
||||
const Utf8String &projectPartId,
|
||||
const Utf8StringVector &fileArguments,
|
||||
quint32 documentRevision)
|
||||
: filePath_(filePath),
|
||||
projectPartId_(projectPartId),
|
||||
fileArguments_(fileArguments),
|
||||
documentRevision_(documentRevision),
|
||||
hasUnsavedFileContent_(false)
|
||||
{
|
||||
@@ -72,6 +74,11 @@ const Utf8String &FileContainer::projectPartId() const
|
||||
return projectPartId_;
|
||||
}
|
||||
|
||||
const Utf8StringVector &FileContainer::fileArguments() const
|
||||
{
|
||||
return fileArguments_;
|
||||
}
|
||||
|
||||
const Utf8String &FileContainer::unsavedFileContent() const
|
||||
{
|
||||
return unsavedFileContent_;
|
||||
@@ -91,6 +98,7 @@ QDataStream &operator<<(QDataStream &out, const FileContainer &container)
|
||||
{
|
||||
out << container.filePath_;
|
||||
out << container.projectPartId_;
|
||||
out << container.fileArguments_;
|
||||
out << container.unsavedFileContent_;
|
||||
out << container.documentRevision_;
|
||||
out << container.hasUnsavedFileContent_;
|
||||
@@ -102,6 +110,7 @@ QDataStream &operator>>(QDataStream &in, FileContainer &container)
|
||||
{
|
||||
in >> container.filePath_;
|
||||
in >> container.projectPartId_;
|
||||
in >> container.fileArguments_;
|
||||
in >> container.unsavedFileContent_;
|
||||
in >> container.documentRevision_;
|
||||
in >> container.hasUnsavedFileContent_;
|
||||
@@ -127,6 +136,7 @@ QDebug operator<<(QDebug debug, const FileContainer &container)
|
||||
debug.nospace() << "FileContainer("
|
||||
<< container.filePath() << ", "
|
||||
<< container.projectPartId() << ", "
|
||||
<< container.fileArguments() << ", "
|
||||
<< container.documentRevision();
|
||||
|
||||
if (container.hasUnsavedFileContent()) {
|
||||
@@ -147,6 +157,7 @@ void PrintTo(const FileContainer &container, ::std::ostream* os)
|
||||
*os << "FileContainer("
|
||||
<< container.filePath().constData() << ", "
|
||||
<< container.projectPartId().constData() << ", "
|
||||
<< container.fileArguments().constData() << ", "
|
||||
<< container.documentRevision();
|
||||
|
||||
if (container.hasUnsavedFileContent())
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include <clangbackendipc_global.h>
|
||||
|
||||
#include <utf8string.h>
|
||||
#include <utf8stringvector.h>
|
||||
|
||||
#include <QMetaType>
|
||||
|
||||
@@ -54,10 +55,12 @@ public:
|
||||
quint32 documentRevision = 0);
|
||||
FileContainer(const Utf8String &filePath,
|
||||
const Utf8String &projectPartId,
|
||||
const Utf8StringVector &fileArguments,
|
||||
quint32 documentRevision);
|
||||
|
||||
const Utf8String &filePath() const;
|
||||
const Utf8String &projectPartId() const;
|
||||
const Utf8StringVector &fileArguments() const;
|
||||
const Utf8String &unsavedFileContent() const;
|
||||
bool hasUnsavedFileContent() const;
|
||||
quint32 documentRevision() const;
|
||||
@@ -65,6 +68,7 @@ public:
|
||||
private:
|
||||
Utf8String filePath_;
|
||||
Utf8String projectPartId_;
|
||||
Utf8StringVector fileArguments_;
|
||||
Utf8String unsavedFileContent_;
|
||||
quint32 documentRevision_;
|
||||
bool hasUnsavedFileContent_ = false;
|
||||
|
||||
Reference in New Issue
Block a user