Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [imp-dev] createPartControl() needs refactoring and IMP services need to be added to ServiceFactory.

Jurgen Vinju wrote:
Hi guys,

We need to split up createPartControl() in UniversalEditor into
smaller methods, and remove all superfluous comments.
It's very hard to understand what's going on in this method, it only
works by assuming that groups of
statements marked by // comments or grouped in a { } block have no
effect on other parts of the method.
[this goes for more methods in the UE, but this one is very big].

We're actually actively working on this very thing right now, in order to allow IMP to be used with editors other than the UniversalEditor. So far, I've done
the following (not yet checked in):

- Pulled the ParserScheduler out of the UniversalEditor, and removed the
  dependency on it.
- Created a class to manage the references to all the language service
  implementations, and have the UniversalEditor's createPartControl()
  use that.
- Made it so that some of the annotation-related logic is performed by
  an ordinary IModelListener, rather than unsightly appendages within
  the ParserScheduler.
- Enhanced IMessageHandler with a new method clearMessages(),
  which is called before any messages get issued in a given "parsing
  session".
- Encapsulate the instantiation of the various "service controllers"
  (the things that sit between Eclipse and the language-specific
  service implementations), so that the corresponding logic can
  be substituted (again, for interoperability with other editors).

Anyway, I propose to extractMethod in the following way:
  - find groups of statements marked by { } or //
  - use 'extract method' on these groups.
  - until the whole method contains only method calls.

I could do it in some spare time if you like.

Another thing I noticed is that the new editor services are not using
the ServiceFactory. All IMP services should
be retrieved using the ServiceFactory interface, such that their
implementation does not necessarily have to come
from extension points in the future). Can you adapt this Stan?

Good point. Stan, can you take care of this?

--
Cheers,
 -- Bob

--------------------------------
Robert M. Fuhrer
Research Staff Member
Programming Technologies Dept.
IBM T.J. Watson Research Center

IMP Team Lead (http://eclipse-imp.sourceforge.net)
X10: Productivity for High-Performance Parallel Programming (http://x10.sf.net)




Back to the top