ruby-lsp 0.16.7 → 0.17.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -1
- data/VERSION +1 -1
- data/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb +195 -18
- data/lib/ruby_indexer/lib/ruby_indexer/entry.rb +129 -12
- data/lib/ruby_indexer/lib/ruby_indexer/index.rb +333 -44
- data/lib/ruby_indexer/lib/ruby_indexer/rbs_indexer.rb +99 -0
- data/lib/ruby_indexer/ruby_indexer.rb +1 -0
- data/lib/ruby_indexer/test/classes_and_modules_test.rb +58 -11
- data/lib/ruby_indexer/test/configuration_test.rb +5 -6
- data/lib/ruby_indexer/test/constant_test.rb +9 -9
- data/lib/ruby_indexer/test/index_test.rb +867 -7
- data/lib/ruby_indexer/test/instance_variables_test.rb +131 -0
- data/lib/ruby_indexer/test/method_test.rb +57 -0
- data/lib/ruby_indexer/test/rbs_indexer_test.rb +42 -0
- data/lib/ruby_indexer/test/test_case.rb +10 -1
- data/lib/ruby_lsp/addon.rb +8 -8
- data/lib/ruby_lsp/document.rb +26 -3
- data/lib/ruby_lsp/global_state.rb +37 -16
- data/lib/ruby_lsp/internal.rb +2 -0
- data/lib/ruby_lsp/listeners/code_lens.rb +2 -2
- data/lib/ruby_lsp/listeners/completion.rb +74 -17
- data/lib/ruby_lsp/listeners/definition.rb +82 -24
- data/lib/ruby_lsp/listeners/hover.rb +62 -6
- data/lib/ruby_lsp/listeners/signature_help.rb +4 -4
- data/lib/ruby_lsp/node_context.rb +39 -0
- data/lib/ruby_lsp/requests/code_action_resolve.rb +73 -2
- data/lib/ruby_lsp/requests/code_actions.rb +16 -15
- data/lib/ruby_lsp/requests/completion.rb +21 -13
- data/lib/ruby_lsp/requests/completion_resolve.rb +9 -0
- data/lib/ruby_lsp/requests/definition.rb +25 -5
- data/lib/ruby_lsp/requests/document_highlight.rb +2 -2
- data/lib/ruby_lsp/requests/hover.rb +5 -6
- data/lib/ruby_lsp/requests/on_type_formatting.rb +8 -4
- data/lib/ruby_lsp/requests/signature_help.rb +3 -3
- data/lib/ruby_lsp/requests/support/common.rb +4 -3
- data/lib/ruby_lsp/requests/support/rubocop_diagnostic.rb +23 -6
- data/lib/ruby_lsp/requests/support/rubocop_formatter.rb +5 -1
- data/lib/ruby_lsp/requests/support/rubocop_runner.rb +4 -0
- data/lib/ruby_lsp/requests/workspace_symbol.rb +7 -4
- data/lib/ruby_lsp/server.rb +22 -5
- data/lib/ruby_lsp/test_helper.rb +1 -0
- metadata +29 -5
@@ -54,7 +54,7 @@ module RubyIndexer
|
|
54
54
|
|
55
55
|
assert_includes(indexables, "#{RbConfig::CONFIG["rubylibdir"]}/pathname.rb")
|
56
56
|
assert_includes(indexables, "#{RbConfig::CONFIG["rubylibdir"]}/ipaddr.rb")
|
57
|
-
assert_includes(indexables, "#{RbConfig::CONFIG["rubylibdir"]}/
|
57
|
+
assert_includes(indexables, "#{RbConfig::CONFIG["rubylibdir"]}/erb.rb")
|
58
58
|
end
|
59
59
|
|
60
60
|
def test_indexables_includes_project_files
|
@@ -68,12 +68,11 @@ module RubyIndexer
|
|
68
68
|
end
|
69
69
|
|
70
70
|
def test_indexables_avoids_duplicates_if_bundle_path_is_inside_project
|
71
|
-
Bundler.settings.
|
72
|
-
|
71
|
+
Bundler.settings.temporary(path: "vendor/bundle") do
|
72
|
+
config = Configuration.new
|
73
73
|
|
74
|
-
|
75
|
-
|
76
|
-
Bundler.settings.set_global("path", nil)
|
74
|
+
assert_includes(config.instance_variable_get(:@excluded_patterns), "#{Dir.pwd}/vendor/bundle/**/*.rb")
|
75
|
+
end
|
77
76
|
end
|
78
77
|
|
79
78
|
def test_indexables_does_not_include_gems_own_installed_files
|
@@ -105,7 +105,7 @@ module RubyIndexer
|
|
105
105
|
self.class::FOO = 1
|
106
106
|
RUBY
|
107
107
|
|
108
|
-
|
108
|
+
assert_no_indexed_entries
|
109
109
|
end
|
110
110
|
|
111
111
|
def test_private_constant_indexing
|
@@ -122,13 +122,13 @@ module RubyIndexer
|
|
122
122
|
RUBY
|
123
123
|
|
124
124
|
b_const = @index["A::B"].first
|
125
|
-
assert_equal(
|
125
|
+
assert_equal(Entry::Visibility::PRIVATE, b_const.visibility)
|
126
126
|
|
127
127
|
c_const = @index["A::C"].first
|
128
|
-
assert_equal(
|
128
|
+
assert_equal(Entry::Visibility::PRIVATE, c_const.visibility)
|
129
129
|
|
130
130
|
d_const = @index["A::D"].first
|
131
|
-
assert_equal(
|
131
|
+
assert_equal(Entry::Visibility::PUBLIC, d_const.visibility)
|
132
132
|
end
|
133
133
|
|
134
134
|
def test_marking_constants_as_private_reopening_namespaces
|
@@ -155,13 +155,13 @@ module RubyIndexer
|
|
155
155
|
RUBY
|
156
156
|
|
157
157
|
a_const = @index["A::B::CONST_A"].first
|
158
|
-
assert_equal(
|
158
|
+
assert_equal(Entry::Visibility::PRIVATE, a_const.visibility)
|
159
159
|
|
160
160
|
b_const = @index["A::B::CONST_B"].first
|
161
|
-
assert_equal(
|
161
|
+
assert_equal(Entry::Visibility::PRIVATE, b_const.visibility)
|
162
162
|
|
163
163
|
c_const = @index["A::B::CONST_C"].first
|
164
|
-
assert_equal(
|
164
|
+
assert_equal(Entry::Visibility::PRIVATE, c_const.visibility)
|
165
165
|
end
|
166
166
|
|
167
167
|
def test_marking_constants_as_private_with_receiver
|
@@ -179,10 +179,10 @@ module RubyIndexer
|
|
179
179
|
RUBY
|
180
180
|
|
181
181
|
a_const = @index["A::B::CONST_A"].first
|
182
|
-
assert_equal(
|
182
|
+
assert_equal(Entry::Visibility::PRIVATE, a_const.visibility)
|
183
183
|
|
184
184
|
b_const = @index["A::B::CONST_B"].first
|
185
|
-
assert_equal(
|
185
|
+
assert_equal(Entry::Visibility::PRIVATE, b_const.visibility)
|
186
186
|
end
|
187
187
|
|
188
188
|
def test_indexing_constant_aliases
|