Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 336397

Summary: Property completion proposals depend on formatting
Product: [Eclipse Project] Platform Reporter: Michael Rennie <Michael_Rennie>
Component: AntAssignee: Michael Rennie <Michael_Rennie>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: darin.eclipse
Version: 3.7   
Target Milestone: 3.7 M6   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
proposed fix none

Description Michael Rennie CLA 2011-02-04 16:22:05 EST
Version: 3.7.0
Build id: I20110127-2034

<project>
    <property name="xml" value="/use/xml"/>
    <property name="html" value="/use/html"/>

    <apitooling.apiuse_reportconversion
      xmlfiles="$"
      debug="true"
    />
</project>

If you create a new build file for the given snippet and activate content assist after the '$' on the  xmlfiles="$" line you will see all of the properties currently available to the build file as proposals [OK]

If you then remove the leading spaces like the following:

<project>
    <property name="xml" value="/use/xml"/>
    <property name="html" value="/use/html"/>

<apitooling.apiuse_reportconversion
xmlfiles="$"
debug="true"
/>
</project>

and activate content assist in the same location mentioned above (the '$') you will not get any proposals AND you get a weird message on the status bar about 'no task proposals available'

The problem is in AntEditorCompletionProcessor#determineProposalMode. There is some funky logic in there looking for '<', '>' and ' ' and how they are related, which fails when the formatting is removed.
Comment 1 Michael Rennie CLA 2011-02-04 17:44:54 EST
Created attachment 188378 [details]
proposed fix

Changes the logic a bit to account for being in an open element AND the activation context is '$' (the property activator)
Comment 2 Michael Rennie CLA 2011-02-07 16:59:10 EST
Committed with the fix for bug 302296 due to overlapping changes.
Comment 3 Michael Rennie CLA 2011-02-12 15:48:47 EST
*** Bug 328737 has been marked as a duplicate of this bug. ***