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

Implement TextDocumentDeclaration #294

Merged
merged 3 commits into from
Nov 9, 2020
Merged

Conversation

mnxn
Copy link
Collaborator

@mnxn mnxn commented Nov 3, 2020

Implements TextDocumentDeclaration in order to use "Go to Declaration" in editors like VSCode. This is useful for jumping to .mli files in order to read documentation.

@mnxn mnxn requested a review from rgrinberg November 3, 2020 02:23
@rgrinberg
Copy link
Member

Thanks. Could you rebase? The commit on master fixes the make target.

@mnxn mnxn force-pushed the go-to-declaration branch from 4ef97c8 to ea3915d Compare November 3, 2020 03:31
@mnxn
Copy link
Collaborator Author

mnxn commented Nov 3, 2020

I still need to add tests. They will likely be a bit more complicated than TextDocumentDefinition because it needs Merlin to recognized two files.

@rgrinberg
Copy link
Member

I still need to add tests. They will likely be a bit more complicated than TextDocumentDefinition because it needs Merlin to recognized two files.

Indeed. You will need to use dune to build your two sources.

I'm wondering if this is where we should start experimenting with cram tests? Perhaps you could could create a little test binary:

  $ lsp_run_server_and_send_request.exe < cat <<EOF
  {
    // your locate query
  }
  > EOF

I don't really like the current typescript tests. Quite a bit of overhead and the integration with dune is poor.

@mnxn
Copy link
Collaborator Author

mnxn commented Nov 7, 2020

I'd like to keep this PR small in scope, so I just did it in typescript with some supplemental files. We can move to cram tests in another PR.

@rgrinberg rgrinberg merged commit 4a6e27d into ocaml:master Nov 9, 2020
rgrinberg added a commit to rgrinberg/opam-repository that referenced this pull request Nov 16, 2020
CHANGES:

## Features

- Add keyword completion

- Add go to declaration functionality to jump to a value's specification in a
  .mli file (ocaml/ocaml-lsp#294)

## Fixes

- ocaml/ocaml-lsp#245: correctly use mutexes on OpenBSD (ocaml/ocaml-lsp#264)

- ocaml/ocaml-lsp#268: Do not use vendored libraries when building the lsp package (ocaml/ocaml-lsp#260)

- ocaml/ocaml-lsp#271: Clear diagnostics when files are closed

- Disable non-prefix completion. There's no reliably way to trigger it and it
  can be slow.
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.

2 participants