[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [imp-dev] "Interesting" case of dynamic language registration

Hi,

Been thinking. We might add an extension point to the UniversalEditor,
which runs a bunch of registered Runnables just after the
languageDescriptions have been loaded. This way I could register
languages "in code" before UniversalEditor starts asking for them, and
after the Workbench has started such that Eclipse won't complain...

Thoughts?

Cheers,

Jurgen

On Thu, Dec 2, 2010 at 9:53 PM, Jurgen Vinju <Jurgen.Vinju@xxxxxx> wrote:
> Hi,
>
> I'm using LanguageRegistry.registerLanguage(...) to dynamically extend
> Eclipse with editors for new languages. The extension points of such
> languages are implemented by some "multiplexing" instances of the IMP
> services that dynamically find the right implementation for each
> editor, based on the language name and some lookup table. These
> implementations are provided by Rascal programs.
>
> So far so good ;-) This all works fine when you're running Eclipse and
> you don't quit it.
>
> Now when I quit Eclipse and start it up again, the editors for those
> dynamically registered languages might still be there. However, since
> their language is not registered by an IMP extension point, there is
> no language registered for those editors and NullPointerExceptions
> start jumping at you from all parts of the UniversalEditor :-(
>
> The question is: where would you add some code that can re-register
> those languages, just in time before the UniversalEditors that are
> still open will start complaining about missing languages? I don't
> think there is a default Eclipse way to do it, and UniversalEditor
> does not provide a service for it either. Your advice is much
> appreciated. (I really can't/shouldn't/won't add extension points for
> those languages). Is there a simple solution?
>
> Cheers,
>
> Jurgen
>
> --
> Jurgen Vinju
> - Centrum Wiskunde & Informatica - SEN1
> - INRIA Lille - ATEAMS
> - Universiteit van Amsterdam
>
>   www: http://jurgen.vinju.org,
> http://www.rascal-mpl.nl,http://twitter.com/jurgenvinju
> skype: jurgen.vinju
>



-- 
Jurgen Vinju
- Centrum Wiskunde & Informatica - SEN1
- INRIA Lille - ATEAMS
- Universiteit van Amsterdam

  www: http://jurgen.vinju.org,
http://www.rascal-mpl.nl,http://twitter.com/jurgenvinju
skype: jurgen.vinju