Closed icnagy closed 1 year ago
Hey! Thank you for the kind words.
Indeed, when you run the Ruby LSP without bundle exec
, then you do need to require bundler
. Instead of doing it in semantic highlighting, I would say we better do it in internal.rb
where we require most of the libraries, std gems and stuff. Please let me know if you want to contribute that.
Interesting that not all features are documented/enabled by default
I'm curious about this and how we can improve. Which features did you find not to be documented? Did you check our supported features?
Thanks @vinistock for the quick reply.
Yes, it does make more sense to require bundle in internal.rb
. Will create a PR shortly, though I'm not familiar enough with the code base to see where and how would one test this?
Sorry for the confusion, I probably should've written that it's interesting that the features are opt-in rather than opt-out. It was really easy to figure out what features are available and how to enable them. Unless I'm mistaken without initializationOptions/enabledFeatures
only the diagnostic feature is enabled, which seems a bit conservative. But again, I'm using SublimeText with SublimeLSP which doesn't seem to be compatible with all the features (eg: DocumentLink isn't working).
I see. Yeah, the decision we made initially to enable features using an array rather than a hash was not a very happy one. We enable features based on their presence in the array.
This works well for VS Code, where we control the default values of each setting, but is not great for any other editor. We'll need to revisit this to allow the server to have better control over what's enabled and make it easier for other editors to configure.
it's not hard to figure out how to enable them
I can't figure out how to disable.
{
"clients": {
"ruby-lsp": {
"enabled": true,
"command": [
"ruby-lsp"
],
"selector": "source.ruby",
"initializationOptions": {
"enabledFeatures": {
"diagnostics": false,
"codeActions": false
},
"formatter": "none"
}
}
},
"inhibit_snippet_completions": true
}
but Rubocop is still here.
@Nakilon Please create a new issue rather than reporting the same thing in multiple places.
Hey,
Really great project! After seeing the conference talk I wanted to try it in SublimeText. Interesting that not all features are documented/enabled by default but it's not hard to figure out how to enable them. Here's the SublimeLSP setting I ended up with:
When
semanticHighlighting
is enabledruby-lsp
throws a#<NameError: uninitialized constant RubyLsp::Requests::SemanticHighlighting::Bundler>
on initialize: (sorry for the wall of text, formatted for readability)The fix is quite simple, just adding a
require "bundler"
on top oflib/ruby-lsp/requests/semantic_highlighting.rb
fixes it. Happy to create a PR, I'm just not sure if that is the best solution?