Bug 110188 - [plan][assist] Provide hook for completing inside string literal
Summary: [plan][assist] Provide hook for completing inside string literal
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 3.2 M4   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 111475
Blocks:
  Show dependency tree
 
Reported: 2005-09-21 11:19 EDT by Jerome Lanneluc CLA
Modified: 2005-12-12 10:10 EST (History)
1 user (show)

See Also:


Attachments
incomplete patch to allow string completion (9.72 KB, patch)
2005-10-04 11:50 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 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