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

Add support for clickableXSD CodeLens #490

Closed
fbricon opened this issue Jul 1, 2019 · 2 comments · Fixed by #500
Closed

Add support for clickableXSD CodeLens #490

fbricon opened this issue Jul 1, 2019 · 2 comments · Fixed by #500
Assignees
Labels
codelens enhancement New feature or request XSD
Milestone

Comments

@fbricon
Copy link
Contributor

fbricon commented Jul 1, 2019

I find that textDocument/codelens (#55) provides very little value without the ability to open reference links on the client side, that'd be computed via a call to codeLens/resolve.
The main issue so far is there's no standard way to invoke an "open references" command (that I know of). So, clients would have to implement a custom "xml.show.references" command (similar to vscode-java's own java.show.references.
Clients would need to advertise their support for that feature, in the initialization options.

@fbricon fbricon added the enhancement New feature or request label Jul 1, 2019
@fbricon
Copy link
Contributor Author

fbricon commented Jul 1, 2019

For reference, here's the payload returned by jdt.ls for a similar request (see the command attribute):

[Trace - 12:26:28 PM] Received response 'codeLens/resolve - (176)' in 66ms.
Result: {
    "range": {
        "start": {
            "line": 7,
            "character": 21
        },
        "end": {
            "line": 7,
            "character": 25
        }
    },
    "command": {
        "title": "5 references",
        "command": "java.show.references",
        "arguments": [
            "file:///Users/fbricon/Downloads/sample-resources/foo/bar/Hello.java",
            {
                "line": 7,
                "character": 21
            },
            [
                {
                    "uri": "file:///Users/fbricon/Downloads/sample-resources/foo/bar/Hello.java",
                    "range": {
                        "start": {
                            "line": 19,
                            "character": 4
                        },
                        "end": {
                            "line": 19,
                            "character": 14
                        }
                    }
                },
                {
                    "uri": "file:///Users/fbricon/Downloads/sample-resources/foo/bar/Hello.java",
                    "range": {
                        "start": {
                            "line": 20,
                            "character": 4
                        },
                        "end": {
                            "line": 20,
                            "character": 14
                        }
                    }
                },
                {
                    "uri": "file:///Users/fbricon/Downloads/sample-resources/foo/bar/Hello.java",
                    "range": {
                        "start": {
                            "line": 25,
                            "character": 4
                        },
                        "end": {
                            "line": 25,
                            "character": 14
                        }
                    }
                },
                {
                    "uri": "file:///Users/fbricon/Downloads/sample-resources/foo/bar/Hello.java",
                    "range": {
                        "start": {
                            "line": 26,
                            "character": 4
                        },
                        "end": {
                            "line": 26,
                            "character": 14
                        }
                    }
                },
                {
                    "uri": "file:///Users/fbricon/Downloads/sample-resources/foo/bar/Hello.java",
                    "range": {
                        "start": {
                            "line": 27,
                            "character": 4
                        },
                        "end": {
                            "line": 27,
                            "character": 14
                        }
                    }
                }
            ]
        ]
    },
    "data": [
        "file:///Users/fbricon/Downloads/sample-resources/foo/bar/Hello.java",
        {
            "line": 7,
            "character": 21
        },
        "references"
    ]
}

@angelozerr
Copy link
Contributor

angelozerr commented Jul 1, 2019

@fbricon I think we don't need in our case doing that in resolve method since command title is updated in codeLens services. Indeed the references computing for one node requires to walk inside of all nodes of DOMDocument. So the performance to find references for one node or for several nodes is the same.

In other words, we need just to update Command with the proper command in https://github.com/angelozerr/lsp4xml/blob/master/org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/extensions/xsd/participants/XSDCodeLensParticipant.java#L40

@angelozerr angelozerr changed the title Add support for codeLens/resolve XSD CodeLens references should be clickable Jul 3, 2019
angelozerr pushed a commit that referenced this issue Jul 3, 2019
Fix #490

This PR set XSD references CodeLens Command with "xml.show.references"
and uri, position as arguments.

Signed-off-by: azerr <azerr@redhat.com>
angelozerr pushed a commit to angelozerr/vscode-xml that referenced this issue Jul 3, 2019
Fix eclipse/lemminx#490

This PR bind the XSD CodeLens references command to a function which
opens the vscode references.
angelozerr pushed a commit to angelozerr/vscode-xml that referenced this issue Jul 3, 2019
Fix eclipse/lemminx#490

This PR bind the XSD CodeLens references command to a function which
opens the vscode references.
angelozerr pushed a commit that referenced this issue Jul 4, 2019
Fix #490

This PR set XSD references CodeLens Command with "xml.show.references"
and uri, position as arguments.

Signed-off-by: azerr <azerr@redhat.com>
@angelozerr angelozerr added this to the v0.8.0 milestone Jul 4, 2019
angelozerr pushed a commit that referenced this issue Jul 4, 2019
Fix #490

This PR set XSD references CodeLens Command with "xml.show.references"
and uri, position as arguments.

Signed-off-by: azerr <azerr@redhat.com>
angelozerr pushed a commit to angelozerr/vscode-xml that referenced this issue Jul 4, 2019
Fix eclipse/lemminx#490

This PR bind the XSD CodeLens references command to a function which
opens the vscode references.
angelozerr pushed a commit that referenced this issue Jul 10, 2019
Fix #490

This PR set XSD references CodeLens Command with "xml.show.references"
and uri, position as arguments.

Signed-off-by: azerr <azerr@redhat.com>
angelozerr pushed a commit that referenced this issue Jul 10, 2019
Fix #490

This PR set XSD references CodeLens Command with "xml.show.references"
and uri, position as arguments.

Signed-off-by: azerr <azerr@redhat.com>
angelozerr pushed a commit to angelozerr/vscode-xml that referenced this issue Jul 10, 2019
Fix eclipse/lemminx#490

This PR bind the XSD CodeLens references command to a function which
opens the vscode references.
angelozerr pushed a commit that referenced this issue Jul 10, 2019
Fix #490

This PR set XSD references CodeLens Command with "xml.show.references"
and uri, position as arguments.

Signed-off-by: azerr <azerr@redhat.com>
angelozerr pushed a commit that referenced this issue Jul 10, 2019
Fix #490

This PR set XSD references CodeLens Command with "xml.show.references"
and uri, position as arguments.

Signed-off-by: azerr <azerr@redhat.com>
angelozerr pushed a commit that referenced this issue Jul 10, 2019
Fix #490

This PR set XSD references CodeLens Command with "xml.show.references"
and uri, position as arguments.

Signed-off-by: azerr <azerr@redhat.com>
angelozerr pushed a commit to angelozerr/vscode-xml that referenced this issue Jul 10, 2019
Fix eclipse/lemminx#490

This PR bind the XSD CodeLens references command to a function which
opens the vscode references.
angelozerr pushed a commit that referenced this issue Jul 10, 2019
Fix #490

This PR set XSD references CodeLens Command with "xml.show.references"
and uri, position as arguments.

Signed-off-by: azerr <azerr@redhat.com>
angelozerr pushed a commit that referenced this issue Jul 10, 2019
Fix #490

This PR set XSD references CodeLens Command with "xml.show.references"
and uri, position as arguments.

Signed-off-by: azerr <azerr@redhat.com>
fbricon pushed a commit that referenced this issue Jul 10, 2019
Fix #490

This PR set XSD references CodeLens Command with "xml.show.references"
and uri, position as arguments.

Signed-off-by: azerr <azerr@redhat.com>
fbricon pushed a commit to redhat-developer/vscode-xml that referenced this issue Jul 10, 2019
Fix eclipse/lemminx#490

This PR bind the XSD CodeLens references command to a function which
opens the vscode references.
@angelozerr angelozerr added the XSD label Jul 23, 2019
@angelozerr angelozerr changed the title XSD CodeLens references should be clickable XSD CodeLens references should be clickable Jul 23, 2019
@angelozerr angelozerr changed the title XSD CodeLens references should be clickable Add support for clickableXSD CodeLens Jul 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
codelens enhancement New feature or request XSD
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants