-
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
Fix #5578 namespaces/use placement #5579
Conversation
} catch (BadLocationException ex) { | ||
Exceptions.printStackTrace(ex); | ||
} | ||
return false; |
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.
would return in catch block read better?
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.
i am not a java developer, if it would be better i am willing to make changes, but just checked few files with similar logic and there is usually return outside
php/php.editor/src/org/netbeans/modules/php/editor/actions/FixUsesPerformer.java
Outdated
Show resolved
Hide resolved
php/php.editor/src/org/netbeans/modules/php/editor/actions/FixUsesPerformer.java
Outdated
Show resolved
Hide resolved
Could you add unit tests? |
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.
Please, add unit tests for your use case. Thank you.
e74d654
to
37518bd
Compare
Added tests and fixes. |
I've found more issues related to use placement, will do force push when have it fixed |
37518bd
to
a43b2ab
Compare
Added new test case and refactored some code. There is still a problem with multiple global namespaces, but problem is not related to Fix Import and I suppose should be fixed by other PR. |
a43b2ab
to
243e8e5
Compare
Please rename |
243e8e5
to
bcddec0
Compare
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.
LGTM, thanks for your work!
@rossluk Please, wait for approval from @junichi11. Thank you. |
php/php.editor/src/org/netbeans/modules/php/editor/actions/FixUsesPerformer.java
Show resolved
Hide resolved
php/php.editor/test/unit/data/testfiles/actions/testGH5578/01/testGH5578_01.php.fixUses
Outdated
Show resolved
Hide resolved
bcddec0
to
bb46132
Compare
bb46132
to
fb06369
Compare
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.
Thank you for your work.
Fix "Fix Import" namespaces/uses placement in multiple php open tag files, when first line of php file is not empty or it is a block element, after declare statements in different scope