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

Support for *global* references-listing #646

Closed
ELLIOTTCABLE opened this issue Apr 1, 2022 · 4 comments
Closed

Support for *global* references-listing #646

ELLIOTTCABLE opened this issue Apr 1, 2022 · 4 comments
Labels

Comments

@ELLIOTTCABLE
Copy link

Hi!

I didn't see any Issues open for "Find All References" / global-references (⌥⇧F12).

When I invoke that feature of VSCode, at the moment, it only shows references in the current file. (For comparison, the Vim equivalent is vim.lsp.buf.references().)

I'd love to see proper support for whole-project references to a given identifier. This is probably a long-term goal.

As an example, here's the request/response for the currently-implemented file-only textDocument/references implementation:

[Trace - 3:11:24 PM] Sending request 'textDocument/references - (36)'.
Params: {
    "textDocument": {
        "uri": "file:///home/elliott.cable/code/melange/jscomp/core/js_dump_program.ml"
    },
    "position": {
        "line": 127,
        "character": 11
    },
    "context": {
        "includeDeclaration": true
    }
}


[Trace - 3:11:24 PM] Received response 'textDocument/references - (36)' in 1ms.
Result: [
    {
        "uri": "file:///home/elliott.cable/code/melange/jscomp/core/js_dump_program.ml",
        "range": {
            "start": {
                "line": 127,
                "character": 4
            },
            "end": {
                "line": 127,
                "character": 21
            }
        }
    }
]
@ulugbekna
Copy link
Collaborator

This will only be fixed when merlin adds support for global reference search. This is on the merlin’s roadmap, AFAIK.

@NoahTheDuke
Copy link

Given that Merlin now supports project-wide references, and since #1233, looks like if you build your project with @ocaml-index, then this works out of the box.

@voodoos
Copy link
Collaborator

voodoos commented Feb 4, 2025

I recommend running dune build @ocaml-index --watch while developing for projects that don't cost too much to index. Then the stand Find All References query in most client should work fine 🙂

I will let you close the issue if that works for you.

@ELLIOTTCABLE
Copy link
Author

I don't have an active OCaml project to test this on right now, but I'll definitely keep that in mind. This sounds awesome; I'm really glad to see all your hard work finally land! <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants