[Geoserver-devel] Clumsy clumsy SLD autocomplete: worth it?

Hi,
I was looking at this demo of XML autocomplete in the CodeMirror web site:

https://codemirror.net/demo/xmlcomplete.html

… and well, of course, wanted to see what it could do for SLD, since there is still a lot of people
hand editing it. The system requires a JSON structure representing the schema, and there is a
windows only tool that can take a XSD in and generate such structure in output:
http://q42jaap.github.io/xsd2codemirror/

So I gave it a kick and came out with the following branch:

https://github.com/aaime/geoserver/tree/sld10-hint

Things I’ve discovered while playing with it:

  • The tooling is completely namespace unaware, so the completion I managed to put toghether works under the assumpion that sld elements are not prefixed, the filter ones are prefixed by “ogc”, and the gml ones by “gml”
  • The XSD to JSON tool is limited, has a not so useful notion of namespaces and no idea about substitution groups, so the JSON must be hand-tweaked after generation (5-10 minutes of search and replace like a madman put the JSON structure in some usable state)
  • The CSSParameter name attribute values are not really listed in the schema, so no completion for those (but we could add them manually, lumping toghether all possible values for all symbolizers)
  • GeoServer style handling has no distinction between SLD 1.0 and SLD 1.1/SE 1.1, so an eventual completion should try to support both at the same time (maybe, in a simple way, e.g. inspect the first element and see what namespaces are in use, and then decide which set of tags to use
    Here is a screenshot showing the completion in action:

completion.png

And a video too (a clumsy video for a clumsy implementation):

https://drive.google.com/open?id=18qgvEhhh8ijcdTjPkDOoVNICeu14S_F1

So a few questions for you:

  • Given the current limitations of the current approach, would you suggest to merge it anyways, would you find it useful?
  • Is there any javascript wiz interested in improving what I’ve got so far, to make it more useful?
    Cheers

Andrea

···

GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information. == Ing. Andrea Aime @geowolf Technical Lead GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa (LU) phone: +39 0584 962313 fax: +39 0584 1660272 mob: +39 339 8844549 http://www.geo-solutions.it http://twitter.com/geosolutions_it ------------------------------------------------------- Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia. This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail.

Hi Andrea,
my feedback bellow:

In your video looks like you are able to auto-comple some ogc:PropertyName tag, maybe I missed something. I would say +0 here. Thanks for this investigation :slight_smile: Cheers, Nuno Oliveira

(attachments)

completion.png

···

On 09/23/2018 03:00 PM, Andrea Aime wrote:

Hi,
I was looking at this demo of XML autocomplete in the CodeMirror web site:

https://codemirror.net/demo/xmlcomplete.html

… and well, of course, wanted to see what it could do for SLD, since there is still a lot of people
hand editing it. The system requires a JSON structure representing the schema, and there is a
windows only tool that can take a XSD in and generate such structure in output:
http://q42jaap.github.io/xsd2codemirror/

So I gave it a kick and came out with the following branch:

https://github.com/aaime/geoserver/tree/sld10-hint

Things I’ve discovered while playing with it:

  • The tooling is completely namespace unaware, so the completion I managed to put toghether works under the assumpion that sld elements are not prefixed, the filter ones are prefixed by “ogc”, and the gml ones by “gml”
  • The XSD to JSON tool is limited, has a not so useful notion of namespaces and no idea about substitution groups, so the JSON must be hand-tweaked after generation (5-10 minutes of search and replace like a madman put the JSON structure in some usable state)
  • The CSSParameter name attribute values are not really listed in the schema, so no completion for those (but we could add them manually, lumping toghether all possible values for all symbolizers)
  • GeoServer style handling has no distinction between SLD 1.0 and SLD 1.1/SE 1.1, so an eventual completion should try to support both at the same time (maybe, in a simple way, e.g. inspect the first element and see what namespaces are in use, and then decide which set of tags to use
    Here is a screenshot showing the completion in action:

completion.png

And a video too (a clumsy video for a clumsy implementation):

https://drive.google.com/open?id=18qgvEhhh8ijcdTjPkDOoVNICeu14S_F1

So a few questions for you:

  • Given the current limitations of the current approach, would you suggest to merge it anyways, would you find it useful?
  • Is there any javascript wiz interested in improving what I’ve got so far, to make it more useful?
    Cheers

Andrea

GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information. == Ing. Andrea Aime @geowolf Technical Lead GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa (LU) phone: +39 0584 962313 fax: +39 0584 1660272 mob: +39 339 8844549 http://www.geo-solutions.it http://twitter.com/geosolutions_it ------------------------------------------------------- Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia. This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail.

_______________________________________________
Geoserver-devel mailing list
[Geoserver-devel@lists.sourceforge.net](mailto:Geoserver-devel@lists.sourceforge.net)
[https://lists.sourceforge.net/lists/listinfo/geoserver-devel](https://lists.sourceforge.net/lists/listinfo/geoserver-devel)

-- 
Regards,
Nuno Oliveira
==
GeoServer Professional Services from the experts! 
Visit [http://goo.gl/it488V](http://goo.gl/it488V) for more information.
==

Nuno Miguel Carvalho Oliveira
@nmcoliveira
Software Engineer

GeoSolutions S.A.S.
Via di Montramito 3/A
55054  Massarosa (LU)
Italy
phone: +39 0584 962313
fax:      +39 0584 1660272

[http://www.geo-solutions.it](http://www.geo-solutions.it)
[http://twitter.com/geosolutions_it](http://twitter.com/geosolutions_it)

-------------------------------------------------------

Con riferimento alla normativa sul trattamento dei dati 
personali (Reg. UE 2016/679 - Regolamento generale sulla 
protezione dei dati “GDPR”), si precisa che ogni 
circostanza inerente alla presente email (il suo contenuto, 
gli eventuali allegati, etc.) è un dato la cui conoscenza 
è riservata al/i solo/i destinatario/i indicati dallo 
scrivente. Se il messaggio Le è giunto per errore, è 
tenuta/o a cancellarlo, ogni altra operazione è illecita. 
Le sarei comunque grato se potesse darmene notizia.

This email is intended only for the person or entity to 
which it is addressed and may contain information that 
is privileged, confidential or otherwise protected from 
disclosure. We remind that - as provided by European 
Regulation 2016/679 “GDPR” - copying, dissemination or 
use of this e-mail or the information herein by anyone 
other than the intended recipient is prohibited. If you 
have received this email by mistake, please notify 
us immediately by telephone or e-mail.

On Mon, Sep 24, 2018 at 7:25 PM Nuno Oliveira <nuno.oliveira@anonymised.com> wrote:

In your video looks like you are able to auto-comple some ogc:PropertyName tag, maybe I missed something.

Yes, I could, and also autocomplete a stroke element too. But say that one called “foo” the filter 1.0, namespace,
then completion would not work, it would not complete foo:PropertyName, but it’s stuck to ogc:PropertyName.
In other words, it’s completing static words, does not have any namespace intelligence.

Cheers
Andrea

==

GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information. == Ing. Andrea Aime @geowolf Technical Lead GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa (LU) phone: +39 0584 962313 fax: +39 0584 1660272 mob: +39 339 8844549 http://www.geo-solutions.it http://twitter.com/geosolutions_it ------------------------------------------------------- Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia. This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail.

(attachments)

completion.png

Understood, thanks !

···

On 09/24/2018 06:39 PM, Andrea Aime wrote:

On Mon, Sep 24, 2018 at 7:25 PM Nuno Oliveira <nuno.oliveira@anonymised.com> wrote:

In your video looks like you are able to auto-comple some ogc:PropertyName tag, maybe I missed something.

Yes, I could, and also autocomplete a stroke element too. But say that one called “foo” the filter 1.0, namespace,
then completion would not work, it would not complete foo:PropertyName, but it’s stuck to ogc:PropertyName.
In other words, it’s completing static words, does not have any namespace intelligence.

Cheers
Andrea

==

GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information. == Ing. Andrea Aime @geowolf Technical Lead GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa (LU) phone: +39 0584 962313 fax: +39 0584 1660272 mob: +39 339 8844549 http://www.geo-solutions.it http://twitter.com/geosolutions_it ------------------------------------------------------- Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia. This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail.

-- 
Regards,
Nuno Oliveira
==
GeoServer Professional Services from the experts! 
Visit [http://goo.gl/it488V](http://goo.gl/it488V) for more information.
==

Nuno Miguel Carvalho Oliveira
@nmcoliveira
Software Engineer

GeoSolutions S.A.S.
Via di Montramito 3/A
55054  Massarosa (LU)
Italy
phone: +39 0584 962313
fax:      +39 0584 1660272

[http://www.geo-solutions.it](http://www.geo-solutions.it)
[http://twitter.com/geosolutions_it](http://twitter.com/geosolutions_it)

-------------------------------------------------------

Con riferimento alla normativa sul trattamento dei dati 
personali (Reg. UE 2016/679 - Regolamento generale sulla 
protezione dei dati “GDPR”), si precisa che ogni 
circostanza inerente alla presente email (il suo contenuto, 
gli eventuali allegati, etc.) è un dato la cui conoscenza 
è riservata al/i solo/i destinatario/i indicati dallo 
scrivente. Se il messaggio Le è giunto per errore, è 
tenuta/o a cancellarlo, ogni altra operazione è illecita. 
Le sarei comunque grato se potesse darmene notizia.

This email is intended only for the person or entity to 
which it is addressed and may contain information that 
is privileged, confidential or otherwise protected from 
disclosure. We remind that - as provided by European 
Regulation 2016/679 “GDPR” - copying, dissemination or 
use of this e-mail or the information herein by anyone 
other than the intended recipient is prohibited. If you 
have received this email by mistake, please notify 
us immediately by telephone or e-mail.

I’ve pulled this down and tried it out a little.

Its certainly not perfect, and there is a lot of room for improvement, but I think it is a worthwhile addition. Even if one doesn’t use it, it doesn’t really get in the way.

There are a few initial improvements I can think of adding, mainly around when to show the hints (e.g. while backspacing an existing tag). I would be interested in making some of these improvements (I’m currently tinkering with a couple of them). The underlying JS appears to be pretty straightforward, so it should be readily modifiable.

I do think manually adding the the CSSParameter name attribute values would be a good idea.

Torben

On Sun, Sep 23, 2018 at 7:00 AM Andrea Aime <andrea.aime@anonymised.com> wrote:

Hi,
I was looking at this demo of XML autocomplete in the CodeMirror web site:

https://codemirror.net/demo/xmlcomplete.html

… and well, of course, wanted to see what it could do for SLD, since there is still a lot of people
hand editing it. The system requires a JSON structure representing the schema, and there is a
windows only tool that can take a XSD in and generate such structure in output:
http://q42jaap.github.io/xsd2codemirror/

So I gave it a kick and came out with the following branch:

https://github.com/aaime/geoserver/tree/sld10-hint

Things I’ve discovered while playing with it:

  • The tooling is completely namespace unaware, so the completion I managed to put toghether works under the assumpion that sld elements are not prefixed, the filter ones are prefixed by “ogc”, and the gml ones by “gml”
  • The XSD to JSON tool is limited, has a not so useful notion of namespaces and no idea about substitution groups, so the JSON must be hand-tweaked after generation (5-10 minutes of search and replace like a madman put the JSON structure in some usable state)
  • The CSSParameter name attribute values are not really listed in the schema, so no completion for those (but we could add them manually, lumping toghether all possible values for all symbolizers)
  • GeoServer style handling has no distinction between SLD 1.0 and SLD 1.1/SE 1.1, so an eventual completion should try to support both at the same time (maybe, in a simple way, e.g. inspect the first element and see what namespaces are in use, and then decide which set of tags to use
    Here is a screenshot showing the completion in action:

And a video too (a clumsy video for a clumsy implementation):

https://drive.google.com/open?id=18qgvEhhh8ijcdTjPkDOoVNICeu14S_F1

So a few questions for you:

  • Given the current limitations of the current approach, would you suggest to merge it anyways, would you find it useful?
  • Is there any javascript wiz interested in improving what I’ve got so far, to make it more useful?
    Cheers

Andrea

GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information. == Ing. Andrea Aime @geowolf Technical Lead GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa (LU) phone: +39 0584 962313 fax: +39 0584 1660272 mob: +39 339 8844549 http://www.geo-solutions.it http://twitter.com/geosolutions_it ------------------------------------------------------- Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia. This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail.


Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

I’ve pulled this down and tried it out a little.

Its certainly not perfect, and there is a lot of room for improvement, but I think it is a worthwhile addition. Even if one doesn’t use it, it doesn’t really get in the way.

There are a few initial improvements I can think of adding, mainly around when to show the hints (e.g. while backspacing an existing tag). I would be interested in making some of these improvements (I’m currently tinkering with a couple of them). The underlying JS appears to be pretty straightforward, so it should be readily modifiable.

Awesome. Should I push it to a branch on GeoServer, so that we’re both able to commit directly on it?

I do think manually adding the the CSSParameter name attribute values would be a good idea.

I’ll look into that, as well as prepping the JSON structure for SE 1.1

Cheers
Andrea

···

Regards, Andrea Aime == GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information. == Ing. Andrea Aime @geowolf Technical Lead GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa (LU) phone: +39 0584 962313 fax: +39 0584 1660272 mob: +39 339 8844549 http://www.geo-solutions.it http://twitter.com/geosolutions_it ------------------------------------------------------- Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia. This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail.

On Mon, Sep 24, 2018 at 11:37 PM Andrea Aime <andrea.aime@anonymised.com> wrote:

On Mon, Sep 24, 2018 at 10:53 PM Torben Barsballe <tbarsballe@anonymised.com> wrote:

I’ve pulled this down and tried it out a little.

Its certainly not perfect, and there is a lot of room for improvement, but I think it is a worthwhile addition. Even if one doesn’t use it, it doesn’t really get in the way.

There are a few initial improvements I can think of adding, mainly around when to show the hints (e.g. while backspacing an existing tag). I would be interested in making some of these improvements (I’m currently tinkering with a couple of them). The underlying JS appears to be pretty straightforward, so it should be readily modifiable.

Awesome. Should I push it to a branch on GeoServer, so that we’re both able to commit directly on it?

Yes, that sounds good. Thanks!

Torben

I do think manually adding the the CSSParameter name attribute values would be a good idea.

I’ll look into that, as well as prepping the JSON structure for SE 1.1

Cheers
Andrea

Regards, Andrea Aime == GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information. == Ing. Andrea Aime @geowolf Technical Lead GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa (LU) phone: +39 0584 962313 fax: +39 0584 1660272 mob: +39 339 8844549 http://www.geo-solutions.it http://twitter.com/geosolutions_it ------------------------------------------------------- Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia. This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail.

There you go: https://github.com/geoserver/geoserver/tree/sld10-hint

Cheers
Andrea

···

GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information. == Ing. Andrea Aime @geowolf Technical Lead GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa (LU) phone: +39 0584 962313 fax: +39 0584 1660272 mob: +39 339 8844549 http://www.geo-solutions.it http://twitter.com/geosolutions_it ------------------------------------------------------- Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia. This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail.

I’ve pushed up some potential improvements to how the autocomplete triggers.

Rather than trigger after certain keypresses, autocomplete will now check after any keypress (I have included a blacklist, so we can exclude any keys as needed). To make this actually useful, I’ve added some additional checks based on the cursor position so it will only show the autocomplete menu if it would be useful to do so, in particular:

  • If the cursor is currently on an empty line
  • If the cursor is currently in a tag, and either at the end of the tag name or at the end of an attribute

Feel free to try it out and see what you think. I think it makes it a little less clunky, without being too naggy.

Torben

On Tue, Sep 25, 2018 at 9:21 AM Andrea Aime <andrea.aime@anonymised.com> wrote:

On Tue, Sep 25, 2018 at 6:08 PM Torben Barsballe <tbarsballe@anonymised.com> wrote:

Awesome. Should I push it to a branch on GeoServer, so that we’re both able to commit directly on it?

Yes, that sounds good. Thanks!

There you go: https://github.com/geoserver/geoserver/tree/sld10-hint

Cheers
Andrea

==

GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information. == Ing. Andrea Aime @geowolf Technical Lead GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa (LU) phone: +39 0584 962313 fax: +39 0584 1660272 mob: +39 339 8844549 http://www.geo-solutions.it http://twitter.com/geosolutions_it ------------------------------------------------------- Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia. This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail.

Hi Torben,
yep, completion seems to flow better indeed.

I’ve added a new commit as well, it contains the list of CSSParameter possible values, as
well as making the completion prefix independent, e.g., one can now call the sld prefix “foo”
and the filter one “bar” and it should work anyways.
However, reminder that in is I’m a “noob on the loose” so some review of the code I wrote is warmly welcomed.

I believe the completion could work better in a couple of cases:

  • If the element being completed has no attributes, complete it “closing” it (e.g. do not complete “<Stroke” but “”, while keeping “<CSSParameter” or “<ExternalGraphic” as is)
  • When adding the closing tag it should be obvious which tag should be completed when “/” is pressed, complete directly without proposing alternatives in that case
    Also, we could have completion support for SLD 1.1 as well. I’m going to have a look at these topics and report back.

Cheers

Andrea

···

Regards, Andrea Aime == GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information. == Ing. Andrea Aime @geowolf Technical Lead GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa (LU) phone: +39 0584 962313 fax: +39 0584 1660272 mob: +39 339 8844549 http://www.geo-solutions.it http://twitter.com/geosolutions_it ------------------------------------------------------- Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia. This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail.

Okay, I did a quick review:

The CSSParameter additions look good.

With regards to the parameter replacement - I think there’s probably a more concise way of doing that, but I don’t know what it might be, and what you have there does seem to be both stable and ultimately correct.I did find one issue - if you have a new or empty file, the namespace substitution code throws an error, causing all autocompletion to fail. I have pushed a fix.
Other than that, the actual functionality seems great.

One other thing I did notice was a “test.js” file was added, which appears to be a duplicate of the tags - this seems like it is a temporary/“backup” file, and should eventually be removed?

I believe the completion could work better in a couple of cases:

  • If the element being completed has no attributes, complete it “closing” it (e.g. do not complete “<Stroke” but “”, while keeping “<CSSParameter” or “<ExternalGraphic” as is)
  • When adding the closing tag it should be obvious which tag should be completed when “/” is pressed, complete directly without proposing alternatives in that case

While I was taking a look at your changes, I also took a quick look at these two as well and have pushed a couple of commits that add these capabilities.
I’ve pushed all my changes. Seems like we might be getting close to something that is mergeable, or at least ready for a 3rd-party review/PR.

Torben

Also, we could have completion support for SLD 1.1 as well. I’m going to have a look at these topics and report back.

Cheers

Andrea

On Wed, Sep 26, 2018 at 1:30 AM Torben Barsballe <tbarsballe@anonymised.com> wrote:

I’ve pushed up some potential improvements to how the autocomplete triggers.

Rather than trigger after certain keypresses, autocomplete will now check after any keypress (I have included a blacklist, so we can exclude any keys as needed). To make this actually useful, I’ve added some additional checks based on the cursor position so it will only show the autocomplete menu if it would be useful to do so, in particular:

  • If the cursor is currently on an empty line
  • If the cursor is currently in a tag, and either at the end of the tag name or at the end of an attribute

Feel free to try it out and see what you think. I think it makes it a little less clunky, without being too naggy.

Torben

On Tue, Sep 25, 2018 at 9:21 AM Andrea Aime <andrea.aime@anonymised.com> wrote:

On Tue, Sep 25, 2018 at 6:08 PM Torben Barsballe <tbarsballe@anonymised.com> wrote:

Awesome. Should I push it to a branch on GeoServer, so that we’re both able to commit directly on it?

Yes, that sounds good. Thanks!

There you go: https://github.com/geoserver/geoserver/tree/sld10-hint

Cheers
Andrea

==

GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information. == Ing. Andrea Aime @geowolf Technical Lead GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa (LU) phone: +39 0584 962313 fax: +39 0584 1660272 mob: +39 339 8844549 http://www.geo-solutions.it http://twitter.com/geosolutions_it ------------------------------------------------------- Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia. This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail.

Regards, Andrea Aime == GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information. == Ing. Andrea Aime @geowolf Technical Lead GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa (LU) phone: +39 0584 962313 fax: +39 0584 1660272 mob: +39 339 8844549 http://www.geo-solutions.it http://twitter.com/geosolutions_it ------------------------------------------------------- Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia. This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail.

With regards to the parameter replacement - I think there’s probably a more concise way of doing that, but I don’t know what it might be, and what you have there does seem to be both stable and ultimately correct.

Eh, I thought the same, there should be some elegant JS way to proxy a JSON object in order to override (and rename on the fly) access to keys… but it’s a bit out of my league,
wouldn’t know where to start :-p

I did find one issue - if you have a new or empty file, the namespace substitution code throws an error, causing all autocompletion to fail. I have pushed a fix.
Other than that, the actual functionality seems great.

Awesome, thanks for the fix!

One other thing I did notice was a “test.js” file was added, which appears to be a duplicate of the tags - this seems like it is a temporary/“backup” file, and should eventually be removed?

Yep, I’ll have a look at it.

I believe the completion could work better in a couple of cases:

  • If the element being completed has no attributes, complete it “closing” it (e.g. do not complete “<Stroke” but “”, while keeping “<CSSParameter” or “<ExternalGraphic” as is)
  • When adding the closing tag it should be obvious which tag should be completed when “/” is pressed, complete directly without proposing alternatives in that case

While I was taking a look at your changes, I also took a quick look at these two as well and have pushed a couple of commits that add these capabilities.
I’ve pushed all my changes. Seems like we might be getting close to something that is mergeable, or at least ready for a 3rd-party review/PR.

Great. I’ll try it out during the weekend and if everything looks good, I’ll try to prepare the completion data structure for SLD 1.1 too.
Then indeed it will probably be time to make a PR.

Cheers
Andrea

···

GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information. == Ing. Andrea Aime @geowolf Technical Lead GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa (LU) phone: +39 0584 962313 fax: +39 0584 1660272 mob: +39 339 8844549 http://www.geo-solutions.it http://twitter.com/geosolutions_it ------------------------------------------------------- Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia. This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail.