Community
Participate
Working Groups
I will attach a project that will demonstrate the problem.
Created attachment 24142 [details] project in question 1. Open the project, build it make sure that the scanner info looks OK. 2. Open the DOM Viewer on the parse tree for main.c and inspect it. 3. Select JEDEN in main.c and try F3 on it. It should go to the definition in macro.h but instead nothing happens. (No error, no navigation).
Devin, pls investigate and let me know if this is something that can be fixed for RC2.
Is it purely dependent upon 102066? Does the Location Map return the macro expansion properly? If so, why does it need the index to Open Declaration on it, since the macro is available through the parse?
It is dependent on 102066 and a patch that I have. The macro is not available through the parse, if you look at the JEDEN IASTName properties in the DOM AST Viewer then you will see it has a ProblemBinding. This search functionality requires the index.
-imacros yield offsets of -1 for some reason.
Created attachment 24150 [details] fix for this PR on the search side of things Improved Open Declarations/Definitions/All Declarations so that the index used even if an exception occurs elsewhere. Added MACRO when building the SearchFor for UNKNOWN_SEARCH_FOR and added DECLARATIONS_DEFINITIONS to CSearchPattern#createMacroPattern(). Removed the error message "CSearchOperation.tooManyNames.message= The operation is unavailable on the current selection (too many different names selected)." as now if many names are selected only the first name selected is used in the search.
Bogdan, what do you think of Devin's patch?
I've fixed the original NPE in CVS HEAD. Assign to Bogdan for him to look over Devin's patch.
Please take a look at the attached patch and apply/reject it.
Created attachment 24434 [details] updated fix for this PR main changes: - added try/catch to OpenDeclarationsAction/OpenDefinitionAction surrounding steps 2/3 (if find against DOM/Index throw an exception then try simple index search) - fixed the if/else structure so that a simple search against the index is attempted if both DOM/Index searches fail (used to be only if the DOM search failed) - removed the error "too many names selected" since the first selected name is searched if several names are selected
Patch committed. Thanks Devin! - BG