Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-dev] Dynamic content type

Hi Jean-Francois,

You can implement a "describer" class which can check based on the content.

image.png

For example, check the org.eclipse.core.runtime.content.XMLRootElementContentDescriber2 class. PDE uses it to identify its content types.

Example from the PDE core plugin.xml
<content-type
            base-type="org.eclipse.core.runtime.xml"
            id="org.eclipse.pde.categoryManifest"
            name="%categoryManifestName"
            priority="high">
         <describer
               class="org.eclipse.core.runtime.content.XMLRootElementContentDescriber">
            <parameter
                  name="element"
                  value="site">
            </parameter>
         </describer>
      </content-type>

I hope this helps,

Best regards, Lars


On Mon, Feb 21, 2022 at 12:50 PM Jean-Francois Maury <jmaury@xxxxxxxxxx> wrote:
Hello,

I'm working on an LSP based editor for Qute files (Quarkus related templating engine).
The binding for editor is based on the content type but so I need to define a content type for Qute files.
Quarkus team said that a file is a Qute file should be based on context (eg Quarkus project) or content.
I can't find a way to assign a content type based on content or content but only on file name.
Is there a way to dynamically compute the content type or do you have any suggestions ?

Thanks


--

Jeff Maury

Manager, DevTools

Red Hat EMEA

jmaury@xxxxxxxxxx   

_______________________________________________
platform-dev mailing list
platform-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/platform-dev


--
Eclipse Platform project co-lead
CEO vogella GmbH

Haindaalwisch 17a, 22395 Hamburg
Amtsgericht Hamburg: HRB 127058
Geschäftsführer: Lars Vogel, Jennifer Nerlich de Vogel
USt-IdNr.: DE284122352
Fax (040) 5247 6322, Email: lars.vogel@xxxxxxxxxxx, Web: http://www.vogella.com

Back to the top