-
Notifications
You must be signed in to change notification settings - Fork 874
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the Auto Import feature for Code Completion #7027
Add the Auto Import feature for Code Completion #7027
Conversation
- Get aliased names for traits and enums - Add unit tests
php/php.editor/src/org/netbeans/modules/php/editor/completion/PHPCompletionItem.java
Outdated
Show resolved
Hide resolved
@tmysik Could you please have a look at this when you have time? (Huge changes, sorry...) |
Dev build to test this: https://github.com/apache/netbeans/suites/20437665071/artifacts/1219370144 |
php/php.editor/src/org/netbeans/modules/php/editor/codegen/AutoImport.java
Outdated
Show resolved
Hide resolved
php/php.editor/src/org/netbeans/modules/php/editor/completion/PHPCompletionItem.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, overall, it looks good to me. Of course, to review all the details is difficult since it is a big change :) But we have many tests for it, this is great 👍
Junichi, this feature looks amazing! Great job, as always 👍 |
@tmysik Thank you for your time and your review! I'll improve this a bit because there are a few feedbacks: #6947 (comment) |
9a40e28
to
b31c4fe
Compare
Fixed field orders and improve the insert position. Thanks! |
b31c4fe
to
1230935
Compare
Cool! |
- apache#6947 - Add `Auto Import` as an option for code completion - Add `Prefer Import` and `Don't Import` options for global namespace items(`Don't Import` is enabled by default) - `File Scope` means a php file without a namespace name (e.g. `<html><p><?php echo \NS\something(); ?></p></html>`) - Add `File Scope`(unchecked by default) and `Namespace Scope`(checked by default) options - Don't add a use statement if use list has the same name item(Instead, the result of "Smart" or "Unqualified" CC is used) - Add unit tests Note: A use statement may not be added to an expected position if the existing use list is not sorted(ignore cases)
1230935
to
c470ae1
Compare
Auto Import
as an option for code completionPrefer Import
andDon't Import
options for global namespace items(Don't Import
is enabled by default)File Scope
(unchecked by default) andNamespace Scope
(checked by default) optionsFile Scope
means a php file without a namespace name (e.g.<html><p><?php echo \NS\something(); ?></p></html>
)Note: A use statement may not be added to an expected position if the existing use list is not sorted(ignore cases)
Options
Single Use
Group Use