-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ICompletionParticipant#onXMLContent is not called for CDATA #1694
Comments
As we have no usecases with cdata completion , lemminx doent support that. If yiu need to support cdata completion, any contribution are welcome! |
As e.g.
is valid XML (even though unusual) where lemminx-maven would usually provide a completion for the version number (wich won't work also). I also added some debug information and the XML document gives me this:
so the CDATA section seem to be recognized correctly as a text node child, so maybe the autocompletion should simply accept text nodes as content? |
You are the first person who requires this cdata support. It would be nice to have that, but me I have no time to implement it but I will be happy to review your contribution. |
Indeed the xml parser convers that. You just need to use those information to support onCDATA with participant |
I'll try to take a look but as I'm not familiar with lemminx internals the "just" might become a more complicated (for me) ;-) |
I.will do my best to help you. |
I debugged a little bit and found that the tokentype is
should actually be
could probably already fix the issue... |
We have a lot of tests, so dont be shy to do a PR and breaks anything. We will see if it breaks existing tests. |
See eclipse-lemminx#1694 Signed-off-by: Christoph Läubrich <laeubi@laeubi-soft.de>
I now started with a first step by creating a testcase, it seems there is no "basic" test for the XML extension ("only" HTML variant) so I created a dedicated new test: |
See eclipse-lemminx#1694 Signed-off-by: Christoph Läubrich <laeubi@laeubi-soft.de>
Fix eclipse-lemminx#1694 Signed-off-by: Christoph Läubrich <laeubi@laeubi-soft.de>
Fixed with #1699 |
Thanks! After some struggling around I was able to finally test this: Peek.2024-11-07.15-58.mp4so it works like expected! Sadly it seem to mean that:
so a quite long path from now on until its fully available. May I ask if there is any plans for new lemminx release already? |
I think we can create a release of LemMinx but I don't know when. We need to find time to do that. |
Assume the following XML fragment:
if I place the cursor right after
<bnd>
(before the CDATA section) thenICompletionParticipant#onXMLContent
is called withcurrentTag=bnd
Now place the cursor inside the
now
onXMLContent
is not called. As CDATA only marks some parts of the document to contain any chardata it is still XML Content of the element, so I would have expected that the method is still called (maybe with currentTag=CDATA and parentTag=bnd).The text was updated successfully, but these errors were encountered: