Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 320213

Summary: JdtTypesProposalProvider: completion contains imported package name
Product: [Modeling] TMF Reporter: Victor Noël <victor.noel.irit>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: sebastian.zarnekow
Version: 1.0.0Flags: sebastian.zarnekow: helios+
Target Milestone: SR1   
Hardware: All   
OS: All   
Whiteboard:

Description Victor Noël CLA 2010-07-19 02:29:57 EDT
Hello,

When using JdtTypesProposalProvider for createTypeProposals, the completed references contains the complete qualifiedName with the package even if the package is imported.

See http://www.eclipse.org/forums/index.php?t=msg&&th=171661&goto=546297#msg_546297
Comment 1 Sebastian Zarnekow CLA 2010-08-05 11:48:23 EDT
@Inject
private ITypesProposalProvider.IScopableTypesProposalProvider typesProposalProvider;

@Override
public void completeReferenceHolder_CustomizedReference(EObject model, Assignment assignment,
		ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
	IScope scope = getScopeProvider().getScope(model, ContentAssistTestLanguagePackage.Literals.REFERENCE_HOLDER__CUSTOMIZED_REFERENCE);
	ITypesProposalProvider scopedProposalProvider = typesProposalProvider.getScopedProposalProvider(model, scope);
	scopedProposalProvider.createTypeProposals(this, context, acceptor);
}


Fixed in HEAD.
Use the newly introduced ITypesProposalProvider.IScopableTypesProposalProvider  to create proposals that are aware of imports. This API is preliminary as it is designed as a backwards compatible workaround for 1.0.1. Please note that it is likely to change in Indigo.
Comment 2 Karsten Thoms CLA 2017-09-19 15:48:30 EDT
Closing bug which were set to RESOLVED before Eclipse Neon.0.