Bug 271381 - Schema-aware code completion does not work when a reference is referring to element from the same schema/namespace (patch provided)
Schema-aware code completion does not work when a reference is referring to e...
Status: RESOLVED FIXED
Product: xml
Classification: Unclassified
Component: Text-Edit
8.2
PC Linux
: P1 (vote)
: Dev
Assigned To: Svata Dedic
issues@xml
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-08-28 04:22 UTC by kostas_papadopoulos
Modified: 2017-09-03 02:50 UTC (History)
0 users

See Also:
Issue Type: DEFECT
:


Attachments
patch for issue, against main-silver (2.93 KB, patch)
2017-08-28 04:22 UTC, kostas_papadopoulos
Details | Diff
xsd to show the problem, modified from tests (1.18 KB, application/xml)
2017-08-28 04:24 UTC, kostas_papadopoulos
Details
xsd to show the problem, modified from tests (924 bytes, application/xml)
2017-08-28 04:25 UTC, kostas_papadopoulos
Details
xml to show the problem, modified from tests (377 bytes, text/xml)
2017-08-28 04:25 UTC, kostas_papadopoulos
Details
xsd with test cases (1.31 KB, application/xml)
2017-08-29 04:54 UTC, kostas_papadopoulos
Details

Note You need to log in before you can comment on or make changes to this bug.
Description kostas_papadopoulos 2017-08-28 04:22:04 UTC
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
Comment 1 kostas_papadopoulos 2017-08-28 04:24:27 UTC
Created attachment 165026 [details]
xsd to show the problem, modified from tests
Comment 2 kostas_papadopoulos 2017-08-28 04:25:01 UTC
Created attachment 165027 [details]
xsd to show the problem, modified from tests
Comment 3 kostas_papadopoulos 2017-08-28 04:25:27 UTC
Created attachment 165028 [details]
xml to show the problem, modified from tests
Comment 4 Svata Dedic 2017-08-28 12:40:12 UTC
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).
Comment 5 kostas_papadopoulos 2017-08-29 04:54:24 UTC
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).
Comment 6 Svata Dedic 2017-09-01 09:25:20 UTC
Will be pushed as jet-main#8c6815fd6bb3
Comment 7 Quality Engineering 2017-09-03 02:50:45 UTC
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


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo