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.
When invoking CC inside of an existing tag, the existing text is moved to the right. System: Product Version: NetBeans IDE Dev (Build 200810080201) Java: 1.6.0_07; Java HotSpot(TM) 64-Bit Server VM 1.6.0_07-b06-57 System: Mac OS X version 10.5.5 running on x86_64; MacRoman; en_US (nb) Steps: 1. Paste the following code into an empty XML file <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"> <bean name="main" class="javaapplication18.Main" init-method="" p:me-ref="sam" p:me=""> <property name="me.me.me"/> </bean> | <import resource="sample/sam.xml"></import> <bean id="sam" abstract="true" autowire-candidate=""></bean> </beans> 2.Insert an <import> tag and take the cursor over the tag as : <imp|ort Press CTRL+SPACE, the import tag is shown as a completion item. <import> becomes <import resource=""ort>
It'll be nice to have such a fix (if exists). However, Tony, this is not a bug for the following reasons: a) It is hard to justify what needs to be replaced and what not b) The user can counter argue and say that s/he didn't want to replace. c) These are user's typed characters and we don't want to delete that. d) The use-case will have several corner cases. Think about it for a sec. Well, lets talk about java CC. If I have System.out.println("Hello"); and I invoke CC after the second dot and choose something else, say "checkError()" it'll simply insert that and println will move to the right. The fact that, it was user's text, we have to honor that.
"It'll be nice to have such a fix (if exists)." OK, I agree with your point. I'm just looking to improve the product, thus the 7.0 milestone and enhancement designation.
To the contrary of Samaresh, I consider the behaviour a defect. At least the CC should understand that it is being invoked on a prefix of a tagname, so if a tagname is completed, it should replace not only the prefix, but whole original tagname. Also required attributes must not be blindly generated, but rather appended if not defined yet.
Report from old NetBeans version. Due to code changes since it was reported likely not reproducible now. Feel free to reopen if happens in 8.0.2 or 8.1.