uid / collabode

collab + code = collabode
http://groups.csail.mit.edu/uid/collabode/
Other
28 stars 8 forks source link

Code complete: method declaration proposals not handled #62

Open maxg opened 12 years ago

maxg commented 12 years ago

Fails due to a bad cast: org.eclipse.jdt.internal.ui.text.java.MethodDeclarationCompletionProposal cannot be cast to collabode.complete.ProposalHolder.

maxg commented 12 years ago

CompletionProposalCollector.accept calls acceptPotentialMethodDeclaration which calls evaluateProposals methods that add directly to the proposals list, bypassing our JavaPadCompletionProposalCollector.createJavaCompletionProposal. This could be handled by checking for non-ProposalHolders in getSortedJavaPadCompletionProposals and wrapping them.

This is not sufficient, however, because getReplacementString on JavaTypeCompletionProposals initially returns the empty string! The actual replacement is computed in updateReplacementString, called by apply.

These proposals might also trigger imports; the best solution would be to have the client's selection of a proposal trigger a server-side application that generates a TextEdit we can send back to the client, as with organize imports.