-
Notifications
You must be signed in to change notification settings - Fork 28
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
Specifically handle the case where bin/rails is not found #284
Conversation
b39b61d
to
529f22e
Compare
I was working on this approach in ruby-lsp, so that if the app doesn't have |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In regards to installing the addon or not, at the root of it is the question "is there value in having this addon even if it's not a Rails app?".
I think the answer might be yes because of the code lens support for Active Support style tests. But I'm not 100% sure to be honest. Thoughts?
@@ -12,7 +12,15 @@ class << self | |||
|
|||
sig { returns(RunnerClient) } | |||
def create_client | |||
new | |||
if File.exist?("bin/rails") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will fail in workspace that are symlinks, since the addons don't yet have access to the workspace URI announced by the editor. There's nothing to do now, but I wanted to document this.
We need to create some sort of State
object in the Ruby LSP that addons get initialized with, containing all of the initialization options, the message queue, etc.
In addition to those, once we implemented something like go-to-definition to DSL symbols, like before_save :foo # cmd+click :foo jumps to foo method Then it'll be useful in Rails engine development too. |
One confusing aspect is that you'd always end up Perhaps we can treat |
I feel like it might be early to make that decision. IMO, we can go with this PR and make a decision once we have more context. |
.rubocop.yml
Outdated
@@ -35,6 +35,3 @@ Sorbet/StrictSigil: | |||
Exclude: | |||
- "**/*.rake" | |||
- "test/**/*.rb" | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Being removed in #285
Interesting, got a failure CI because on Ubuntu the error looks like:
|
98b1de8
to
b2419cc
Compare
When the file is not found, it is likely that the LSP is not being run in the root of a Rails project. Having a more specific error message will help the user understand what is going on.
b2419cc
to
a4b498a
Compare
When the file is not found, it is likely that the LSP is not being run in the root of a Rails project. Having a more specific error message will help the user understand what is going on.