Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Dynamic Languages Toolkit (DLTK) » CompletionProposal.getCompletion() dead code?(CompletionProposal.updateCompletion always false so getCompletion does not add method arguments)
CompletionProposal.getCompletion() dead code? [message #645399] Fri, 17 December 2010 02:09
Carl Knight is currently offline Carl Knight
Messages: 13
Registered: December 2010
Junior Member
I have installed Dynamic Languages Toolkit - Core Frameworks Source Code 2.0.0.v20100518-1923-7L--EAAoOVMSMc4AWEvJ org.eclipse.dltk.core.source.feature.group

My outline view shows method arguments and return types. The code completion only shows return types. It looks like method arguments are supposed to be built on the fly in CompletionProposal.getCompletion() (org.eclipse.dltk.core)

There appear to be two reasons why this is not working:

1. org.eclipse.dltk.ui.text.completion.ScriptCompletionProposal Collector.createMethodReferenceProposal (unlike createMethodDeclarationProposal) never calls CompletionProposal.getCompletion().
2. Even if it did call CompletionProposal.getCompletion(), the code to build the list of parameters is dead. I can only find three assignments to updateCompletion and they all set it to false...

i.e.
	private boolean updateCompletion = false;

	public String getCompletion() {
		if (this.completionKind == METHOD_DECLARATION) {
			this.findParameterNames(null);
			if (this.updateCompletion) {
				this.updateCompletion = false;


... so everything in this if is dead... and then a little later on in the same method...
		} else if (this.completionKind == METHOD_REF) {
			this.findParameterNames(null);
			if (this.updateCompletion) {
				this.updateCompletion = false;

...and everything here is dead too.

Just so happens the dead code builds the parameter list.

Should I be using something else instead? If so what? Seems rather inconvenient that I can't use this code to build the parameter list for code completion if this is by design.

Thanks in advance.

- Carl.
Previous Topic:[BUILD] S-3.0M4-201012120842
Next Topic:[SOLVED]: LabelProvider not working in exported plugin...
Goto Forum:
  


Current Time: Fri Oct 24 08:52:04 GMT 2014

Powered by FUDForum. Page generated in 0.01767 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software