| Summary: | Code completion for function pointers doesn't display parameters/arguments | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Tools] CDT | Reporter: | Ben Davis <entheh> | ||||
| Component: | cdt-parser | Assignee: | Project Inbox <cdt-parser-inbox> | ||||
| Status: | NEW --- | QA Contact: | Jonah Graham <jonah> | ||||
| Severity: | enhancement | ||||||
| Priority: | P3 | CC: | cdtdoug, marc.khouzam, simon.marchi, ultrano, yevshif | ||||
| Version: | 8.0 | Flags: | ultrano:
review?
(cdtdoug) |
||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Windows 7 | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Created attachment 247050 [details]
Implement CA for function-pointers
CFunctionType and CPPFunctionType get a new member, which is also marshalled. Most or all usecases should be covered, except for:
void main(){
int (*rejected)(int b, int c);
rejected(); // cursor is between ( and ), CA gets invoked
}
Here is a proposed patch, that implements the required functionality for C and C++. Note that marshalling gets extended for 2 types, and CFunctionType marshalling is using a flag "last_flag << 1". It was made inextendable, so I am unsure of a better solution. Maybe changing min_version from "172.0" to "173.0" would be best. Any update on this? 2 months and nothing. Seems like no-one should bother fix CDT issues, as the fixes go into /dev/null? I had planned to make a bunch of improvements/fixes... (In reply to Iliyan Dinev from comment #3) > Any update on this? 2 months and nothing. Seems like no-one should bother > fix CDT issues, as the fixes go into /dev/null? I had planned to make a > bunch of improvements/fixes... Hi Iliyan, we are no longer allowed to accept patches through bugzilla but must go through Gerrit. First you will need to sign your CLA: https://www.eclipse.org/legal/clafaq.php and then you can submit your patch to Gerrit: https://wiki.eclipse.org/CDT/git#Using_Gerrit_for_CDT Thanks Heh, it's funny how I just stumbled upon the same "problem" and someone made a patch for it not so long ago. :) Iliyan, I did try your patch for my very basic use case and it works fine for that. I think it would be very useful to have it merged, so I encourage you very much to post it to Gerrit. As Marc said, you need to go through Gerrit. Patches posted directly as attachment to bugs go unnoticed whereas new changes posted on Gerrit pop on the TODO list of maintainers. Be assured that all contributions are appreciated. |
Hi, If I put the following code into a C++ editor: void firstTest(int x); void (*secondTest)(int x); void test() { } Then I put the cursor inside the test() function body, begin to type 'firstTest', and press Ctrl+Space, then it will generate firstTest(), put the cursor between the brackets, and give me a tooltip showing '(int x)'. If I instead begin to type 'secondTest', then it will autocomplete the name of the variable without giving me any arguments. If I type the ( myself and press Ctrl+Space again, it still won't tell me the required arguments. Even if I type '(*secondTest)(' and press Ctrl+Space, I still don't get anything. This makes it difficult to develop with OpenGL extensions where all the functions are declared as pointers, so I'd like to request that function pointers be supported in this way if possible :) Thanks in advance - let me know if you need any more information. (Also apologies if this is a duplicate; the search results weren't loading for me when I tried to search.)