Skip to content

VSCode does not pick up stree #376

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

Closed
danbee opened this issue May 22, 2023 · 2 comments
Closed

VSCode does not pick up stree #376

danbee opened this issue May 22, 2023 · 2 comments

Comments

@danbee
Copy link

danbee commented May 22, 2023

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.

@danbee
Copy link
Author

danbee commented May 22, 2023

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

@danbee danbee closed this as completed May 22, 2023
@danbee
Copy link
Author

danbee commented May 22, 2023

Opened here: ruby-syntax-tree/vscode-syntax-tree#341

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

No branches or pull requests

1 participant