Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tobias Hunger
qt-creator
Commits
fd4dbd74
Commit
fd4dbd74
authored
Jul 10, 2009
by
Roberto Raggi
Browse files
Introduced Snapshot::simplified(doc)
parent
300b60fa
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/libs/cplusplus/CppDocument.cpp
View file @
fd4dbd74
...
...
@@ -386,3 +386,25 @@ QSharedPointer<NamespaceBinding> Snapshot::globalNamespaceBinding(Document::Ptr
{
return
CPlusPlus
::
bind
(
doc
,
*
this
);
}
Snapshot
Snapshot
::
simplified
(
Document
::
Ptr
doc
)
const
{
Snapshot
snapshot
;
simplified_helper
(
doc
,
&
snapshot
);
return
snapshot
;
}
void
Snapshot
::
simplified_helper
(
Document
::
Ptr
doc
,
Snapshot
*
snapshot
)
const
{
if
(
!
doc
)
return
;
if
(
!
snapshot
->
contains
(
doc
->
fileName
()))
{
snapshot
->
insert
(
doc
);
foreach
(
const
Document
::
Include
&
incl
,
doc
->
includes
())
{
Document
::
Ptr
includedDoc
=
value
(
incl
.
fileName
());
simplified_helper
(
includedDoc
,
snapshot
);
}
}
}
src/libs/cplusplus/CppDocument.h
View file @
fd4dbd74
...
...
@@ -277,6 +277,8 @@ public:
Snapshot
();
~
Snapshot
();
Snapshot
simplified
(
Document
::
Ptr
doc
)
const
;
QByteArray
preprocessedCode
(
const
QString
&
source
,
const
QString
&
fileName
)
const
;
...
...
@@ -288,6 +290,9 @@ public:
void
insert
(
Document
::
Ptr
doc
);
using
_Base
::
insert
;
private:
void
simplified_helper
(
Document
::
Ptr
doc
,
Snapshot
*
snapshot
)
const
;
};
}
// end of namespace CPlusPlus
...
...
src/plugins/cppeditor/cppeditor.cpp
View file @
fd4dbd74
...
...
@@ -1727,6 +1727,7 @@ SemanticInfo SemanticHighlighter::semanticInfo(const Source &source) const
{
const
QByteArray
preprocessedCode
=
source
.
snapshot
.
preprocessedCode
(
source
.
code
,
source
.
fileName
);
Document
::
Ptr
doc
=
source
.
snapshot
.
documentFromSource
(
preprocessedCode
,
source
.
fileName
);
const
Snapshot
snapshot
=
source
.
snapshot
.
simplified
(
doc
);
doc
->
check
();
Control
*
control
=
doc
->
control
();
...
...
@@ -1741,6 +1742,7 @@ SemanticInfo SemanticHighlighter::semanticInfo(const Source &source) const
SemanticInfo
semanticInfo
;
semanticInfo
.
revision
=
source
.
revision
;
semanticInfo
.
snapshot
=
snapshot
;
semanticInfo
.
doc
=
doc
;
semanticInfo
.
localUses
=
useTable
.
localUses
;
semanticInfo
.
externalUses
=
useTable
.
externalUses
;
...
...
src/plugins/cppeditor/cppeditor.h
View file @
fd4dbd74
...
...
@@ -88,6 +88,7 @@ public:
{
}
int
revision
;
CPlusPlus
::
Snapshot
snapshot
;
CPlusPlus
::
Document
::
Ptr
doc
;
LocalUseMap
localUses
;
ExternalUseMap
externalUses
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment