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

Attach kind information to found usages #412

Open
mkaput opened this issue Mar 5, 2025 · 0 comments
Open

Attach kind information to found usages #412

mkaput opened this issue Mar 5, 2025 · 0 comments
Milestone

Comments

@mkaput
Copy link
Member

mkaput commented Mar 5, 2025

Problem

We are not setting the kind of found reference in textDocument/documentHighlight responses: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#documentHighlightKind

Proposed Solution

Add a kind field to FoundUsage struct and plumb it into textDocument/documentHighlight response.

The value of the kind field should be inferred as a separate step while/just before building FoundUsage instance. This should be fairly easy to infer from the AST location itself:

  1. If usage is a binding in let pat = ... statement, or function/closure parameter (or similar) → kind = Write.
  2. If usage is in doc comment → kind = Text
  3. Otherwise, → kind = Read.

Notes

No response

@mkaput mkaput moved this to Triage in Cairo Language Services Mar 5, 2025
@mkaput mkaput moved this from Triage to Backlog LS in Cairo Language Services Mar 10, 2025
@mkaput mkaput added this to the Goto milestone Mar 13, 2025
@mkaput mkaput moved this from Backlog LS to Idea aka Deep Backlog in Cairo Language Services Mar 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

1 participant