-
Notifications
You must be signed in to change notification settings - Fork 183
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 GoToRelevantFile functionality #2985
Conversation
ce2a926
to
fb30abd
Compare
Sorry for the delay in reviewing. Can you rebase this against the |
fb30abd
to
9b39633
Compare
02e94b1
to
e23d525
Compare
I tried tophatting on |
For the CI spelling failures, you can add those terms to |
@andyw8 can you share your tophatting steps? I tried it on both vscode and nvim and both work as expected. For what's worth I've also been using it on shopify/shopify for a while now and have not encountered issues. |
Just tried again and it's working, I must have missed something before. |
b055a21
to
a871787
Compare
@st0012 @andyw8 I've addressed your comments in the latest commit a871787:
I also updated the sigs to rbs syntax |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested against Ruby LSP and Core and both worked 👍
Is there any plan to add a UI element to trigger the command too?
@vinistock I think we can release this first while waiting for VS Code finishing its spec as it's a highly requested feature.
Nitpick, but can we fix 'goto' to be two words. 🙏 |
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.
@jenny-codes What's the plan wrt this?
|
@st0012 sorry missed that question. I can look into adding that if it's desirable? |
Motivation
A stab at #2966. We can now click the "Go to relevant file" from the commands menu and from the explorer view.
Instruction here for those that want to use in in neovim
In the LspAttach event callback, add the following
and then you can bind go_to_relevant_file() to a keymap
Implementation
Implementing it as a custom request for now until vscode starts supporting it officially.
I've studied a few different implementations and after some internet browsing decided to use the Jacaard similarity here to find the most likely path to the desired filename.
Some future opportunities–
Automated Tests
Included
Manual Tests
goto-relevant-file-demo.mp4