If you're using PHPStructuredEditor you can probably use
org.eclipse.wst.sse.ui.semanticHighlighting extension point to add your own semantic highlighting (mark
oocrrences) in the editor.
See this example in org.eclipse.php.ui:
From: dltk-dev-bounces@xxxxxxxxxxx [mailto:dltk-dev-bounces@xxxxxxxxxxx]
On Behalf Of Robert Gr?ndler
Sent: Monday, January 09, 2012 10:44 AM
To: DLTK Developer Discussions
Subject: Re: [Dltk-dev] Multiple languages in a single Scriptproject
thanks for the explanation. I've tried already to add a higher priority to my language and then return my editor id,
but this screwed up the PHP editor. I get a lot of PHP NPEs when doing this, already during "PHP Tooling Initialization".
The thing is that the twig editor is working just fine by providing an org.eclipse.wst.sse.ui.editorConfiguration for my content-type,
which allows me to provide custom syntax coloring, codeassist, outline and folding.
What i tried to add is a "Mark occurrences" feature, which apparently is done in the Editor class itself. Is
this the only way to implement this feature? If there's another possibility i could simply use the editorConfiguration point
and don't override the PHPStructuredEditor at all.
On Mon, Jan 9, 2012 at 5:39 AM, Andrey Sobolev <andrey.sobolev@xxxxxxxxx> wrote:
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.
On 09.01.2012 04:06, Robert Gründler wrote:
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?
ps: here's the relevant parts of the plugin.xml:
<!-- the project nature -->
dltk-dev mailing list
dltk-dev mailing list
phone +43 676 64 57 240