Bug 493268 - Hover preview only shows last line in "struct typedef"
Summary: Hover preview only shows last line in "struct typedef"
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-editor (show other bugs)
Version: 8.8.0   Edit
Hardware: PC Windows 7
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-09 15:36 EDT by Ron W CLA
Modified: 2020-09-04 15:22 EDT (History)
2 users (show)

See Also:


Attachments
Screen clip showing hover preview with only last line of typedef struct (7.92 KB, image/png)
2016-05-09 15:36 EDT, Ron W CLA
no flags Details
C source file for test artifact to demo problem (134 bytes, text/plain)
2016-05-10 20:38 EDT, Ron W CLA
no flags Details
C header file of test artifact to demo the problem (238 bytes, text/plain)
2016-05-10 20:39 EDT, Ron W CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ron W CLA 2016-05-09 15:36:16 EDT
Created attachment 261570 [details]
Screen clip showing hover preview with only last line of typedef struct

Where a typedef declaration is defining a type based on a struct or union, the hover preview only shows the last line (where the new type is named).

See attached screen clipping.

In header file, there is:
typedef struct {
int field0;
int field1;
} mytype;

In code source file, there is:
mytype myvar;

When hovering over "mytype", I pressed F2, then resized the resulting floating window larger. Only the last line of the typedef was in the preview:
} mytype;

i would expect to be able to see (or scroll through) the full text typedef struct much like I can scroll through the full text of a function in the preview.
Comment 1 Nathan Ridge CLA 2016-05-09 16:31:05 EDT
I'm not able to reproduce this issue with the small code example ("mytype") you posted. Could you attach a complete code file that demonstrates your issue? Thanks!
Comment 2 Ron W CLA 2016-05-10 20:26:05 EDT
I'm still working on creating a "test article" demonstrating the problem. Right now, the closest I can get is to #include the same header file that was used in the example in the screen clip. Unfortunately, that header file is for a commercial third party library, so I can't include it. I am attempting to isolate what in it might be causing the problem. Once I succeed, I will try to create a new header file that duplicates the problem.
Comment 3 Ron W CLA 2016-05-10 20:38:30 EDT
Created attachment 261621 [details]
C source file for test artifact to demo problem
Comment 4 Ron W CLA 2016-05-10 20:39:24 EDT
Created attachment 261622 [details]
C header file of test artifact to demo the problem
Comment 5 Ron W CLA 2016-05-10 20:41:20 EDT
Attached a C source and a C header that seem to show the problem. Don't know if it's the * but defining 2 user types in the typedef and using the second seems to have triggered the problem.
Comment 6 Nathan Ridge CLA 2016-07-14 03:36:09 EDT
Thank you for the example, I can reproduce the problem now. 

Note that it does not seem to be required for the structure to be defined in a separate file; the same problem occurs when it is defined in the same file.