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.
With code formatted as: function test(){ **SNIP** } If the start of the declaration is scrolled off the page, and you put your cursor on the close bracket, it would hint as to what the open bracket was ( a little pop-up would should "function test(){" ). But consider this code: function test() { **SNIP** } Placing the cursor on the closing bracket in this case will only show "{" in the pop-up, which offers no information. Ideally, if the opening bracket is alone on the line, the hint would also show the previous line. Have a great day, Mike Product Version = NetBeans IDE 7.3 (Build 201306052037) Operating System = Windows 8 version 6.2 running on amd64 Java; VM; Vendor = 1.7.0_21 Runtime = Java HotSpot(TM) 64-Bit Server VM 23.21-b01
This issue is already fixed in 8.0
Created attachment 146009 [details] Sample of bad hinting
I've just downloaded 8.0 RC1 and Nightly 201403130001, and neither of them shows that the issue has already been fixed. In case I explained the issue poorly, I've attached a screenshot. As you can see, the hint only shows "{" from line 3, not the function itself from line 2 ( "function test()" ).
Is this the editor area? (I'm sorry if I'm wrong.) Thanks.
I'm Sorry. I was wrong.
*** Bug 255296 has been marked as a duplicate of this bug. ***
Created attachment 157205 [details] screenshot for prototype I'm implementing it now...
Tomas, I'll attach a patch for prototype after I was able to add unit tests. Unfortunately, there are two problems now. 1. Probably, a problem of spi side [1] 2. I got many same WARNINGs[2] (My implementation may have some problems) [1] https://netbeans.org/bugzilla/show_bug.cgi?id=256427 [2] WARNING [org.openide.util.WeakListenerImpl]: Can't remove java.beans.PropertyChangeListener using method org.netbeans.modules.csl.core.GsfDocument.removePropertyChangeListener from org.netbeans.modules.csl.core.GsfDocument Thanks.
Will look at it, soon. Thanks!
Created attachment 157232 [details] patch for prototype I've created a patch for prototype(There are the above problems yet). Could you please review it? Thanks!
Ondro, could you please review this patch? Thanks!
Maybe also Petr could have a look at the patch, whether it is OK or not. Thanks!
I have went through the patch. Formally it's ok, anyway I have one note. The method ParserManger.parse () shouldn't be called from AWT, which in this case is ok, because BraceMatcher should not be. But the ParseManager.parse() can be very expensive. If the source is already parsed in the parsing cycle, then it's ok, the latest parse result is returned without the parsing. Parsing cycle is usually started a timeout (2s) after latest change. Using this in BraceMatcher has big chance to require parsing before the parsing cycle. It's mean that the parsing will be done completely and BraceMatcher will wait for the parsing result, which can take some time. So it's better to avoid to require parsing if it's necessary. And I think this is the case. The position could be find via lexer (Token Sequence).
@Petr Thanks a lot for reviewing it! I'll try using only lexer.
Created attachment 157631 [details] patch v2 for prototype I've created the second prototype using only lexer. Also fixed tests. Thanks.
Sorry, test cases are missing yet (try statement). Please wait a while since I'll add them later.
Created attachment 157633 [details] patch v2 for prototype Fixed. Thanks.
Created attachment 157634 [details] patch v2 for prototype Sorry, again...
Junichi, thanks a lot for your work! Will look at it soon. Thanks!
@junichi11: Nice work. Thanks.
Patch applied, thanks a lot for it Junichi! One note: instead of Exceptions class, Logger is preferred. I made this change and log BadLocationException with WARNING level. Let me know if this is incorrect (and e.g. INFO level should be used). Thanks. http://hg.netbeans.org/web-main/rev/99ade2827779
You are welcome :) Thanks a lot for applying it and fixing the Exception class!
Integrated into 'main-silver', will be available in build *201512050002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/99ade2827779 User: Tomas Mysik <tmysik@netbeans.org> Log: #242868 - Close bracket hint doesn't show code if open bracket starts its own line Patch contributed by junichi11@netbeans.org.
*** Bug 218218 has been marked as a duplicate of this bug. ***
*** Bug 230904 has been marked as a duplicate of this bug. ***