Git Product home page Git Product logo

Comments (3)

angelozerr avatar angelozerr commented on September 22, 2024 1

'm not sure exactly when, so I guess we can leave this issue open for now.

Don't hesitate to ask me if you need some assistance. We have a lot of test with code action, it can be a good start to play with them and write some tests with your future feature.

from lemminx.

angelozerr avatar angelozerr commented on September 22, 2024

The basic idea of close tag action like you have debuged it is to insert the end tag according the fault tolerant parser which set following elements of an element which is not closed as children. You can see that in the outline:

image

In this case, I want to simply close out the start tag and produce an empty element: <webApplication ... .../>.
I don't want to include the other elements as content.

If I understand, you would like to have a new code action which inserts end tag just after the start tag. Are you interested to implement this kind of code action?

The Liberty Tools Lemminx extension works with server.xml, which is governed by an XSD (similar to this. I don't see this CloseTagCodeAction impl taking this into account either

Indeed close code action doesn't take care of XSD (in lemminx we call that CMDocument which is an abstract of XSD, DTD, RNG, etc), it could be nice to takes care of XSD.

In conclusion I think it could be nice to have:

  • startegy 1: a code action which insert after all children (like today)
  • startegy 2: a code action which insert teh end tag just after the start tag (your requirement)
  • if XML is mapped with a XSD, DTD, try to the proper startegy.

@scottkurz are you interested to work on it?

from lemminx.

scottkurz avatar scottkurz commented on September 22, 2024

The basic idea of close tag action like you have debuged it is to insert the end tag according the fault tolerant parser which set following elements of an element which is not closed as children. You can see that in the outline:

If I understand, you would like to have a new code action which inserts end tag just after the start tag. Are you interested to implement this kind of code action?

@scottkurz are you interested to work on it?

Thank you for your comment and reply. As a start, it's a big help just to hear you confirm I'm understanding this correctly and Lemminx isn't already (supposedly) doing this. I am interested in working on this though I'm not sure exactly when, so I guess we can leave this issue open for now.

In conclusion I think it could be nice to have:

* startegy 1: a code action which insert after all children (like today)

* startegy 2: a code action which insert teh end tag just after the start tag (your requirement)

* if XML is mapped with a XSD, DTD, try to the proper startegy.

Yeah, the last one sounds like to me like a whole other level of complexity, so I would try to start just with 'strategy 2' here. Thx again for your explanation.

from lemminx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.