Skip to content

VS Code: Add customBinaryPath option #3386

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

palkan
Copy link

@palkan palkan commented Apr 10, 2025

Motivation

This option allows to provide any compatible binary to be used as ruby-lsp exec. This is especially useful for containerized development with VS Code running on the host machine (i.e., not using Dev Containers or Remote Containers). A typical use case is the applications using dip (and ruby-on-whales) (see #2919). However, the ability to customize the binary path has many more potential applications.

Motivation continues...

I've been using a similar approach with Zed for a while (it already provides this option). The trick is to use a thin Bash wrapper to run ruby-lsp anywhere. Mine looks as follows:

#!/bin/bash

cd $(dirname $0)/..

dip ruby-lsp $@

That's it.

With this change, we can configure rubyLsp.customBinaryPath to point to a custom executable (say, ".dockerdev/ruby-lsp"), and benefit from LSP features even without having Ruby LSP (and even Ruby) installed locally (let me omit some Docker-specific tricks used to make it work, not relevant to the proposal).

Implementation

  • Added new configuration option to package.json: customBinaryPath
  • Updated client.ts to use the new option if present to generate commands configuration.

Automated Tests

None. Couldn't find any tests for similar functionality (commands configuration). Would love to have some guidance here.

Manual Tests

Packaged and installed the forked version locally and verified that LSP works.

This option allows to provide any compatible binary to be used as `ruby-lsp` exec
@palkan palkan requested a review from a team as a code owner April 10, 2025 00:12
Copy link

graphite-app bot commented Apr 10, 2025

How to use the Graphite Merge Queue

Add the label graphite-merge to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

@palkan
Copy link
Author

palkan commented Apr 10, 2025

I have signed the CLA!

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