Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
18490596
Commit
18490596
authored
May 17, 2010
by
Roberto Raggi
Browse files
Renamed Document::findSymbolAt().
parent
56c5c826
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/libs/cplusplus/CppDocument.cpp
View file @
18490596
...
...
@@ -406,12 +406,12 @@ Scope *Document::scopeAt(unsigned line, unsigned column)
return
globalSymbols
();
}
Symbol
*
Document
::
find
SymbolAt
(
unsigned
line
,
unsigned
column
)
const
Symbol
*
Document
::
lastVisible
SymbolAt
(
unsigned
line
,
unsigned
column
)
const
{
return
find
SymbolAt
(
line
,
column
,
globalSymbols
());
return
lastVisible
SymbolAt
(
line
,
column
,
globalSymbols
());
}
Symbol
*
Document
::
find
SymbolAt
(
unsigned
line
,
unsigned
column
,
Scope
*
scope
)
const
Symbol
*
Document
::
lastVisible
SymbolAt
(
unsigned
line
,
unsigned
column
,
Scope
*
scope
)
const
{
Symbol
*
previousSymbol
=
0
;
...
...
@@ -425,7 +425,7 @@ Symbol *Document::findSymbolAt(unsigned line, unsigned column, Scope *scope) con
if
(
previousSymbol
)
{
if
(
ScopedSymbol
*
scoped
=
previousSymbol
->
asScopedSymbol
())
{
if
(
Symbol
*
member
=
find
SymbolAt
(
line
,
column
,
scoped
->
members
()))
if
(
Symbol
*
member
=
lastVisible
SymbolAt
(
line
,
column
,
scoped
->
members
()))
return
member
;
}
}
...
...
src/libs/cplusplus/CppDocument.h
View file @
18490596
...
...
@@ -92,7 +92,7 @@ public:
QList
<
Macro
>
definedMacros
()
const
{
return
_definedMacros
;
}
Q_DECL_DEPRECATED
Symbol
*
find
SymbolAt
(
unsigned
line
,
unsigned
column
)
const
;
Symbol
*
lastVisible
SymbolAt
(
unsigned
line
,
unsigned
column
)
const
;
Scope
*
scopeAt
(
unsigned
line
,
unsigned
column
);
QByteArray
source
()
const
;
...
...
@@ -310,7 +310,7 @@ public:
const
UndefinedMacroUse
*
findUndefinedMacroUseAt
(
unsigned
offset
)
const
;
private:
Symbol
*
find
SymbolAt
(
unsigned
line
,
unsigned
column
,
Scope
*
scope
)
const
;
Symbol
*
lastVisible
SymbolAt
(
unsigned
line
,
unsigned
column
,
Scope
*
scope
)
const
;
private:
QString
_fileName
;
...
...
src/plugins/cppeditor/cppeditor.cpp
View file @
18490596
...
...
@@ -1150,7 +1150,7 @@ void CPPEditor::switchDeclarationDefinition()
convertPosition
(
position
(),
&
line
,
&
column
);
Scope
*
scope
=
thisDocument
->
scopeAt
(
line
,
column
);
Symbol
*
lastVisibleSymbol
=
thisDocument
->
find
SymbolAt
(
line
,
column
);
Symbol
*
lastVisibleSymbol
=
thisDocument
->
lastVisible
SymbolAt
(
line
,
column
);
Scope
*
functionScope
=
0
;
if
(
scope
->
isFunctionScope
())
...
...
@@ -1351,7 +1351,7 @@ CPPEditor::Link CPPEditor::findLinkAt(const QTextCursor &cursor,
if
(
resolveTarget
)
{
def
=
findDefinition
(
symbol
,
snapshot
);
if
(
def
==
doc
->
find
SymbolAt
(
line
,
column
))
if
(
def
==
doc
->
lastVisible
SymbolAt
(
line
,
column
))
def
=
0
;
// jump to declaration then.
}
...
...
src/plugins/cpptools/abstracteditorsupport.cpp
View file @
18490596
...
...
@@ -66,7 +66,7 @@ QString AbstractEditorSupport::functionAt(const CppModelManagerInterface *modelM
const
CPlusPlus
::
Document
::
Ptr
document
=
snapshot
.
document
(
fileName
);
if
(
!
document
)
return
QString
();
if
(
const
CPlusPlus
::
Symbol
*
symbol
=
document
->
find
SymbolAt
(
line
,
column
))
if
(
const
CPlusPlus
::
Symbol
*
symbol
=
document
->
lastVisible
SymbolAt
(
line
,
column
))
if
(
const
CPlusPlus
::
Scope
*
scope
=
symbol
->
scope
())
if
(
const
CPlusPlus
::
Scope
*
functionScope
=
scope
->
enclosingFunctionScope
())
if
(
const
CPlusPlus
::
Symbol
*
function
=
functionScope
->
owner
())
{
...
...
src/plugins/cpptools/cppcodecompletion.cpp
View file @
18490596
...
...
@@ -746,7 +746,7 @@ int CppCodeCompletion::startCompletionInternal(TextEditor::BaseTextEditor *edit,
return
-
1
;
typeOfExpression
.
init
(
thisDocument
,
snapshot
);
Symbol
*
lastVisibleSymbol
=
thisDocument
->
find
SymbolAt
(
line
,
column
);
Symbol
*
lastVisibleSymbol
=
thisDocument
->
lastVisible
SymbolAt
(
line
,
column
);
if
(
expression
.
isEmpty
())
{
if
(
m_completionOperator
==
T_EOF_SYMBOL
||
m_completionOperator
==
T_COLON_COLON
)
...
...
@@ -1564,7 +1564,7 @@ void CppCodeCompletion::complete(const TextEditor::CompletionItem &item)
}
}
else
if
(
!
function
->
isAmbiguous
())
{
if
(
completionSettings
().
m_spaceAfterFunctionName
)
extraChars
+=
QLatin1Char
(
' '
);
extraChars
+=
QLatin1Char
(
' '
);
extraChars
+=
QLatin1Char
(
'('
);
// If the function doesn't return anything, automatically place the semicolon,
...
...
src/plugins/debugger/watchutils.cpp
View file @
18490596
...
...
@@ -361,7 +361,7 @@ int getUninitializedVariablesI(const CPlusPlus::Snapshot &snapshot,
const
CPlusPlus
::
Document
::
Ptr
doc
=
docIt
.
value
();
// Look at symbol at line and find its function. Either it is the
// function itself or some expression/variable.
const
CPlusPlus
::
Symbol
*
symbolAtLine
=
doc
->
find
SymbolAt
(
line
,
0
);
const
CPlusPlus
::
Symbol
*
symbolAtLine
=
doc
->
lastVisible
SymbolAt
(
line
,
0
);
if
(
!
symbolAtLine
)
return
4
;
// First figure out the function to do a safety name check
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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