Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
flatpak-qt-creator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
3a4765e2
Commit
3a4765e2
authored
Dec 10, 2010
by
Roberto Raggi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Try to get the right overload when switching from a declaration to its definition.
parent
63138eb8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
9 deletions
+18
-9
src/plugins/cppeditor/cppeditor.cpp
src/plugins/cppeditor/cppeditor.cpp
+18
-9
No files found.
src/plugins/cppeditor/cppeditor.cpp
View file @
3a4765e2
...
...
@@ -1108,21 +1108,30 @@ void CPPEditor::switchDeclarationDefinition()
if
(
!
lastVisibleSymbol
)
return
;
Function
*
function
Scope
=
lastVisibleSymbol
->
asFunction
();
if
(
!
function
Scope
)
function
Scope
=
lastVisibleSymbol
->
enclosingFunction
();
Function
*
function
=
lastVisibleSymbol
->
asFunction
();
if
(
!
function
)
function
=
lastVisibleSymbol
->
enclosingFunction
();
if
(
function
Scope
)
{
if
(
function
)
{
LookupContext
context
(
thisDocument
,
snapshot
);
Function
*
functionDefinition
=
functionScope
->
asFunction
();
Function
*
functionDefinition
=
function
->
asFunction
();
ClassOrNamespace
*
binding
=
context
.
lookupType
(
functionDefinition
);
const
QList
<
LookupItem
>
declarations
=
context
.
lookup
(
functionDefinition
->
name
(),
functionDefinition
->
enclosingScope
());
QList
<
Symbol
*>
best
;
foreach
(
const
LookupItem
&
r
,
declarations
)
{
Symbol
*
decl
=
r
.
declaration
();
// TODO: check decl.
openCppEditorAt
(
linkToSymbol
(
decl
));
break
;
if
(
Symbol
*
decl
=
r
.
declaration
())
{
if
(
Function
*
funTy
=
decl
->
type
()
->
asFunctionType
())
{
if
(
funTy
->
isEqualTo
(
function
)
&&
decl
!=
function
&&
binding
==
r
.
binding
())
best
.
prepend
(
decl
);
else
best
.
append
(
decl
);
}
}
}
if
(
!
best
.
isEmpty
())
openCppEditorAt
(
linkToSymbol
(
best
.
first
()));
}
else
if
(
lastVisibleSymbol
&&
lastVisibleSymbol
->
isDeclaration
()
&&
lastVisibleSymbol
->
type
()
->
isFunctionType
())
{
if
(
Symbol
*
def
=
snapshot
.
findMatchingDefinition
(
lastVisibleSymbol
))
...
...
Write
Preview
Markdown
is supported
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