Community
Participate
Working Groups
Sometimes while creating new function inside class body, global elements become visible Example: class Foo { | //write fast public function m or public m and wait for autoassit } to simplify simulation: paste "public function" + space + m (fast) Result: Suggestions like mysqli_connect become visible. Expected: Nothing Same for variables.
It looks that GlobalStatementContext is using IModelElement.getElementAt() and after fast typing (pasting) changes are not reconciled yet. GetElementAt() is using old source ranges from model (but offset for element is actual) and returned element is null. I went deeper and I found that DirtyRegionProcessor from WST has delay (500 ms) between reconciliations (this delay is also sometimes visible with highlighting). I'm not sure why this value is so big.
Same delay is also in JFace AbstractReconciler (JavaReconciler using it) We can add simple backward code scan to verify and avoid confusion.
Yes, probably it is best solution. We just need to remember that other contexts can be also affected with this problem.
Different case to cover: <?php trait NEWTRAIT { } class NEWCLASS { // | } In place "|" press Enter and type fast e.g. "pro". CA will propose global methods e.g. "proc_close()".
New Gerrit change created: https://git.eclipse.org/r/44394
Gerrit change https://git.eclipse.org/r/44394 was merged to [master]. Commit: http://git.eclipse.org/c/pdt/org.eclipse.pdt.git/commit/?id=e187d437e7ae3d516473e92260c85725f7099c9f
Fixed.
Can you please check again. I see now the following 2 problems: * With Dawid's examples I get now proposals for templates which are also irrelevant for the current context. * With Michal's example now if I type 'pro' fast enough I do not get any proposals automatically (I need to press ctrl+space to autocomplete to protected). If I fast-type only 'pr' I get templates. I will attach few screen-shots
Created attachment 252875 [details] screenshot1
Created attachment 252876 [details] screenshot2
Created attachment 252877 [details] screenshot3
New Gerrit change created: https://git.eclipse.org/r/58767
Gerrit change https://git.eclipse.org/r/58767 was merged to [master]. Commit: http://git.eclipse.org/c/pdt/org.eclipse.pdt.git/commit/?id=8d4f26cb13024358ab1778ced7d19bdcfa7805c5
Done. Other problems with invalid context/proposals after fast typing should be resolved as separate issues.
So I see that most things are solved except from the templates?
I created a different issue for the templates - see Bug 459947. Closing this one.