| Summary: | Showing the actual (int) value of an enum variable in CDT editor on hover | ||
|---|---|---|---|
| Product: | [Tools] CDT | Reporter: | Steffen Schmidt <steffen-schmidt> |
| Component: | cdt-editor | Assignee: | Paulo Garcia <pgarcia> |
| Status: | RESOLVED FIXED | QA Contact: | Ken Ryall <ken.ryall> |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | cdtdoug, dirk.janssen, eclipse.sprigogin, iceonfire014, inductiveload, malaperle, marc.khouzam, mohanhambar, pawel.1.piech, pgarcia, sie, yevshif, zeratul976 |
| Version: | 6.0 | ||
| Target Milestone: | 8.6.0 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
|
Description
Steffen Schmidt
This would be a debug feature. I disagree with this being a sole debug feature. Rather, I see it as an editor feature which does not depend on debug mode. It is indeed useful if you can hover the mouse over an enum symbol and see its actual value. Visual Studio does it nicely. In Eclipse, all I get is the repeated plain enum symbol in the hover. This is not a "debug feature"!, this is an editor feature and it's missing in eclipse. This feature is standard in other intelligent source code editors such as Visual Studio and Source Insight. Both of these editors show the integer value of an enum by simply hovering over the symbolic name with the mouse. This functionality is not provided by the debugger (Source Insight doesn't contain a debugger!, it's just an editor). The values are constants so the software does not need to be running for this to work. In fact this is a very useful feature during development of code that may not even compile at that stage. I wonder if this is not already included in the latest CDT 8.4...
For example, if I have something like:
enum {
FIRST = 33,
SECOND,
THIRD
};
int main(void) {
(...)
if (num == FIRST) {
....
}
}
I can see that FIRST if 33 when hovering the mouse over it in the if statement.
Is this feature this bug is asking about?
(In reply to Paulo Garcia from comment #4) > I wonder if this is not already included in the latest CDT 8.4... > > For example, if I have something like: > > enum { > FIRST = 33, > SECOND, > THIRD > }; > > int main(void) { > (...) > if (num == FIRST) { > .... > } > } > > I can see that FIRST if 33 when hovering the mouse over it in the if > statement. > > Is this feature this bug is asking about? When hovering mouse over THIRD does it show 35? > When hovering mouse over THIRD does it show 35?
Oh ok, I see the problem now. It doesn't show the value for other enums other than the first. Thanks
Fix sent to gerrit for review: https://git.eclipse.org/r/31807 Fixed by commit http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=3bfe2d21a74cacf0bc45d83e805c95fe727f4543. Paulo, is this update merged into the main CDT branch? I've tried using the latest version of Eclipse Keplar and Luna and when hovering over "THIRD" in the example below, it only shows the enum name "THIRD". When hovering over FIRST, it does display FIRST = 33.
enum {
FIRST = 33,
SECOND,
THIRD
};
int main(void) {
(...)
if (num == FIRST) {
....
}
}
(In reply to ice fire from comment #9) > Paulo, is this update merged into the main CDT branch? See comment #8. You should be using https://hudson.eclipse.org/cdt/job/cdt-8.6/lastSuccessfulBuild/artifact/releng/org.eclipse.cdt.repo/target/org.eclipse.cdt.repo.zip Thanks Sergey that worked! The link you gave me contains a .zip file with artifacts.jar and content.jar which allowed me to install it in my eclipse through "Install New Software" and adding it as an archive. However, in comment #8, the link (http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=3bfe2d21a74cacf0bc45d83e805c95fe727f4543) shows a link to download a different .zip file which I could not install. --- download org.eclipse.cdt-3bfe2d21a74cacf0bc45d83e805c95fe727f4543.zip --- Did I miss the link on that page somehow or is there another way to install this commit with this direct .zip file? (In reply to ice fire from comment #11) > However, in comment #8, the link > (http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/ > ?id=3bfe2d21a74cacf0bc45d83e805c95fe727f4543) shows a link to download a > different .zip file which I could not install. That zip contains a snapshot of the source code at the time of the commit. You'd need to build it before you can install it. Building from source is described here [1], but if you're not planning on doing development on CDT itself, you're probably better off just downloading a nightly build from Hudson, such as the one Sergey linked to. [1] https://wiki.eclipse.org/Getting_started_with_CDT_development (In reply to Nathan Ridge from comment #12) > (In reply to ice fire from comment #11) > > However, in comment #8, the link > > (http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/ > > ?id=3bfe2d21a74cacf0bc45d83e805c95fe727f4543) shows a link to download a > > different .zip file which I could not install. > > That zip contains a snapshot of the source code at the time of the commit. > You'd need to build it before you can install it. > > Building from source is described here [1], but if you're not planning on > doing development on CDT itself, you're probably better off just downloading > a nightly build from Hudson, such as the one Sergey linked to. > > [1] https://wiki.eclipse.org/Getting_started_with_CDT_development Understood :) Thank you all! |