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’d like to configure rubyLsp.indexing.includedPatterns from my add-on to include a pattern like **/Rakefile* , but it seems there is no way to do so. How can I configure this? Or do you have any plans to create an API for such a use case? If adding such an API is possible, I’d be happy to submit a pull request. Thank you for your consideration!
The text was updated successfully, but these errors were encountered:
@kozy4324 there may be a way do this currently, but I haven't verified:
In an add-on, you have access to @global_state, and from that you can get a reference to the index so you could try index.apply_config(...) (see configuration_test.rb for an example).
@index.configuration.apply_config({ "included_patterns" => ["**/Rakefile"] }) call in the Addon#activate method works well 👍 kozy4324/ruby-lsp-rake@4667d80
I thought there might be some concerns about making this a public API, but if this approach is acceptable, I believe we can close this issue.
You're right, this isn't ideal as a public API. An add-on could change configuration in a way that is detrimental to other add-ons, or overwrite a user's config.
I am developing an add-on for Rake:
https://github.com/kozy4324/ruby-lsp-rake
I’d like to configure
rubyLsp.indexing.includedPatterns
from my add-on to include a pattern like**/Rakefile*
, but it seems there is no way to do so. How can I configure this? Or do you have any plans to create an API for such a use case? If adding such an API is possible, I’d be happy to submit a pull request. Thank you for your consideration!The text was updated successfully, but these errors were encountered: