This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | Code Completion broken in 7.0 | ||
---|---|---|---|
Product: | php | Reporter: | larsomat |
Component: | Editor | Assignee: | Petr Pisl <ppisl> |
Status: | VERIFIED FIXED | ||
Severity: | normal | CC: | mmirilovic, pjiricka, tzezula, vriha |
Priority: | P1 | ||
Version: | 7.0 | ||
Hardware: | Macintosh (x86) | ||
OS: | Mac OS X | ||
Issue Type: | DEFECT | Exception Reporter: | |
Bug Depends on: | 196925, 196930 | ||
Bug Blocks: |
Description
larsomat
2011-01-13 08:13:00 UTC
When I'm inside the class and type "self::getInstance()->..." autocomplete works, though... I need to reverify, but voting P1 for now. imho Symfony support should just work before public RC When there is code in one file: <?php class Cls1 { static public function getInstance() { return new Cls1(); } public function getName(){ } } class Cls2 { public function doSomething() { Cls1::getInstance()-> } } ?> then cc after Cls1::getInstance()-> works, but when you create new file with <?php class Usage { function neco($param) { Cls1::getInstance()-> } } ?> then cc after Cls1::getInstance()-> doesn't work. But when is defined return type through php doc /** * * @return Cls1 */ static public function getInstance() { return new Cls1(); } the the cc works in both cases. I know the problem now. It's regression from some performance fixes that was done in December. It influence every method in any class, it's really P1. The problem is that in the index now are not stored return types of methods, for functions it still works. The body of methods are scanned lazy, only when we need it during editing the files. When you need find out return type, then you have to scan the body of the method, if there is no php doc with @return tag. In the index, due to the change, the data about a method doesn't contains the return types. So when the code completion takes information from index, there are no return types of method, when the information is taken from model that it's build for the edited file, then everything works because the model provide appropriate return type lazy. I don't know now how to fix it properly, with keeping good performance during editing big files.:( I have change the subject to reflect better the situation and also component. So one of the solution could be to scan whole file during indexing source roots. When the user will edit a file, the file will be scanned lazy as it now. It means that the first scanning of a project will take more time. For this we need to recognized, whether we are scanning whole root and we can use method isAllFilesIndexing() in org.netbeans.modules.parsing.spi.indexing.Context, at least according the javadoc. Unfortunately the behavior of the method doesn't reflect it's documentation and should be corrected the behavior or the documentation. The second part of the problem is recognizing, whether the index infrastructure is calling our php indexer, when the file is modified. Fixed in the web-main. Could I ask QA to test it? Thanks. Vlada, if you will have time ... please look at this as well. Thanks in advance. Had a short look in Build 201103220400. Seems to work so far with my current symfony project. Will test extensively next week. (In reply to comment #9) > Had a short look in Build 201103220400. Seems to work so far with my current > symfony project. Will test extensively next week. larsomat, thanks a lot. Petr, I think you can integrate the fix into release70. Please do so today by 8pm. Thanks in advance. Integrated into 'main-golden', will be available in build *201103240400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/c0b15d6791dc User: Petr Pisl <ppisl@netbeans.org> Log: #194294 - Code Completion broken in 7.0 The fix was also transplanted into release70. Sorry for delay, I'll test it during weekend verified |