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
437bbd00
Commit
437bbd00
authored
Mar 17, 2009
by
Roberto Raggi
Browse files
Don't insert `(' when completing ambiguous symbols.
parent
937340cc
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/plugins/cpptools/cppcodecompletion.cpp
View file @
437bbd00
...
...
@@ -1128,7 +1128,7 @@ void CppCodeCompletion::complete(const TextEditor::CompletionItem &item)
if
(
function
->
argumentCount
()
==
0
)
{
extraChars
+=
QLatin1Char
(
'<'
);
}
}
else
{
}
else
if
(
!
function
->
isAmbiguous
())
{
extraChars
+=
QLatin1Char
(
'('
);
// If the function takes no arguments, automatically place the closing parenthesis
...
...
src/shared/cplusplus/CheckDeclarator.cpp
View file @
437bbd00
...
...
@@ -157,6 +157,7 @@ bool CheckDeclarator::visit(NestedDeclaratorAST *ast)
bool
CheckDeclarator
::
visit
(
FunctionDeclaratorAST
*
ast
)
{
Function
*
fun
=
control
()
->
newFunction
(
ast
->
firstToken
());
fun
->
setAmbiguous
(
ast
->
as_cpp_initializer
!=
0
);
ast
->
symbol
=
fun
;
fun
->
setReturnType
(
_fullySpecifiedType
);
...
...
src/shared/cplusplus/Symbols.cpp
View file @
437bbd00
...
...
@@ -255,6 +255,12 @@ bool Function::isPureVirtual() const
void
Function
::
setPureVirtual
(
bool
isPureVirtual
)
{
_isPureVirtual
=
isPureVirtual
;
}
bool
Function
::
isAmbiguous
()
const
{
return
_isAmbiguous
;
}
void
Function
::
setAmbiguous
(
bool
isAmbiguous
)
{
_isAmbiguous
=
isAmbiguous
;
}
void
Function
::
visitSymbol0
(
SymbolVisitor
*
visitor
)
{
if
(
visitor
->
visit
(
this
))
{
...
...
src/shared/cplusplus/Symbols.h
View file @
437bbd00
...
...
@@ -322,6 +322,9 @@ public:
virtual
Function
*
asFunctionType
()
{
return
this
;
}
bool
isAmbiguous
()
const
;
// internal
void
setAmbiguous
(
bool
isAmbiguous
);
// internal
protected:
virtual
void
visitSymbol0
(
SymbolVisitor
*
visitor
);
virtual
void
accept0
(
TypeVisitor
*
visitor
);
...
...
@@ -337,6 +340,7 @@ private:
unsigned
_isPureVirtual
:
1
;
unsigned
_isConst
:
1
;
unsigned
_isVolatile
:
1
;
unsigned
_isAmbiguous
:
1
;
unsigned
_methodKey
:
3
;
};
};
...
...
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