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

feat: Provide reference lens data for VSCode #284

Merged
merged 1 commit into from
Dec 9, 2023

Conversation

artempyanykh
Copy link
Owner

@artempyanykh artempyanykh commented Dec 9, 2023

When client's experimental.codeLensFindReferences capability is set (only VSCode plugin now), Marksman will output extra data for the code lens command that can be used to implement client-side behavior to show references when clicking on the lens, e.g.:

"command": {
            "title": "1 reference",
            "command": "marksman.findReferences",
            "arguments": [
                {
                    "uri": "file:///<path>.md",
                    "position": {
                        "line": 62,
                        "character": 0
                    },
                    "locations": [
                        {
                            "uri": "file:///<path>.md",
                            "range": {
                                "start": {
                                    "line": 12,
                                    "character": 2
                                },
                                "end": {
                                    "line": 12,
                                    "character": 19
                                }
                            }
                        }
                    ]
                }
            ]
        }
    },...

where command's arguments are:

  1. uri and position is file + pos of the lens,
  2. locations is uri + range for each reference.

When client's experimental.codeLensFindReferences capability is set (only VSCode plugin now), Marksman will output extra data for the code lens command that can be used to implement client-side behavior to show references when clicking on the lens.
@artempyanykh artempyanykh merged commit f124c56 into main Dec 9, 2023
3 checks passed
@artempyanykh artempyanykh deleted the codelens-data-vscode branch December 9, 2023 18:39
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

Successfully merging this pull request may close these issues.

1 participant