Shopify / ruby-lsp

An opinionated language server for Ruby
https://shopify.github.io/ruby-lsp/
MIT License
1.36k stars 125 forks source link

vs code: asdf environment variables ignored #2023

Closed gi closed 2 weeks ago

gi commented 1 month ago

Description

VS Code Ruby LSP

The extension detects asdf but fails when searching for the data directory.

The code does not appear to use the asdf environment variables:

Instead, it attempts to detect those values by looking at predetermined locations. This fails when a those values are set to alternative locations.

Reproduction steps

  1. set ASDF_DATA_DIR to ~/asdf-data
  2. install/setup asdf to that location (see docs)
  3. Open VS Code
  4. Open a Ruby file
  5. See error:
Automatic Ruby environment activation with asdf failed:
Could not find ASDF data dir. Searched in
file:///Users/zach.gianos/.asdf, 
file:///opt/asdf-vm, 
file:///opt/homebrew/opt/asdf/libexec, 
file:///usr/local/opt/asdf/libexec

Note

A recent update broke this customization of the asdf setup.

I presume that it was this commit: 30bc0001.

I'm simply comparing the timeframe of the commit and the functionality change. (I use Ruby LSP every day.)