[MonoDevelop] Technical discussion: Coding assistance (next step in code completion)

Lluis Sanchez lluis at ximian.com
Mon Jun 12 13:47:54 EDT 2006


El dg 11 de 06 del 2006 a les 15:19 +0200, en/na Matej Urbas va
escriure:
> Hi
> 
> I wanted to ask for opinions of developers on how we can integrate 
> coding assistance features such as:
> - snippets
> - autocompletion of expected code - like in the override operator, the 
> new operator
> - list of overloaded constructors, parameters of functions
> - automatic creation of getters/setters, methods. properties, fields, 
> events, delegates etc.
> - automatic interface/abstract methods implementation
> - refactoring?
> etc. etc.
> 
> Is there a nice and documented architecture which would allow language 
> bindings developers to add snippets (that are context based - available 
> only in special contexts), and which would allow language bindings to 
> tell the source editor when to trigger autocompletion of expected code 
> (and what to insert)? Is there a nice paradigm of how to add new code 
> assistance functionality in language bindings?
> 
> What I need are some hints in how you planned to extend current 
> functionality and what is it the current architecture allows. Where 
> should I focus my strengths on?
> 
> If there are some things lacking in the current architecture, I would be 
> glad to help in redesigning it (so that it would allow easy 
> extensibility in both language and functionality dimensions). Also, I 
> would very much like to see myself document it properly too...

There are several problems in the current architecture that should be
fixed. The decision about when triggering code completion is more or
less hard-coded in the editor. This might be easy to fix since the
editor already provides an extensibility mechanism which allows
triggering actions when some keys are pressed.

Another problem is deciding which information to show in the completion
list. Right now this decision is taken in CodeCompletionDataProvider
(from MonoDevelop.Projects.Gui.Completion). You'll see checks for
"using" and "is". This is C# specific code and should not be there. I
think language bindings should be able to set the
ICompletionDataProvider to be used by the editor, which right now is
hard-coded to CodeCompletionDataProvider. It doesn't mean replicating
all CodeCompletionDataProvider code in every binding. This class can be
kept in MonoDevelop.Projects.Gui.Completion, but removing
language-specific code. Then it can be used as a base class for
language-specific providers.

About refactoring, there are some basic operations in
MonoDevelop.Projects.CodeGeneration which can be used for implementing
several of the commands you propose.

I hope that helps.
Lluis.





More information about the Monodevelop-list mailing list