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.
Hello,
I first want to say I love this project so far. I discovered it today, and I think it will be very useful for me.
I noticed that classes were not auto-importing on completion for me, and searching the issues I saw #167 that wasn't picked up. I thought I would give an implementation of this a try.
I have not added any tests for this yet, but I thought I would share the implementation first to see if you like the approach.
Original Commit Message:
This patch uses the CompilationUnitTree of the file being processed for a
completion to build a Set of imports for the current file and to get the path to
the file. It then uses the list of imports to determine whether the completion
candidate has already been imported. If not, the AddImport class is used to add
to the additionalTextEdits field on the CompletionItem.
Some small refactoring was done to pull useful class and package name extractors
out of JavaCompilerService.java.