Bug 297908 - code completion offers to call methods on (new Foo())
Summary: code completion offers to call methods on (new Foo())
Status: CONFIRMED
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: PHP (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-11 16:08 UTC by Dominik Schmidt
Modified: 2021-03-09 22:48 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dominik Schmidt 2012-04-11 16:08:09 UTC
User-Agent:       Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20100101 Firefox/11.0
Build Identifier: 

Hey

when i type new Foo() kdevelop offers me code completion and lets me select bar() as method.
No matter if I do that or type it manually afterwards it marks it as wrong syntax under the "->".




Reproducible: Always
Comment 1 Dominik Schmidt 2012-04-11 16:23:32 UTC
Okay, the syntax check is indeed right, PHP doesn't suppor this (WTH?!).

So instead the code completion shouldn't offer to call methods on the object.
Comment 2 Heinz Wiesinger 2014-02-07 17:17:26 UTC
Git commit 9141e9d737cc2635e7573a8b71423de9d52c3389 by Heinz Wiesinger.
Committed on 21/01/2014 at 17:43.
Pushed by wiesinger into branch 'master'.

Support the syntax for class member access on instantiation.

This adds support for syntax like (new Foo())->bar() as introduced
in PHP 5.4.

The bug, that ($a)-> still offers completion even though it is
invalid syntax (stupid PHP) remains though.
Related: bug 305779
REVIEW: 115304

M  +15   -13   duchain/builders/declarationbuilder.cpp
M  +2    -1    duchain/expressionvisitor.cpp
M  +19   -0    duchain/tests/expressionparser.cpp
M  +1    -0    duchain/tests/expressionparser.h
M  +14   -3    parser/php.g

http://commits.kde.org/kdev-php/9141e9d737cc2635e7573a8b71423de9d52c3389
Comment 3 Justin Zobel 2021-03-09 22:48:48 UTC
Thank you for the bug report.

As this report hasn't seen any changes in 5 years or more, we ask if you can please confirm that the issue still persists.

If this bug is no longer persisting or relevant please change the status to resolved.