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

Comments throws off diagnostic (cvc-complex-type.2.3) mark onto the wrong location #1495

Closed
kathrynkodama opened this issue Feb 28, 2023 · 8 comments · Fixed by #1496
Closed
Assignees
Labels
bug Something isn't working validation XSD
Milestone

Comments

@kathrynkodama
Copy link

Adding text to an XML element and the diagnostic "Element 'server' cannot contain text content.
The content type is defined as element-only." is expected on the text. In the below screenshot, inserting a comment in between the text and the element, and the diagnostic range switches to the comment even though it is still expected on the text.

image

See OpenLiberty/liberty-language-server#163 for more details. Observed on server.xml and pom.xml files.

@angelozerr
Copy link
Contributor

@kathrynkodama could you share your xml please.

@kathrynkodama
Copy link
Author

<?xml version='1.0' encoding='utf-8'?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <!-- Comment -->
    test

    <groupId>io.openliberty.guides</groupId>
    <artifactId>guide-getting-started</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>war</packaging>

    <properties>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <!-- Liberty configuration -->
        <liberty.var.default.http.port>9080</liberty.var.default.http.port>
        <liberty.var.default.https.port>9443</liberty.var.default.https.port>
    </properties>

    <dependencies>
        <!-- Provided dependencies -->
        <dependency>
            <groupId>jakarta.platform</groupId>
            <artifactId>jakarta.jakartaee-api</artifactId>
            <version>9.1.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.eclipse.microprofile</groupId>
            <artifactId>microprofile</artifactId>
            <version>5.0</version>
            <type>pom</type>
            <scope>provided</scope>
        </dependency>
        <!-- For tests -->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <version>5.8.2</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.resteasy</groupId>
            <artifactId>resteasy-client</artifactId>
            <version>6.0.0.Final</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.resteasy</groupId>
            <artifactId>resteasy-json-binding-provider</artifactId>
            <version>6.0.0.Final</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.glassfish</groupId>
            <artifactId>jakarta.json</artifactId>
            <version>2.0.1</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <finalName>${project.artifactId}</finalName>
        <plugins>
            <!-- Enable liberty-maven plugin -->
            <!-- tag::libertyMavenPlugin[] -->
            <plugin>
                <groupId>io.openliberty.tools</groupId>
                <artifactId>liberty-maven-plugin</artifactId>
                <version>3.7.1</version>
            </plugin>
            <!-- end::libertyMavenPlugin[] -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>3.3.2</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.22.2</version>
            </plugin>
            <!-- Plugin to run functional tests -->
            <!-- tag::maven-failsafe-plugin[] -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>2.22.2</version>
                <configuration>
                    <systemPropertyVariables>
                        <http.port>${liberty.var.default.http.port}</http.port>
                        <!-- tag::contextRoot[] -->
                        <context.root>/dev</context.root>
                        <!-- end::contextRoot[] -->
                    </systemPropertyVariables>
                </configuration>
            </plugin>
            <!-- end::maven-failsafe-plugin[] -->
        </plugins>
    </build>
</project>

angelozerr added a commit to angelozerr/lemminx that referenced this issue Mar 1, 2023
@angelozerr angelozerr self-assigned this Mar 1, 2023
@angelozerr angelozerr added bug Something isn't working validation XSD labels Mar 1, 2023
@angelozerr angelozerr added this to the 0.25.0 milestone Mar 1, 2023
@datho7561 datho7561 moved this to 👀 In review in IDE Cloudaptors Mar 1, 2023
datho7561 pushed a commit that referenced this issue Mar 1, 2023
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in IDE Cloudaptors Mar 1, 2023
@cherylking
Copy link

@angelozerr Would you consider doing a 0.25.0 release before you move onto the 1.0.0 release? There are currently 13 PRs merged into that milestone already (one of which is for this issue).

@angelozerr
Copy link
Contributor

@cherylking at first please note that PR #1474 breaks the IHoverParticipant API. I wanted to have a clean API before creating 1.0.0 release.

@datho7561 what do you think about creating 0.25.0 release? There are not really new advanced features but there are some bug fixes and liberty team need some fixes that we did.

@cherylking
Copy link

There are not really new advanced features but there are some bug fixes and liberty team need some fixes that we did.

So maybe a 0.24.1 instead since it is only bug fixes?

@datho7561
Copy link
Contributor

I think it would be a good idea to do a release.

There are some features and API changes, so I think if we follow semver we should do a 0.25.0 release.

@angelozerr
Copy link
Contributor

I think it would be a good idea to do a release.

Great, do you think you could have time to do that?

@datho7561
Copy link
Contributor

Yeah, I think so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working validation XSD
Projects
None yet
4 participants