Atm, I really see the Point what Geertjan said. After rethinking of what Vue 
really is, I created another ticket Long ago, which is not belongs to that 
Problem, but with some missing requirements what Geertjan wanted: 
https://issues.apache.org/jira/browse/NETBEANS-504 Just added some minutes ago. 
But again, not related to that Problem here.

I understand the Thing with +html is not working out of the box and out of the 
world but if you followed my discussion, I thought it will be handled like 
other mixed mimetypes like with +JavaScript and +x-json etc. Atm I’m fine to 
Change the ticket to Major and will think About what is a better Approach for 
that.

In General, there is a bug that I encountered and it should be fixed 
anyway/anyhow. Thx Jan to had a look into it.


Cheers

Chris



Von: Jan Lahoda
Gesendet: Mittwoch, 16. Januar 2019 18:36
An: [email protected]
Betreff: Re: SOE for embeding JS provider

Well, here is what I think happens:
JsEmbeddingProvider calls:
WebUtils.getResultIterator(resultIterator, "text/html")
to find the HTML part of the given code. But (inside of that), it does:
if (ri.getSnapshot().getMimeType().equals(mimetype)) {
but the top-level mimetype (ri.getSnapshot().getMimeType()) is
(unsurprisingly) "text/vue+html", which obviously does not match
"text/html", so it tries to find "text/html" in embeddings, which will in
turn call JsEmbeddingProvider, etc.

So roughly/probably what is needed is to allow "text/vue+html" to be
accepted as "text/html". I guess there are many ways to do it, one of them
would be to replace the "if" above with something like:
        MimePath topLevelPath = ri.getSnapshot().getMimePath();
        String generalized = topLevelPath.getInheritedType();
        if (generalized == null || "".equals(generalized)) {
            generalized = topLevelPath.getPath();
        }
        if (generalized.equals(mimetype)) {

But not an expert in the WebUtils stuff, and I probably don't have time to
investigate very deeply. Might also be needed on the other place that
compares mimetypes. But with this, I got the syntax highlighting working,
but not HTML code completion, which is suspicious.

(I suspect a more proactive approach might be needed - if something does
not work, put a breakpoint at an interesting place and see what happens.)

Jan


On Wed, Jan 16, 2019 at 5:07 PM Christian Lenz <[email protected]>
wrote:

> Hi,
>
> please have a look into this ticket. I got several SOE, when I create a
> new filetype which is text/vue+html or text/whatever+html.
> https://issues.apache.org/jira/browse/NETBEANS-88  Unfortunately, I don’t
> have much experience with that Code so a more advanced dev should have a
> look into this. Thx.
>
>
> Cheers
>
> Chris
>

Reply via email to