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.
Summary: | Schema-aware code completion does not work when a reference is referring to element from the same schema/namespace (patch provided) | ||
---|---|---|---|
Product: | xml | Reporter: | kostas_papadopoulos |
Component: | Text-Edit | Assignee: | Svata Dedic <sdedic> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P1 | ||
Version: | 8.2 | ||
Hardware: | PC | ||
OS: | Linux | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: |
patch for issue, against main-silver
xsd to show the problem, modified from tests xsd to show the problem, modified from tests xml to show the problem, modified from tests xsd with test cases |
Created attachment 165026 [details]
xsd to show the problem, modified from tests
Created attachment 165027 [details]
xsd to show the problem, modified from tests
Created attachment 165028 [details]
xml to show the problem, modified from tests
I wasn't able to simulate the 1st case: CC does not complete complex type attributes. Specifically the code execution did not hit the added if(qname.getLocalPart().equals(ref.getName())){ return ref; } check on the referrent. IMHO, in that case, the execution would already returned earlier, since qname.getLocalPart().equals(e.getName()) == true (the proxy local name part should equal to the referrent's local name). Otherwise OK (and I'll commit some additional fixes implemented during testing). Created attachment 165040 [details]
xsd with test cases
You are right, of course, regarding the test:
if(qname.getLocalPart().equals(ref.getName())){
return ref;
I added the case that I thought I was addressing in the uploaded schema (non-abstract-child).
Will be pushed as jet-main#8c6815fd6bb3 Integrated into 'main-silver', will be available in build *201709030001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/8c6815fd6bb3 User: Svata Dedic <sdedic@netbeans.org> Log: #271381: Fixed completion of referenced elements; by kostas_papadopoulos |
Created attachment 165025 [details] patch for issue, against main-silver When a schema has a reference pointing to an element from within the same schema, code completion fails to find element attributes or children elements of complex types. Additionally, if the referred element is used in a substitution group then it fails to find the substituted elements and their attributes. The attached patch resolve the issue for me. Product Version: NetBeans IDE 8.2 (Build 201705191307) Updates: NetBeans IDE is updated to version NetBeans 8.2 Patch 2 Java: 1.8.0_92; Java HotSpot(TM) 64-Bit Server VM 25.92-b14