-
Notifications
You must be signed in to change notification settings - Fork 877
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
[GH-8286] Fix Go to Declaration for an enum method using an FQ name #8287
base: master
Are you sure you want to change the base?
Conversation
It's not easy to understand what is fixed. So, I would write the following to the commit message title instead. (Also an example)
Example: namespace test1;
enum TestA {
case X;
public function get(string $param): string {
return '';
}
}
namespace test2;
\test1\TestA::X->get('xxx'); // don't work go to declaration & mark occurrences for the get method
It's possible. Please add unit tests for GotoDeclaration and MarkOccurrences. ( Please add the issue number(e.g. |
@junichi11 Thank you for your feedback. It seems I misunderstood something about the unit tests. I added 2 test cases and changed the implementation due to failing tests. I hope it is more clear now what is happening. |
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 don't use TABs.
Missing ***.occurrences
file.
php/php.editor/src/org/netbeans/modules/php/editor/model/impl/VariousUtils.java
Outdated
Show resolved
Hide resolved
php/php.editor/test/unit/data/testfiles/gotodeclaration/testIssue270422/testIssue270422.php
Outdated
Show resolved
Hide resolved
php/php.editor/test/unit/data/testfiles/gotodeclaration/testIssueGH8286/testIssueGH8286.php
Outdated
Show resolved
Hide resolved
php/php.editor/test/unit/data/testfiles/markoccurences/testIssueGH8286/testIssueGH8286.php
Outdated
Show resolved
Hide resolved
...ditor/test/unit/src/org/netbeans/modules/php/editor/csl/OccurrencesFinderImplGH8286Test.java
Outdated
Show resolved
Hide resolved
Basically just follow the existing source code. Please reformat only your changes. |
You have to squash as one commit.
|
@junichi11 squashed, changed formatting, added result files |
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 use 4 spaces.
php/php.editor/test/unit/data/testfiles/gotodeclaration/testIssueGH8286/testIssueGH8286.php
Outdated
Show resolved
Hide resolved
.../testfiles/markoccurences/testIssueGH8286/testIssueGH8286.php.testIssueGH8286_01.occurrences
Outdated
Show resolved
Hide resolved
39903ac
to
88a3a98
Compare
…name -Accessing a Constant of an Enum/Class now uses FQ name if possible Example: ```php namespace test; enum TestA{ case X; public function get(string $param): string{ return ''; } } namespace test2; enum TestB{ case X; public function get(): string{ return ''; } } \test\TestA::X->get('xxx'); // go to declaration and mark occurences do not work ```
@junichi11 changed to 4 spaces. Is there any correct way to push these kind of changes while keeping it in the same commit? Now I have been using --force, although I have heard it is not good to do that |
This should be no problem because it is a topic branch and we can see the diff(https://github.com/apache/netbeans/compare/88a3a985ba388732459deb98aa83c406755ead1b..65cb2cf61af76acf8b1e587186e1562a75d8d3f6).
or
|
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!
Please also change the title of this PR. Thanks! |
@NReib, thanks for this PR! 🎉 Regarding Git force-pushing - typically, it is totally OK, if you are the only person working on the branch. It should/cannot be used when more people work on it, since it basically rewrites the Git history (so, if user A force-pushes something, it could overwrite - and therefore loose - changes done by someone else). |
@NReib, as @junichi11 wrote, please always try to unify the issue and the PR so it is clear that they belong to each other. For the issue, I can see this: Also, providing a code example in the PR description helps a lot. Thank you. |
(I changed the PR title now.) |
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 this PR. 👍
#8286
This is my first push using git.
Sadly I was not able to create unit tests for this.