ruby-syntax-tree / syntax_tree

Interact with the Ruby syntax tree

Home Page:https://ruby-syntax-tree.github.io/syntax_tree/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

VSCode does not pick up `stree`

danbee opened this issue · comments

Hi, I'm trying to set up our project to use syntax_tree for Ruby code formatting, and I'm having some trouble getting the VSCode extension to consistently pick up the stree executable. If I launch VSCode using the CLI tool (eg. code .) or using the .code-workspace file in our project it all works correctly.

However, if I just launch VSCode directly from the OS (macOS Ventura in this case), I get the following error messages and code formatting does not work.

image
Starting language server: stree lsp
[Error - 3:09:05 PM] Syntax Tree client: couldn't create connection to server.
Launching server using command stree failed. Error: spawn stree ENOENT

syntax_tree is installed in the bundle for the application and also globally. I use asdf for managing Ruby versions on my machine.

If I click on the "Install Gem" button I get an error about permissions:

Error installing gem: Error: Command failed: gem install syntax_tree
ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory.

This suggests that it's trying to install the gem for the system Ruby version rather than the version of Ruby selected by asdf.

Sorry, I opened this in the wrong place. I'll re-open on the vscode-syntax-tree repo.