Skip to content

Commit

Permalink
Remove all autoloads (#2589)
Browse files Browse the repository at this point in the history
  • Loading branch information
vinistock authored Sep 20, 2024
1 parent 8d1009e commit 5ed8b91
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 81 deletions.
43 changes: 41 additions & 2 deletions lib/ruby_lsp/internal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,54 @@
require "ruby_lsp/global_state"
require "ruby_lsp/server"
require "ruby_lsp/type_inferrer"
require "ruby_lsp/requests"
require "ruby_lsp/response_builders"
require "ruby_lsp/node_context"
require "ruby_lsp/document"
require "ruby_lsp/ruby_document"
require "ruby_lsp/erb_document"
require "ruby_lsp/rbs_document"
require "ruby_lsp/store"
require "ruby_lsp/addon"

# Response builders
require "ruby_lsp/response_builders/response_builder"
require "ruby_lsp/response_builders/collection_response_builder"
require "ruby_lsp/response_builders/document_symbol"
require "ruby_lsp/response_builders/hover"
require "ruby_lsp/response_builders/semantic_highlighting"
require "ruby_lsp/response_builders/signature_help"

# Request support
require "ruby_lsp/requests/support/rubocop_diagnostic"
require "ruby_lsp/requests/support/selection_range"
require "ruby_lsp/requests/support/annotation"
require "ruby_lsp/requests/support/sorbet"
require "ruby_lsp/requests/support/common"
require "ruby_lsp/requests/support/formatter"
require "ruby_lsp/requests/support/rubocop_runner"
require "ruby_lsp/requests/support/rubocop_formatter"
require "ruby_lsp/requests/support/syntax_tree_formatter"

# Requests
require "ruby_lsp/requests/request"
require "ruby_lsp/requests/code_action_resolve"
require "ruby_lsp/requests/code_actions"
require "ruby_lsp/requests/code_lens"
require "ruby_lsp/requests/completion_resolve"
require "ruby_lsp/requests/completion"
require "ruby_lsp/requests/definition"
require "ruby_lsp/requests/diagnostics"
require "ruby_lsp/requests/document_highlight"
require "ruby_lsp/requests/document_link"
require "ruby_lsp/requests/document_symbol"
require "ruby_lsp/requests/folding_ranges"
require "ruby_lsp/requests/formatting"
require "ruby_lsp/requests/hover"
require "ruby_lsp/requests/inlay_hints"
require "ruby_lsp/requests/on_type_formatting"
require "ruby_lsp/requests/prepare_type_hierarchy"
require "ruby_lsp/requests/selection_ranges"
require "ruby_lsp/requests/semantic_highlighting"
require "ruby_lsp/requests/show_syntax_tree"
require "ruby_lsp/requests/signature_help"
require "ruby_lsp/requests/type_hierarchy_supertypes"
require "ruby_lsp/requests/workspace_symbol"
64 changes: 0 additions & 64 deletions lib/ruby_lsp/requests.rb

This file was deleted.

13 changes: 0 additions & 13 deletions lib/ruby_lsp/response_builders.rb

This file was deleted.

4 changes: 2 additions & 2 deletions test/requests/formatting_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def foo
end

def test_syntax_tree_formatting_ignores_syntax_invalid_documents
require "ruby_lsp/requests"
require "ruby_lsp/requests/formatting"
@global_state.formatter = "syntax_tree"
document = RubyLsp::RubyDocument.new(source: "def foo", version: 1, uri: URI::Generic.from_path(path: __FILE__))
assert_nil(RubyLsp::Requests::Formatting.new(@global_state, document).perform)
Expand Down Expand Up @@ -160,7 +160,7 @@ def test_returns_nil_when_formatter_is_none
private

def formatted_document(formatter)
require "ruby_lsp/requests"
require "ruby_lsp/requests/formatting"
@global_state.formatter = formatter
RubyLsp::Requests::Formatting.new(@global_state, @document).perform&.first&.new_text
end
Expand Down

0 comments on commit 5ed8b91

Please sign in to comment.