Enabling Template repositories by default?

Could we enable this setting by default?

Why?

I started fiddling with bndtools templates… and I couldn’t get it to show up in "File / New / Bnd Osgi Project"

until I found the sentence on this site that an option needs to be enabled and the a “Eclipse restart is needed”:

So open “Window/Preferences/Bndtools/Repositories”, “Enable templates repositories” and restart Eclipse3.

Only then the template shows up:

For further references: I found the following other pages with info about templates:

Ah damn, I was wrong with my interpretation.
The problem is not that the setting is disabled.

The problem seems that project templates in the workspace are only indexed when Eclipse is restarted / starts. In other words: When you create a new template project, you need to restart eclipse to use it.

I think the logic is in org.bndtools.core.templating.repobased.ReposTemplateLoader.findTemplates(String, Reporter) which is only triggered at eclipse startup. But maybe needs to be triggered when

  • a new template project is created
  • or when the "File / New / Bnd Osgi Project" wizard is opened.

This is new. Usually you could see the result of any changes to a template in your Workspace immediately.

Changes yes.

But if you create a new project template, it is only visible after Eclipse restart.

Maybe it is that bndtools.central.EclipseWorkspaceRepository.initialize(Workspace) is just called once on Startup.

And

private static final Supplier<EclipseWorkspaceRepository>	eclipseWorkspaceRepository	= Memoize
		.supplier(EclipseWorkspaceRepository::new);

in Central never gets refreshed.

I created PR fix new project templates not showing up by chrisrueger · Pull Request #6191 · bndtools/bnd · GitHub