Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » PHP Development Tools (PDT) » Auto complete don't work with syntax errors while typing. (Auto complete don't work with syntax errors while typing. )
Auto complete don't work with syntax errors while typing. [message #893594] Wed, 04 July 2012 14:11
Kon Chatzopoulos is currently offline Kon Chatzopoulos
Messages: 1
Registered: July 2012
Junior Member
Hello, I believe that this should be a common problem but I couldn't find the solution. Let's suppose you have a class and than you go to add some code in it. While you are typing you get syntax error, so while you are typing you can't use auto complete (example a.jpg) . You can however still use auto complete in other lines (example b.jpg) .

This is a serious problem for me , because it forces me to do more moves (e.g. write the object in other line to have the auto complete , copy paste it in the right one and then delete it from the first). I am not sure if the fix has to do with auto complete (to work even if there are syntax errors while typing) , or with syntax errors check (not to check them while typing in order to have the auto complete option.

Please anyone who knows a solution to it, share it . Thank you in advance

Edit
The problem is a bit more complicated than I first described, so let me give you an example since I believe it is important. I hope anybody with this example understands what is happening and has a solution.

<?php 
class Bicycle
{
  private $gear; 
  
  public function getGear()
  {
    return $this->gear; 
  }
  
  public function setGear($gear)
  {
    $this->gear = $gear; 
  }
}

class Bicycle_Operation
{
  
  /**
   * @return Bicycle
   */
  public function getBicycle()
  {
    $bicycle = new Bicycle();
    $bicycle->setGear(0);
    return $bicycle; 
  }
}

class Job
{
  /**
   * @var Bicycle
   */
  private $bicycle; 
  
  public function doSomething()
  {
    $op = new Bicycle_Operation(); 
    $bicycle = $op->getBicycle(); 
    $this->bicycle = $op->getBicycle(); 
    
    /*
    	now if I type: $bicyle-> CTRL+Space I can see the methods with content assistance
    	{So Eclipse PDT knows here that $bicycle is a Bicycle and treat it the right way}  
    	(Template proposals) (auto complete) the same happens with $this->bicycle-> 
    	
    	But if I have an if statement, lets say I type: if($bicycle-> CTRL+Space 
    	I can't see contnet assistance and it has syntax error (No Template Proposals) 
    	
    	With the same example if I type: if($this->bicycle-> CTRL+Space 
    	I can see and use content assistance - auto complete 
    */
  }
} 
?>

  • Attachment: a.jpg
    (Size: 6.98KB, Downloaded 137 times)
  • Attachment: b.jpg
    (Size: 6.37KB, Downloaded 138 times)

[Updated on: Wed, 04 July 2012 17:38]

Report message to a moderator

Previous Topic:Remote debug with Eclipse PDT and XDebug
Next Topic:How to make barebones Juno + PDT for PHP development?
Goto Forum:
  


Current Time: Thu Jul 31 11:54:11 EDT 2014

Powered by FUDForum. Page generated in 0.09457 seconds