Dreamweaver code hinting fails for variables with capital letters

150 views Asked by At

I am using Dreamweaver CS6 at work for primarily PHP programming. The code-hinting/code-completion features which Dreamweaver provides are often highly valuable in our workflow, especially when code is being written by one person and used by another. Of course, code hinting is not exactly trivial in PHP; the loosely typed nature of the language means that not every variable's type can be known to Dreamweaver while the code is being written. We have managed to work around this limitation where it matters by ensuring that we keep a clear chain of function argument type hinting leading to the variables we care about. However, we have encountered a very strange case where Dreamweaver fails, and I'm hoping someone can shed some light on why this is happening, and ideally how to fix it.

Dreamweaver is incapable of code hinting in some situations when one of the variables involved contains a capital letter. An example:

class MyClass {
  public $var;
}

function foo(MyClass $foo) {
  return $foo;
}

$bar = foo($foo);
$foo = $bar;
$foo->var;  //Code hinting works here

$fooBar = foo($foo);
$barFoo = $fooBar;
$barFoo->var; //Code hinting fails here

Does anyone know why this happens, or if there is a way to fix it besides just using lowercase only variable names? Note that these issues will occur even if the examples are created in different files, or done in a different order, and pressing Ctrl+Space will still not bring up the code completion dropdown. If it matters, we have site-specific code hinting enabled for the directory which holds most of our library code. We are not using any major PHP framework.

0

There are 0 answers