Bug 110188

Summary: [plan][assist] Provide hook for completing inside string literal
Product: [Eclipse Project] JDT Reporter: Jerome Lanneluc <jerome_lanneluc>
Component: CoreAssignee: David Audel <david_audel>
Status: VERIFIED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: jgarms
Version: 3.1   
Target Milestone: 3.2 M4   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on: 111475    
Bug Blocks:    
Attachments:
Description Flags
incomplete patch to allow string completion none

Description Jerome Lanneluc CLA 2005-09-21 11:19:32 EDT
I20050920

We should provide a hook for completing inside string literals. Clients like APT
could use this hook to propose valid strings in their context.
Comment 1 David Audel CLA 2005-10-04 11:50:49 EDT
Created attachment 27813 [details]
incomplete patch to allow string completion

This patch only add internal support for string completion.
There is no new completion proposal and no additionnal information inside
completion context.
Comment 2 David Audel CLA 2005-11-10 07:53:57 EST
Fixed and test added.
  CompletionContextTests#test0117() -> test0127()

I flag this bug as fixed but the new behavior cannot be used as long as bug
111475 isn't fixed.

When completion is inside a string literal CompletionContext#getTokenKind() will
return CompletionContext#TOKEN_KIND_STRING_LIRERAL.

The method CompletionContext#getToken() will return the string literal including
the quotes. The starting quote will be always present but not the leading quote.

class X {
  String s = "aaa|
}

The token range also include the quotes.
Comment 3 David Audel CLA 2005-11-10 11:30:46 EST
Correction: CompletionContext#getToken() doesn't include the quotes.
Comment 4 Jerome Lanneluc CLA 2005-12-12 10:10:01 EST
Verified for 3.2 M4 using build I20051212-0010