crane icon indicating copy to clipboard operation
crane copied to clipboard

Sugestions/Autocomplete improvements/feature on class declarations.

Open ichiriac opened this issue 7 years ago • 2 comments

We could improve suggestions when declaring a new function into a class.

When starting to type into a class body :

image

We should have :

  • public
  • protected
  • private
  • abstract (if the class is abstract)
  • final
  • static
  • const

If prefixed by const, after space do not autocomple : image

But if already prefixed by final, static, abstract, final should not be suggested again after.

If prefixed by public / protected / private, suggest after just function.

After a function, the name suggestion should contain :

image

  • __construct
  • __get
  • __set
  • __call
  • __unset
  • ... http://php.net/manual/en/language.oop5.magic.php
  • the parent(s) classes not final, not private methods (that are not already defined)
  • the interface unimplemented methods

ichiriac avatar Mar 17 '17 20:03 ichiriac

It is a pain in the ass to crane as it is now. Whenever I type, the autocomplete popup. It should not popup when typing a new method name

screenshot from 2017-03-26 03-01-25

Until this issue is closed, I'll the other PHP Intellisense, slow indexation but it is usable.

vtalbot avatar Mar 26 '17 07:03 vtalbot

Hi @vtalbot,

Propositions are not yet optimized but anyway the real problem is that autocomplete is too optimistic and triggers results after each whitespace.

I've tried another extension and disabled ours, in order to see how it reacts. On declaring a method, without forcing autocomplete :

image

If I start to type into a method $this is not recognized, and if I force the autocomplete with shortcut, seems to work with properties but insert them as variable property $this->$record :

image

The typescript autocomplete in vscode, triggers immediately when it can :

image

Eclipse never shows autocomplete (in my configuration), but you can ask for it with the CTRL+space shortcut.

@nevadascout Maybe we could add an option to make intellisense less optimistic (like avoid proposal unless it's asked by the shortcut)

ichiriac avatar Mar 26 '17 08:03 ichiriac