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.

Bug 243697

Summary: xml completion on attribute values is missing context
Product: xml Reporter: Milos Kleint <mkleint>
Component: CodeAssignee: Svata Dedic <sdedic>
Status: NEW ---    
Severity: normal    
Priority: P1    
Version: 8.0.1   
Hardware: PC   
OS: Mac OS X   
Issue Type: ENHANCEMENT Exception Reporter:

Description Milos Kleint 2014-04-09 13:49:56 UTC
consider this xml snippet (| signifies where completion is triggered)
<resource type="freemarker" name="edit" location="e|ditTask.ftl"/>

codewise it is routed to org.netbeans.modules.xml.api.model.GrammarQuery's
Enumeration<GrammarResult> queryValues(HintContext virtualTextCtx) method.

unfortunately the resulting HintContext instance returns null on getParentNode() this disallows discovering the context of the query (that the enclosing element is "resource")

getParentNode() typically works in other places (attribute keys, element names, text values)
Comment 1 Svata Dedic 2015-09-07 11:34:10 UTC
API was not designed in a way which would provide a context.