-
Notifications
You must be signed in to change notification settings - Fork 7
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 keyboard navigation commands #75
Fix keyboard navigation commands #75
Conversation
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 have the following test files:
main.h:
#ifndef MAIN_H
#define MAIN_H
int foo(int param) {
return param;
}
#endif
main.cpp:
#include "main.h"
int main() {
return 1 / foo(0);
}
If I analyze it CodeChecker will find the following report:
Let's assume that I click on the second bug step:
Now if I run the Next step command nothing happens:
I assumed that your patch fixes this use case so the editor will open main.h and select the correct ranges.
That is a very good example for testing overlapping ranges, thank you! The issue is that the 2nd (calling foo) and 5th (returning from foo) steps have the exact same location. The extension has no memory of which step it's supposed to be on, so stepping backwards always steps from Calling and forwards from Returning. |
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 don't really see what kind of problem this PR solves. Can you please describe the steps what previously don't work but with your patch it will work with a code example?
Also if we don't want to fix the problem fully could you please create another issue for it?
It solves a simpler version of the issue: main.cpp #include "main.h"
int main() {
return foo(0);
} main.h #ifndef MAIN_H
#define MAIN_H
int foo(int param) {
return 1 / param;
}
#endif In this case, navigation only worked inside main.h. Another added fix is for overlapping ranges:
Before, stepping backwards from step 2 skipped range 1, and jumped to step 1's previous step. Now when the cursor is on step 2's exact position, that one will get prioritized. Created #86 for the remaining case. |
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!
Fixes #71.