Skip to content
This repository has been archived by the owner on Jul 22, 2019. It is now read-only.

Improve completion class/interface/trait completion #195

Conversation

DaGhostman
Copy link

Hey! I hope this is a welcoming change as I think it will be. Basically what this PR is looking to add is:

  • Insert the FQN instead of just the class/interface/trait names, this solves the problem where one might forget to add use statement (this is particularly useful for me, since I don't always remember the exact FQN or know the FQN of a library I am using or generally makes my life easier not hyaving to think what it was)

  • Filter suggestions based on keywords present on the current line, for example suggest only classes when new is found, or suggest only interfaces when when there is implements before the cursor on the current line, same goes for extends as well, but here it checks if the cursor is after extends, but before implements (they cannot be switched, language-enforced limitation)

  • Change suggestions' insertText based on, whether or not the current class/interface/trait is imported in the file, if it is, insert just the name, otherwise push the FQN.

I will be happy to review any issues that are present in the code, so please let me know if something does not fit/might be done better or anything that can be done as well

P.S I am kinda new to writing code extensions, so keep it in mind :)

nevadascout and others added 10 commits October 28, 2016 20:04
    There was an exception here with 'trying to get index 0 of undefined' most of the times while auto completing
 - Should suggest only classes when 'new' is preceeding the call; and
- Should suggest only classes when 'extends' is before the current position of the cursor (before 'implements')
- Should suggest only interfaces when the cursor is after a 'implements' key word
- Should not insert namespace separator when using in use statements for the current file
- Should avoid conflicts whith variables/methods which contain the keywords 'new', 'implements', 'extends' and 'use' somewhere in their names
@DaGhostman DaGhostman changed the base branch from master to develop December 16, 2016 14:04
@DaGhostman DaGhostman closed this Dec 16, 2016
@DaGhostman DaGhostman mentioned this pull request Dec 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants