Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Completion not detecting member variable objects #105

Open
mariusroets opened this issue Sep 14, 2017 · 1 comment
Open

Completion not detecting member variable objects #105

mariusroets opened this issue Sep 14, 2017 · 1 comment
Labels

Comments

@mariusroets
Copy link

If member variables are objects, completion does not seem to work on them. Simply

$model = new MyModel();
$model->// Completion works here
$this->model = new MyModel();
$this->model->// Completion does not work here
@complex857
Copy link
Collaborator

Hmm, at the moment the plugin doesn't try to figure out object attribute types from direct assignment.

What you might be able to do in your example, is that if the $model variable's type is detectable by the plugin you can set up an type-annotated attribute in that class's definition and then it will be inferred from there.

So something like:

Class MyModel {
   /**
   * model
   *
   * @var MyModel
   */
  public $model;
}

$model = new MyModel();
$model->model-> // should work here.

I guess your situation is more dynamic here so this might not apply. I'll have to look into how this could be implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants