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

CodeAction to fix bad value for noNamespaceSchemaLocation #691

Closed
angelozerr opened this issue May 12, 2020 · 3 comments · Fixed by #787
Closed

CodeAction to fix bad value for noNamespaceSchemaLocation #691

angelozerr opened this issue May 12, 2020 · 3 comments · Fixed by #787
Assignees
Milestone

Comments

@angelozerr
Copy link
Contributor

angelozerr commented May 12, 2020

Given this XML file:

<root-element
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:noNamespaceSchemaLocation="file.xsd">
  
</root-element>

and file.xsd which doesn't exists:

image

We should have code actions:

@xorye
Copy link

xorye commented May 14, 2020

generate the file content by using the XML content. We need a generate of XSD based on XML which could use too in #151

We can generate the XSD based on the XML as a part of this new issue: #702

@fbricon fbricon modified the milestones: 0.12.0, 0.13.0 Jun 3, 2020
@fbricon
Copy link
Contributor

fbricon commented Jun 3, 2020

FYI, this is the code action returned by jdt.ls when creating a new class:

Result: [
    {
        "title": "Create class 'Bar'",
        "kind": "quickfix",
        "diagnostics": [
            {
                "range": {
                    "start": {
                        "line": 3,
                        "character": 4
                    },
                    "end": {
                        "line": 3,
                        "character": 7
                    }
                },
                "severity": 1,
                "code": "16777218",
                "source": "Java",
                "message": "Bar cannot be resolved to a type"
            }
        ],
        "command": {
            "title": "Create class 'Bar'",
            "command": "java.apply.workspaceEdit",
            "arguments": [
                {
                    "changes": {},
                    "documentChanges": [
                        {
                            "uri": "file:///Users/fbricon/Dev/quarkus-projects/totoototo/src/test/java/foo/bar/action/Bar.java",
                            "options": {
                                "overwrite": false,
                                "ignoreIfExists": true
                            },
                            "kind": "create"
                        },
                        {
                            "textDocument": {
                                "version": 0,
                                "uri": "file:///Users/fbricon/Dev/quarkus-projects/totoototo/src/test/java/foo/bar/action/Bar.java"
                            },
                            "edits": [
                                {
                                    "range": {
                                        "start": {
                                            "line": 0,
                                            "character": 0
                                        },
                                        "end": {
                                            "line": 0,
                                            "character": 0
                                        }
                                    },
                                    "newText": "package foo.bar.action;\n\npublic class Bar {\n\n}\n"
                                }
                            ]
                        }
                    ]
                }
            ]
        }
    },

@datho7561
Copy link
Contributor

I am interested on working on this

datho7561 added a commit to datho7561/lemminx that referenced this issue Jun 15, 2020
A CodeAction for the error schema-reference.4 that
creates the file referenced in
xsi:noNamespaceSchemaLocation if its missing.

Closes eclipse-lemminx#691

Signed-off-by: David Thompson <davthomp@redhat.com>
datho7561 added a commit to datho7561/lemminx that referenced this issue Jun 15, 2020
A CodeAction for the error schema-reference.4 that
creates the file referenced in
xsi:noNamespaceSchemaLocation if its missing.

Closes eclipse-lemminx#691

Signed-off-by: David Thompson <davthomp@redhat.com>
datho7561 added a commit to datho7561/lemminx that referenced this issue Jun 16, 2020
A CodeAction for the error `schema-reference.4` that
creates the file referenced in
`xsi:noNamespaceSchemaLocation` if its missing.

Closes eclipse-lemminx#691

Signed-off-by: David Thompson davthomp@redhat.com
datho7561 added a commit to datho7561/lemminx that referenced this issue Jun 16, 2020
A CodeAction for the error `schema-reference.4` that
creates the file referenced in
`xsi:noNamespaceSchemaLocation` if its missing.

Closes eclipse-lemminx#691

Signed-off-by: David Thompson <davthomp@redhat.com>
datho7561 added a commit to datho7561/lemminx that referenced this issue Jun 16, 2020
A CodeAction for the error `schema-reference.4` that
creates the file referenced in
`xsi:noNamespaceSchemaLocation` if its missing.

Closes eclipse-lemminx#691

Signed-off-by: David Thompson <davthomp@redhat.com>
datho7561 added a commit to datho7561/lemminx that referenced this issue Jun 16, 2020
A CodeAction for the error `schema-reference.4` that
creates the file referenced in
`xsi:noNamespaceSchemaLocation` if its missing.

Closes eclipse-lemminx#691

Signed-off-by: David Thompson <davthomp@redhat.com>
datho7561 added a commit to datho7561/lemminx that referenced this issue Jun 17, 2020
A CodeAction for the error `schema-reference.4` that
creates the file referenced in
`xsi:noNamespaceSchemaLocation` if its missing.

Closes eclipse-lemminx#691

Signed-off-by: David Thompson <davthomp@redhat.com>
datho7561 added a commit to datho7561/lemminx that referenced this issue Jun 17, 2020
A CodeAction for the error `schema-reference.4` that
creates the file referenced in
`xsi:noNamespaceSchemaLocation` if its missing.

Closes eclipse-lemminx#691

Signed-off-by: David Thompson <davthomp@redhat.com>
angelozerr pushed a commit to angelozerr/lemminx that referenced this issue Jun 18, 2020
A CodeAction for the error `schema-reference.4` that
creates the file referenced in
`xsi:noNamespaceSchemaLocation` if its missing.

Closes eclipse-lemminx#691

Signed-off-by: David Thompson <davthomp@redhat.com>
angelozerr pushed a commit to angelozerr/lemminx that referenced this issue Jun 18, 2020
A CodeAction for the error `schema-reference.4` that
creates the file referenced in
`xsi:noNamespaceSchemaLocation` if its missing.

Closes eclipse-lemminx#691

Signed-off-by: David Thompson <davthomp@redhat.com>
angelozerr pushed a commit to angelozerr/lemminx that referenced this issue Jun 18, 2020
A CodeAction for the error `schema-reference.4` that
creates the file referenced in
`xsi:noNamespaceSchemaLocation` if its missing.

Closes eclipse-lemminx#691

Signed-off-by: David Thompson <davthomp@redhat.com>
angelozerr pushed a commit to angelozerr/lemminx that referenced this issue Jun 18, 2020
A CodeAction for the error `schema-reference.4` that
creates the file referenced in
`xsi:noNamespaceSchemaLocation` if its missing.

Closes eclipse-lemminx#691

Signed-off-by: David Thompson <davthomp@redhat.com>
angelozerr pushed a commit to angelozerr/lemminx that referenced this issue Jun 18, 2020
A CodeAction for the error `schema-reference.4` that
creates the file referenced in
`xsi:noNamespaceSchemaLocation` if its missing.

Closes eclipse-lemminx#691

Signed-off-by: David Thompson <davthomp@redhat.com>
angelozerr pushed a commit to angelozerr/lemminx that referenced this issue Jun 18, 2020
A CodeAction for the error `schema-reference.4` that
creates the file referenced in
`xsi:noNamespaceSchemaLocation` if its missing.

Closes eclipse-lemminx#691

Signed-off-by: David Thompson <davthomp@redhat.com>
angelozerr pushed a commit that referenced this issue Jun 19, 2020
A CodeAction for the error `schema-reference.4` that
creates the file referenced in
`xsi:noNamespaceSchemaLocation` if its missing.

Closes #691

Signed-off-by: David Thompson <davthomp@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment