Bug 274557

Summary: CompletionContext problem with annotation value element
Product: [Eclipse Project] JDT Reporter: Karen Butzke <karenfbutzke>
Component: CoreAssignee: David Audel <david_audel>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: Olivier_Thomann
Version: 3.5Flags: Olivier_Thomann: review+
Target Milestone: 3.5 RC1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 274548    
Attachments:
Description Flags
CompletionEngine debug for @Convert(value="")
none
CompletionEngine debug for @Convert("")
none
Proposed patch none

Description Karen Butzke CLA 2009-04-30 13:38:07 EDT
Created attachment 133975 [details]
CompletionEngine debug for @Convert(value="")

I am working off of 3.5 head and see a problem with CompletionContext.getTokenStart() returning -1 for an annotation value element.

Here is an example where our completion assist works inside of the double quotes:
@Convert(value="")

The problem is when you don't include the value element, which is perfectly valid for annotations:
@Convert("")


I am attaching docs with the debug info from CompletionEngine.
Comment 1 Karen Butzke CLA 2009-04-30 13:38:32 EDT
Created attachment 133976 [details]
CompletionEngine debug for @Convert("")
Comment 2 David Audel CLA 2009-05-05 10:10:03 EDT
Created attachment 134427 [details]
Proposed patch

CompletionParser did not attach the completed string literal to the enclosing annotation node.
Comment 3 David Audel CLA 2009-05-05 10:14:45 EDT
Olivier, could you review my patch?
Comment 4 Olivier Thomann CLA 2009-05-05 11:55:45 EDT
Patch looks good.
Comment 5 David Audel CLA 2009-05-06 04:56:18 EDT
Released for 3.5RC1.

Tests added
  GenericsCompletionParserTest#test0219_Diet() -> test0220_Diet()
  CompletionContextTests_1_5#test0041() -> test0042()
Comment 6 Karen Butzke CLA 2009-05-06 10:26:16 EDT
Thanks guys, this works great!