Bug 136648 - [api][performance][content assist] add ability to fetch additional info of proposals in background thread
Summary: [api][performance][content assist] add ability to fetch additional info of pr...
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.2   Edit
Hardware: PC All
: P1 normal (vote)
Target Milestone: 3.2 RC2   Edit
Assignee: Tom Hofmann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 129168
  Show dependency tree
 
Reported: 2006-04-13 10:39 EDT by Tom Hofmann CLA
Modified: 2006-04-26 11:03 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Hofmann CLA 2006-04-13 10:39:36 EDT
I20060412-20xx

See bug 129168 for the context. Basically, the AdditionalInfoController implementation has always computed the additional information (e.g. javadoc) about proposals in the display thread. Unlike the hover manager, it only uses a thread to compute the delay, then posts into the display thread to compute and display the info.

This is a problem when the information computation is expensive, for example when javadoc is fetched from a remoted location and parsed.

Existing ICompletionProposal implementations may assume that ICompletionProposal::getAdditionalInfo() is called in the display thread, so we cannot simply push the computation into the background for compatibility reasons.

We propose to create a new extension interface for ICompletionProposal that explicitely states that its additional information may be computed in the background:

public interface ICompletionProposalExtension5 {
	/**
	 * Returns additional information about the proposal. The additional information will be
	 * presented to assist the user in deciding if the selected proposal is the desired choice.
	 * <p>
	 * This method may be called on a non-UI thread.
	 * </p>
	 * <p>
	 * By default, the returned information is converted to a string and displayed as text; if
	 * {@link ICompletionProposalExtension3#getInformationControlCreator()} is implemented, the
	 * information will be passed to a custom information control for display.
	 * </p>
	 * 
	 * @param monitor a monitor to report progress and to watch for
	 *        {@link IProgressMonitor#isCanceled() cancelation}.
	 * @return the additional information, <code>null</code> for no information
	 */
	Object getAdditionalProposalInfo(IProgressMonitor monitor);
}


The differences to ICompletionProposal::getAdditionalProposalInfo are:
- adds explicit threading information to the javadoc
- adds a progress monitor that supports cancellation
- returns an Object instead of a string, similar to IAnnotationHoverExtension::getHoverInfo

API considerations:
- adding a new interface is unproblematic. The call sequence and behavior for existing ICompletionProposal implementations that do not implement the new interface is unchanged.
Comment 1 Tom Hofmann CLA 2006-04-13 10:40:50 EDT
Adding John and Erich for API addition approval. This is a non-breaking API addition.
Comment 2 Dani Megert CLA 2006-04-13 10:51:44 EDT
+1 from my side this is a huge performance improvement and a must to enable fetching Javadoc info from attached Javadoc.
Comment 3 Erich Gamma CLA 2006-04-13 11:20:13 EDT
+1 same rational as Dani
Comment 4 Tom Hofmann CLA 2006-04-13 11:48:03 EDT
released > 20060413
Comment 5 Benno Baumgartner CLA 2006-04-26 11:03:45 EDT
verified in 20060426