Hi Robert,
Actually DLTK doesn't support multiple script languages per project.
Most of language detections are performed using project, so first
nature specified in project are used.
There was a lot of discussions about how to support multiple
languages in one project.
And actually we are not started any work on this topic.
Right now contributing of few script natures in same project will
lead to model contained both languages.
So solve editor opening issue please do following:
Since DLTL open utility uses org.eclipse.dltk.ui.language extension
to look for appropriate editor.
You need to contribute one for php nature with a bigger priority and
override method IDLTKUILanguageToolkit.getEditorId().
So DLTK will open file in correct editor using returned editor id.
Also it probable will be required to override some other php
extensions in same manner.
Best regards,
Andrey Sobolev.
On 09.01.2012 04:06, Robert Gründler wrote:
Hi,
my plugin contributes a content-type which is based on the php
content type. It also contributes a Nature and a Language, which
refer to that content-type.
My problem is, that when i double click a file of that language,
the PHP editor is opened instead of my contributed editor.
It seems it recognizes my content-type, but associates it with the
base content-type (PHP) instead of mine.
How does DLTK determine the correct language for a specific file
extension?
regards
-robert
ps: here's the relevant parts of the plugin.xml:
<extension
point="org.eclipse.core.contenttype.contentTypes">
<content-type
base-type="org.eclipse.php.core.phpsource"
file-extensions="twig"
id="twigtemplate"
name="Twig Template"
priority="high">
</content-type>
</extension>
<!-- the project nature -->
<extension
id="TwigNature"
name="Twig"
point="org.eclipse.core.resources.natures">
<runtime>
<run
class="com.dubture.twig.core.TwigNature"></run>
</runtime>
<content-type
id="com.dubture.twig.core.twigtemplate">
</content-type>
</extension>
<extension point="org.eclipse.dltk.core.language">
<language
class="com.dubture.twig.core.TwigLanguageToolkit"
nature="com.dubture.twig.core.TwigNature"
priority="10">
</language>
</extension>
_______________________________________________
dltk-dev mailing list
dltk-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dltk-dev
|