class Rubydex::Linter::RubyLsp::Addon
Constants
- CONFIGURATION_FILE
Public Instance Methods
(::RubyLsp::GlobalState, Thread::Queue) → void
Source
# File lib/ruby_lsp/rubydex/addon.rb, line 31 def activate(global_state, outgoing_queue) @outgoing_queue = outgoing_queue #: Thread::Queue? @linter = Linter.new(global_state) #: Linter? global_state.register_formatter( "rubydex", @linter, #: as !nil ) register_additional_file_watchers(global_state, outgoing_queue) end
@override
() → void
Source
# File lib/ruby_lsp/rubydex/addon.rb, line 45 def deactivate; end
@override
() → String
Source
# File lib/ruby_lsp/rubydex/addon.rb, line 19 def name "Rubydex Linter" end
@override
() → String
Source
# File lib/ruby_lsp/rubydex/addon.rb, line 25 def version ::Rubydex::VERSION end
@override
(Array[{ uri: String, type: Integer }]) → void
Source
# File lib/ruby_lsp/rubydex/addon.rb, line 48 def workspace_did_change_watched_files(changes) return unless @linter && @outgoing_queue @linter.reload_configuration if changes.any? { |change| configuration_change?(change) } @linter.lint! @linter.diagnostics_to_clear.each do |uri| @outgoing_queue << ::RubyLsp::Notification.publish_diagnostics(uri, []) end @linter.current_diagnostics.each do |uri, diagnostics| @outgoing_queue << ::RubyLsp::Notification.publish_diagnostics(uri, diagnostics) end end