You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I haven't found a straightforward way to run my local ruby-lsp server in standalone mode for debugging. I'm wondering how others are approaching development in similar scenarios, if there is a more direct approach that I have missed and otherwise if support could be added for this.
In the meantime, I've found a workaround that might be helpful to others facing the same issue. I'm sharing it here in case it assists someone, and I'd also appreciate any insights or alternative solutions.
The Issue
My launch config for debugging the extension opens another (Gemfile-less) workspace:
The target workspace does not have a Gemfile and the path does not end in ruby-lsp, so getLspExecutables resolves to just ruby-lsp which loads my installed gem instead of my local repo. I was able to get the workspace to load my local copy if I set a custom Gemfile that has gem 'ruby-lsp', path: '/path/to/my/local/ruby-lsp'. Unfortunately, this obviously starts the server in bundle mode rather than standalone mode. Without a custom bundle, the server from my local copy of ruby-lsp is only started if the extension is running from within ruby-lsp itself.
The Workaround
For now, I added a ruby-lsp symlink in my target workspace that points to my local exe/ruby-lsp. This works! I had cursor create tasks to link and unlink automatically.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I haven't found a straightforward way to run my local ruby-lsp server in standalone mode for debugging. I'm wondering how others are approaching development in similar scenarios, if there is a more direct approach that I have missed and otherwise if support could be added for this.
In the meantime, I've found a workaround that might be helpful to others facing the same issue. I'm sharing it here in case it assists someone, and I'd also appreciate any insights or alternative solutions.
The Issue
My launch config for debugging the extension opens another (Gemfile-less) workspace:
The target workspace does not have a Gemfile and the path does not end in ruby-lsp, so getLspExecutables resolves to just ruby-lsp which loads my installed gem instead of my local repo. I was able to get the workspace to load my local copy if I set a custom Gemfile that has
gem 'ruby-lsp', path: '/path/to/my/local/ruby-lsp'
. Unfortunately, this obviously starts the server in bundle mode rather than standalone mode. Without a custom bundle, the server from my local copy of ruby-lsp is only started if the extension is running from within ruby-lsp itself.The Workaround
For now, I added a ruby-lsp symlink in my target workspace that points to my local exe/ruby-lsp. This works! I had cursor create tasks to link and unlink automatically.
launch.json
tasks.json
Beta Was this translation helpful? Give feedback.
All reactions