deep-assoc-completion
deep-assoc-completion copied to clipboard
Disable completion // with `@noDeepAssoc` doc comment
Is there a way to disable completion for method arguments?
Otherwise, a php annotation would be nice.
class Foo {
/**
* @param array $attributes
*/
public function create(array $attributes){
// random method body using $attributes array like
if($attributes['bar']){}
if($attributes['foobar']){}
if($attributes['barfoo']){}
}
}
$foo = new Foo
/** @noDeepAssoc */
$foo->create([
'bar' => '<caret>',
'foobar' => '<caret>',
);
Hi. There is no such functionality yet. I can add it. Do you want method arguments completion disablable only per function basis, or should there also be an option in settings to disable it everywhere?
I'd like to disable it on a per function basis. Ideally both as a method docblock and a inline docblock:
class Foo {
/**
* @param array $attributes
* @noDeepAssoc
*/
public function create(array $attributes){
// random method body using $attributes array like
if($attributes['bar']){}
if($attributes['foobar']){}
if($attributes['barfoo']){}
}
}
$foo = new Foo
$foo->create([
'bar' => '<caret>', // no deep-assoc-completion
'foobar' => '<caret>', // no deep-assoc-completion
);
class Foo {
/**
* @param array $attributes
*/
public function create(array $attributes){
// random method body using $attributes array like
if($attributes['bar']){}
if($attributes['foobar']){}
if($attributes['barfoo']){}
}
}
$foo = new Foo
/** @noDeepAssoc */
$foo->create([
'bar' => '<caret>', // no deep-assoc-completion
'foobar' => '<caret>', // no deep-assoc-completion
);
I think it makes sense to also use it for variables and properties, if that's possible
class Foo {
/**
* @var array
*/
public $barAttr = ['bar' => 'foo', 'foo' => 'bar'];
/**
* @var array
* @noDeepAssoc
*/
public $barFooAttr = ['bar' => 'foo', 'foo' => 'bar'];
}
$foo = new Foo
$barAttr = $foo->barAttr;
/** @noDeepAssoc */
$foo->barAttr['<caret>']; // no deep-assoc-completion
/** @noDeepAssoc */
$barAttr['<caret>']; // no deep-assoc-completion
$barFooAttr = $foo->barFooAttr;
$foo->barFooAttr['<caret>']; // no deep-assoc-completion
$barFooAttr['<caret>']; // no deep-assoc-completion
Ok, got it. Will take some time, but I'll implement this.
by
/**
* @noDeepAssoc
*/
public function create(array $attributes);
You want to only disable argument completion? Or completion from this function result, like $this->create()['<caret>']
should be disabled as well?
If you don't want result completion be disabled, I think the name of this tag should be something more like @noDeepAssocUsageBasedCompletion
.
@noDeepAssoc
for all
@noDeepAssocArgumentCompletion
@noDeepAssocUsageCompletion
maby?
Yeah, sounds good. Though inside the plugin argument completion and usage based completion is same thing.
At least name-wise
I don't want to overcomplicate things for you, I'm already happy with just @noDeepAssoc
disabling all deep assoc completion
ok, cool