Add the Auto Import feature for Code Completion#7027
Merged
junichi11 merged 2 commits intoapache:php-nb22-featuresfrom Feb 11, 2024
Merged
Add the Auto Import feature for Code Completion#7027junichi11 merged 2 commits intoapache:php-nb22-featuresfrom
junichi11 merged 2 commits intoapache:php-nb22-featuresfrom
Conversation
- Get aliased names for traits and enums - Add unit tests
junichi11
commented
Feb 5, 2024
php/php.editor/src/org/netbeans/modules/php/editor/completion/PHPCompletionItem.java
Outdated
Show resolved
Hide resolved
Member
Author
|
@tmysik Could you please have a look at this when you have time? (Huge changes, sorry...) |
Member
Author
|
Dev build to test this: https://github.com/apache/netbeans/suites/20437665071/artifacts/1219370144 |
tmysik
reviewed
Feb 5, 2024
php/php.editor/src/org/netbeans/modules/php/editor/codegen/AutoImport.java
Outdated
Show resolved
Hide resolved
tmysik
reviewed
Feb 5, 2024
php/php.editor/src/org/netbeans/modules/php/editor/completion/PHPCompletionItem.java
Outdated
Show resolved
Hide resolved
tmysik
approved these changes
Feb 5, 2024
Member
tmysik
left a comment
There was a problem hiding this comment.
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 👍
Member
|
Junichi, this feature looks amazing! Great job, as always 👍 |
Member
Author
|
@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
Member
Author
|
Fixed field orders and improve the insert position. Thanks! |
b31c4fe to
1230935
Compare
Member
|
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

Auto Importas an option for code completionPrefer ImportandDon't Importoptions for global namespace items(Don't Importis enabled by default)File Scope(unchecked by default) andNamespace Scope(checked by default) optionsFile Scopemeans 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