This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 37890 - Tooltip shows value even for comment or for different file
Summary: Tooltip shows value even for comment or for different file
Status: VERIFIED FIXED
Alias: None
Product: debugger
Classification: Unclassified
Component: Java (show other bugs)
Version: 3.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@debugger
URL:
Keywords: ARCH
: 51795 68315 110457 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-12-09 14:07 UTC by Milan Kubec
Modified: 2010-05-25 07:20 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Milan Kubec 2003-12-09 14:07:55 UTC
When Debugging tooltips show values of the
variables even when caret is placed over the
variable name in comment or in different source
file which is not debugged.
Comment 1 Maros Sandor 2003-12-12 13:25:53 UTC
Tooltips are effectively temporary watches that are displayed in a 
tooltip, hence the described behavior. We would need additional 
checks to limit their display to scope, etc. So, let's say it is 'by 
design' and maybe we could make it a RFE or P4.
Comment 2 Milan Kubec 2004-01-06 14:34:37 UTC
I'd like to keep this issue as P3 DEFECT, since the behavior is
confusing. Is new debugger API designed to handle this?
Comment 3 Maros Sandor 2004-05-20 10:16:32 UTC
Symbols in other files may still be valid: static variables, 
constants, enumerations, reference types, static methods. We would 
need some special mode of operation in expression evaluator that 
will "evaluate only in static context". The other solution is to 
disable tooltips in other files completely. The first is too much 
work for low effect and the second is a limitation in functionality.
Comment 4 Jan Jancura 2004-12-01 23:05:36 UTC
This has nathing common wit debugger apis. It depends on Java Parser
functionality. It can be iproved in the future.
Comment 5 Jan Jancura 2004-12-01 23:05:40 UTC
*** Issue 51795 has been marked as a duplicate of this issue. ***
Comment 6 Martin Entlicher 2005-11-03 14:28:47 UTC
IMHO to fix this, we would have to retrieve the type of the enclosing class from
the editor. And then evaluate the variable as <class type>.this.<variable name>
- can be done after issue #59735 is fixed. This would work for fields, I'm not
sure about local variables...

Also, we should disable tooltips on Java keywords - they look terribly.
Comment 7 Roman Ondruska 2005-11-09 08:45:43 UTC
*** Issue 68315 has been marked as a duplicate of this issue. ***
Comment 8 ehucka 2007-04-06 12:35:01 UTC
Tooltips shown on strings in source code ("text") contain meaningless messages too:

text = >"text" is not a know variable in current context<

The same for any word in comment.

Tooltips on classes show:

java.lang.Object = >Unknown type "java.lang.Object"<

I would not present such things about debugger :).
Comment 9 Roman Ondruska 2007-08-15 16:52:51 UTC
*** Issue 110457 has been marked as a duplicate of this issue. ***
Comment 10 Roman Ondruska 2007-08-15 17:01:33 UTC
Also reported the tooltip disappeared after some delay -- no repro-case available. It is probably too late to fix in NB
6; if so, this issue should be addressed in the next release.    
Comment 11 Martin Entlicher 2008-11-10 14:29:33 UTC
Scheduling for the next version, restrictions of this kind must be done carefully.
Using the Java parser, we can detect the correct scope for local variables and we can evaluate fields with the respect
to the correct class.
Comment 12 Daniel Prusa 2010-04-27 22:07:57 UTC
Fixed, the following features have been implemented:
- tooltip is not displayed on comments
- tooltip is displayed only for current class and its super classes
- it is still possible to show tooltip for an arbitrary piece of code when it is selected in editor (this works even for comments)

http://hg.netbeans.org/main/rev/6b491fda81bd
Comment 13 Marian Mirilovic 2010-05-25 07:20:02 UTC
verified in NB 6.9 RC1