Skip to content

Support DocumentLink request#195

Merged
st0012 merged 5 commits into
mainfrom
support-document-link
Jul 27, 2022
Merged

Support DocumentLink request#195
st0012 merged 5 commits into
mainfrom
support-document-link

Conversation

@st0012

@st0012 st0012 commented Jul 14, 2022

Copy link
Copy Markdown
Member

Motivation

This request uses the gem source comments generated by Tapioca to let users quickly jump to the actual source of the definition.

Implementation

Add a new DocumentLink request to detect # source://PATH_TO_FILE:line comments and return clickable links if the file exists.

Automated Tests

New expectation + integration test cases.

Manual Tests

  1. Install the vscode-ruby-lsp extension from the PR
  2. Check out to the branch and restart LSP
  3. Run bundle exec tapioca gem to make sure we have rbi files that have the new source comments
  4. Find a file that has # source://PATH_TO_FILE:line comments and hover the mouse over one of them
    • It should show Jump to PATH_TO_FILE#line in the tooltip
    • If you click it, it should take it to the exact location

Demo

document_link

@st0012 st0012 added the enhancement New feature or request label Jul 14, 2022
@st0012 st0012 self-assigned this Jul 14, 2022
Comment thread test/fixtures/gem_source_comment.rb Outdated
Comment thread lib/ruby_lsp/requests/document_link.rb Outdated
@st0012 st0012 force-pushed the support-document-link branch 2 times, most recently from 777097a to 4d8f6ba Compare July 26, 2022 10:03
@vinistock

Copy link
Copy Markdown
Member

This PR looks almost ready to go for us all to enjoy jumping to gem source from RBIs. Can we please finalize the request documentation?

st0012 and others added 3 commits July 26, 2022 18:19
This request uses the gem source comments generated by Tapioca to
let users quickly jump to the actual source of the definition.
Co-authored-by: Alexandre Terrasa <Morriar@users.noreply.github.com>
Co-authored-by: Vinicius Stock <vinistock@users.noreply.github.com>
Co-authored-by: Stan Lo <st0012@users.noreply.github.com>
Co-authored-by: Maple Ong <wildmaples@users.noreply.github.com>
Co-authored-by: Adison Lampert <adisonlampert@users.noreply.github.com>
Co-authored-by: Emily Giurleo <egiurleo@users.noreply.github.com>
@st0012 st0012 force-pushed the support-document-link branch from 4d8f6ba to 91fd038 Compare July 26, 2022 18:04
@st0012 st0012 force-pushed the support-document-link branch from aeaab14 to 9ec0495 Compare July 26, 2022 19:58
@st0012 st0012 marked this pull request as ready for review July 26, 2022 20:07
@st0012 st0012 requested a review from a team as a code owner July 26, 2022 20:07
@st0012 st0012 requested review from Morriar and vinistock July 26, 2022 20:23

@vinistock vinistock left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Comment thread lib/ruby_lsp/requests/document_link.rb Outdated
Co-authored-by: Alexandre Terrasa <583144+Morriar@users.noreply.github.com>
@st0012 st0012 merged commit 979a1fd into main Jul 27, 2022
@st0012 st0012 deleted the support-document-link branch July 27, 2022 15:30
vinistock pushed a commit that referenced this pull request Aug 12, 2022
@shopify-shipit shopify-shipit Bot temporarily deployed to production August 26, 2022 20:47 Inactive
andyw8 pushed a commit to andyw8/ruby-lsp that referenced this pull request Mar 2, 2024
…sbuild-0.15.5

Bump esbuild from 0.15.3 to 0.15.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants