This repository has been archived by the owner on Jul 22, 2019. It is now read-only.
Improve completion class/interface/trait completion #195
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 forextends
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 :)