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

References support for text node #1432

Merged
merged 1 commit into from
Jan 3, 2023
Merged

Conversation

angelozerr
Copy link
Contributor

References support for text node

Signed-off-by: azerr azerr@redhat.com

@angelozerr
Copy link
Contributor Author

angelozerr commented Jan 3, 2023

Given this web.xml:

<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
  version="3.1">
  <servlet>
    <servlet-name>comingsoon</servlet-name>
    <servlet-class>mysite.server.ComingSoonServlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>comingsoon</servlet-name>
    <url-pattern>/*</url-pattern>
  </servlet-mapping>
</web-app>

If you declare this settings:

"xml.references": [
  {
    "pattern": "**/web.xml",
    "expressions": [
      {
        "from": "servlet-mapping/servlet-name/text()",
        "to": "servlet/servlet-name/text()"
      }
    ]
  }
]

You shoud benefit with references for servlet-name:

WebReferenceDemo

@angelozerr angelozerr marked this pull request as ready for review January 3, 2023 13:58
@angelozerr
Copy link
Contributor Author

The PR can be reviewed now, the code should be cleaned and I have written some tests.

Copy link
Contributor

@JessicaJHee JessicaJHee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works very well on my end!

Signed-off-by: azerr <azerr@redhat.com>
Copy link
Contributor

@datho7561 datho7561 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works well for me, and the code looks good. Thanks, Angelo!

@datho7561 datho7561 added enhancement New feature or request references labels Jan 3, 2023
@datho7561 datho7561 added this to the 0.24.0 milestone Jan 3, 2023
@datho7561 datho7561 merged commit 3a25dad into eclipse:main Jan 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request references
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants