Product Version = NetBeans IDE 6.9 (Build 201006101454)
Operating System = Windows Vista version 6.0 running on amd64
Java; VM; Vendor = 1.6.0_21
Runtime = Java HotSpot(TM) 64-Bit Server VM 17.0-b16
The problem occurs using any valid schema file.
For example using this one:
When i start to type "<page ac" between the <pages> tags the auto-completion pops up, suggesting the attribute "action".
Hit ENTER, and it places the word "action" after the "ac" that i've already typed in. So, now it looks like this:
with the caret positioned after the second quote.
Alex, please take a look.
This happen again for me for Netbeans 6.9.1 but little bit different.
Product Version: NetBeans IDE 6.9.1 (Build 201007282301)
Java: 1.6.0_20; Java HotSpot(TM) Client VM 16.3-b01
System: Linux version 2.6.32-24-generic running on i386; UTF-8; en_US (nb)
I'm using spring framework with the following schema:
<?xml version="1.0" encoding="UTF-8"?>
When type "<bean " press Ctrl+Space, the auto-complete pop-up with a list of attribute I can select, next type i (for id) then the auto-complete disappear with "No suggestions" message.
Fixed in trunk: changeset 191280:4a4c43675944
"Fix for issue [#188593]. XML Code Completion: characters duplication for XML attribute auto-completion."
Integrated into 'main-golden', will be available in build *201103190400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
User: Alex Petrov <firstname.lastname@example.org>
Log: Fix for issue [#188593]. XML Code Completion: characters duplication for XML attribute auto-completion.
Thanks a lot Alex!
The fix looks good.
Please extend the unit test BasicCompletionTest ( see f.e. testAttributes1() )
The fix introduces a new regression:
1) if the completion is invoked inside the whitespace after the tag name w/o a prefix, then the completed item is inserted at the whitespace token offset, which is the previous non-ws token end offset. For example: <tagname | > + cc => <tagnameid="">. This is a direct the regression of the Alex's fix - setting typedChars field to the token image also for whitespaces.
And another existing problem remains untouched:
2) the completion doesn't work just before a syntax error, which is not nice at least in this case:
<tagname att|> ... the closing symbol is lexed as error token since there's missing the attribute value. I believe such case is pretty common - user just considers to add a new attribute so s/he puts a whitespace and invokes the cc.
I've fixed both mentioned issues in web-main#478e3746fe59
If anyone is still interested in the review, please do so now.
Vlado, can you please look at the issue and verify it? I know it's not exactly your area, but I it would help us a lot. Thanks in advance.
I'll check it tomorrow
Integrated into 'main-golden', will be available in build *201103240400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
User: Marek Fukala <email@example.com>
Log: #188593 - schema enabled xml files attributes auto-completion is broken
Everything seems to work fine, but I noticed that when type "<page ac" and invoke completion, then <page action=""| is completed but the cursor position is at the end (after last " character), not between "". In jsp or html the cursor is placed between "" characters. Is this normal behaviour or is it related to this fix?
user: Alex Petrov <firstname.lastname@example.org>
date: Sat Mar 19 00:31:08 2011 +0300
summary: Fix for issue [#188593]. XML Code Completion: characters duplication for XML attribute auto-completion.
user: Marek Fukala <email@example.com>
date: Mon Mar 21 16:09:10 2011 +0100
summary: #188593 - schema enabled xml files attributes auto-completion is broken