Skip to content
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

Allow completion participants to suggest completion items inside CDATA blocks #1625

Open
pablocabrera85 opened this issue Feb 8, 2024 · 0 comments

Comments

@pablocabrera85
Copy link

In a recent project I worked at, we implemented a generic support for embedded languages inside XML files. All our embedded languages lived inside CDATA blocks.

In the following example, we could delegate to another extension the calculation of autocomplete options for the java script block:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
 <head>
 <title>XHTML 1.0 Strict Example</title>
 <script type="application/javascript">
 <![CDATA[
 function loadpdf() {
    document.getElementById("pdf-object").src="http://www.w3.org/TR/xhtml1/xhtml1.pdf";
 }
 ]]>
 </script>
 </head>
 <body onload="loadpdf()">
 </body>
</html>

In the future this functionality could be extended to other parts of the API, as we could for example want to find the references of the loadpdf() function and for that we would need to be able to send the corresponding request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant