Uh oh!
There was an error while loading. Please reload this page.
Fix keyboard navigation commands - #75
Conversation
csordasmarton
left a comment
There was a problem hiding this comment.
I have the following test files:
main.h:
#ifndefMAIN_H#defineMAIN_Hintfoo(intparam) {
returnparam;
}
#endifmain.cpp:
#include"main.h"intmain() {
return1 / 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.
Discookie
commented
Feb 11, 2022
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. |
csordasmarton
left a comment
There was a problem hiding this comment.
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"intmain() {
returnfoo(0);
}main.h #ifndef MAIN_H
#defineMAIN_Hintfoo(int param) {
return1 / param;
}
#endifIn 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. |
Fixes#71.