You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@netbeans.apache.org by Christian Lenz <ch...@gmx.net> on 2019/01/16 16:07:24 UTC

SOE for embeding JS provider

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

AW: SOE for embeding JS provider

Posted by Christian Lenz <ch...@gmx.net>.
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: dev@netbeans.incubator.apache.org
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 <ch...@gmx.net>
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
>


Re: SOE for embeding JS provider

Posted by Emilian Bold <em...@gmail.com>.
Just a tangential note here. I always found the NetBeans concept of
mime paths amazing and quite elegant in allowing embedded languages. I
don't even know if newer approaches like Language Server Protocol
support something like this.

--emi

http://coolbeans.xyz/ - CoolBeans: An IDE for Java, JavaEE, PHP and more!

On Wed, Jan 16, 2019 at 7:36 PM Jan Lahoda <la...@gmail.com> wrote:
>
> 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 <ch...@gmx.net>
> 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
> >

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.incubator.apache.org
For additional commands, e-mail: dev-help@netbeans.incubator.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: SOE for embeding JS provider

Posted by Jan Lahoda <la...@gmail.com>.
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 <ch...@gmx.net>
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
>

Re: SOE for embeding JS provider

Posted by Geertjan Wielenga <ge...@googlemail.com.INVALID>.
The real question here is how to support Vue files.

And the starting point here is to create requirements. Not going to assist
in providing support for something until it is fully defined what exactly
is needed.

Gj

On Wed, Jan 16, 2019 at 5:07 PM Christian Lenz <ch...@gmx.net>
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
>