nette-intellij/intellij-nette

Skip / ignore magic methods

castamir opened this issue · 5 comments

Why? They can be called directly.

@JanTvrdik: Is it worth it? Can you provide any real-world use case where you would call these directly without overloading them first? (They should at least have lower/lowest priority in the list.)

Can you provide any real-world use case where you would call these directly without overloading them first?

Yes

Edit: I didn't notice the "without overloading them first" part. In that case parent::__get($name) is sometimes used.

By saying:

Can you provide any real-world use case where you would call these directly without overloading them first?

I meant using $this->__get($name) without actually overriding this method.

The thing is, I was thinking about this idea of hiding magic methods, only under the condition they are not declared elsewhere than on Nette\Object. So the default implementation (just extending Nette\Object) would not include magic methods in completion, but when you override any magic method (regardless of calling its parent method), it would be then visible as usual.

Better solution would be to provide autocompletion immediately (not after hitting autocomplete twice, which gives more options).

But now we don't know how to do it, probably it is not even possible with the API at the moment.

See #9.