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

Add GotoTest and GotoSource functionality #2985

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Conversation

jenny-codes
Copy link
Contributor

@jenny-codes jenny-codes commented Dec 13, 2024

Motivation

A stab at #2966. We can now click the "Goto Test" and "Goto Source" from the commands menu and from the explorer view.

Implementation

Implementing it as a custom request for now until vscode starts supporting it officially.

The path finding algorithm is a rephrase of https://github.com/jasonrudolph/significant-other-vscode/blob/main/matchmaker.js

https://github.com/shopify/dev-test-runner seems to have a more robust implementation though. I'm also going to explore some other options too before deciding on the final implementation.

Automated Tests

Not yet!

Manual Tests

rubylsp-goto-2.mp4

@jenny-codes jenny-codes self-assigned this Dec 13, 2024
@jenny-codes jenny-codes force-pushed the goto-test branch 2 times, most recently from 811dca1 to b362347 Compare January 22, 2025 03:38
Define and implement the experimental/gotoRelevantFile lsp method. This
request takes in a textDcoument param, and retusn an array of locations
that are related to the input file path.

Currently, the related file paths are
- test files, if the input file is a source file
- source files, if the input file is a test file

Basically it goes between source file <> test file.

This is implemented as a experimental method until something more
official comes along.
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