Bug 274557 - CompletionContext problem with annotation value element
Summary: CompletionContext problem with annotation value element
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.5 RC1   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 274548
  Show dependency tree
 
Reported: 2009-04-30 13:38 EDT by Karen Butzke CLA
Modified: 2009-05-06 10:26 EDT (History)
1 user (show)

See Also:
Olivier_Thomann: review+


Attachments
CompletionEngine debug for @Convert(value="") (1.53 KB, text/plain)
2009-04-30 13:38 EDT, Karen Butzke CLA
no flags Details
CompletionEngine debug for @Convert("") (1.93 KB, text/plain)
2009-04-30 13:38 EDT, Karen Butzke CLA
no flags Details
Proposed patch (6.71 KB, patch)
2009-05-05 10:10 EDT, David Audel CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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!