ruby-lsp 0.27.0.beta2 → 0.27.0.beta4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/exe/ruby-lsp +0 -46
  4. data/exe/ruby-lsp-check +0 -15
  5. data/lib/ruby_lsp/base_server.rb +2 -0
  6. data/lib/ruby_lsp/global_state.rb +0 -5
  7. data/lib/ruby_lsp/internal.rb +2 -1
  8. data/lib/ruby_lsp/listeners/code_lens.rb +1 -1
  9. data/lib/ruby_lsp/listeners/completion.rb +244 -383
  10. data/lib/ruby_lsp/listeners/definition.rb +6 -9
  11. data/lib/ruby_lsp/listeners/hover.rb +11 -9
  12. data/lib/ruby_lsp/listeners/signature_help.rb +11 -12
  13. data/lib/ruby_lsp/listeners/test_discovery.rb +17 -1
  14. data/lib/ruby_lsp/listeners/test_style.rb +1 -1
  15. data/lib/ruby_lsp/requests/completion_resolve.rb +49 -29
  16. data/lib/ruby_lsp/requests/references.rb +21 -7
  17. data/lib/ruby_lsp/requests/rename.rb +1 -1
  18. data/lib/ruby_lsp/requests/support/common.rb +79 -68
  19. data/lib/ruby_lsp/ruby_document.rb +0 -73
  20. data/lib/ruby_lsp/rubydex/declaration.rb +128 -2
  21. data/lib/ruby_lsp/rubydex/definition.rb +16 -0
  22. data/lib/ruby_lsp/rubydex/signature.rb +107 -0
  23. data/lib/ruby_lsp/scripts/compose_bundle.rb +1 -1
  24. data/lib/ruby_lsp/server.rb +40 -168
  25. data/lib/ruby_lsp/setup_bundler.rb +1 -1
  26. data/lib/ruby_lsp/test_helper.rb +0 -1
  27. data/lib/ruby_lsp/test_reporters/lsp_reporter.rb +1 -1
  28. data/lib/ruby_lsp/type_inferrer.rb +58 -40
  29. metadata +14 -17
  30. data/lib/ruby_indexer/lib/ruby_indexer/configuration.rb +0 -276
  31. data/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb +0 -1101
  32. data/lib/ruby_indexer/lib/ruby_indexer/enhancement.rb +0 -44
  33. data/lib/ruby_indexer/lib/ruby_indexer/entry.rb +0 -605
  34. data/lib/ruby_indexer/lib/ruby_indexer/index.rb +0 -1077
  35. data/lib/ruby_indexer/lib/ruby_indexer/location.rb +0 -37
  36. data/lib/ruby_indexer/lib/ruby_indexer/prefix_tree.rb +0 -149
  37. data/lib/ruby_indexer/lib/ruby_indexer/rbs_indexer.rb +0 -294
  38. data/lib/ruby_indexer/lib/ruby_indexer/visibility_scope.rb +0 -32
  39. data/lib/ruby_indexer/ruby_indexer.rb +0 -19
  40. /data/lib/{ruby_indexer/lib/ruby_indexer → ruby_lsp}/uri.rb +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 11c508848c7c0db2c86807dd05b5de3a0cf33c8d69259cffd34865af8f50d93b
4
- data.tar.gz: d030d7223e7714008fef42f5b8635b373cf42f88f60e3c22a878dd1e48ed2ee8
3
+ metadata.gz: de1859a4f73bdc2007364195d5e2c8aae9f999455a7523ad290263efb0edab30
4
+ data.tar.gz: 63e9388bc11ef954ed197db00c166a900e0f422c346c48af7bc485ab51a630c8
5
5
  SHA512:
6
- metadata.gz: 23d4677fea98fe4723442e9162c9835ce9813eab354882c9b3cbd45deb4fc9cd81a91d1618cdb8e580c68eeaf840a45cc7271c031b2b4bf559d92a50d64755ec
7
- data.tar.gz: 1e044d2758e1872a1a94df7f288e8e2ff4b1b4ca2a089db8958acf5830bacd8247086c1c0df167fe072a6586a8391332ceaaa1827add9280e9c42cd3ce96bdf2
6
+ metadata.gz: cade33d50651fb915408b36b0537cb201c9b61ee0151e2ae6a8a1bee3099054af2a184e93b7790a0d283860159326f31d391c71bda798f00229262c4c58123f2
7
+ data.tar.gz: 01f24b527c33cc3d741fe682d79b70a0881760a9dc6d599101356563cbfce30ce0e719619312f530f42256b6ecb82ac2a40c93d6cde0ad97ef5e2a8087922d3d
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.27.0.beta2
1
+ 0.27.0.beta4
data/exe/ruby-lsp CHANGED
@@ -17,14 +17,6 @@ parser = OptionParser.new do |opts|
17
17
  options[:debug] = true
18
18
  end
19
19
 
20
- opts.on("--time-index", "Measure the time it takes to index the project") do
21
- options[:time_index] = true
22
- end
23
-
24
- opts.on("--doctor", "Run troubleshooting steps") do
25
- options[:doctor] = true
26
- end
27
-
28
20
  opts.on("--use-launcher", "[EXPERIMENTAL] Use launcher mechanism to handle missing dependencies gracefully") do
29
21
  options[:launcher] = true
30
22
  end
@@ -110,44 +102,6 @@ if options[:debug]
110
102
  end
111
103
  end
112
104
 
113
- if options[:time_index]
114
- index = RubyIndexer::Index.new
115
-
116
- time_start = Process.clock_gettime(Process::CLOCK_MONOTONIC)
117
- index.index_all
118
- elapsed_time = Process.clock_gettime(Process::CLOCK_MONOTONIC) - time_start
119
-
120
- entries = index.instance_variable_get(:@entries)
121
- entries_by_entry_type = entries.values.flatten.group_by(&:class)
122
-
123
- puts <<~MSG
124
- Ruby LSP v#{RubyLsp::VERSION}: Indexing took #{elapsed_time.round(5)} seconds and generated:
125
- - #{entries_by_entry_type.sort_by { |k, _| k.to_s }.map { |k, v| "#{k.name.split("::").last}: #{v.size}" }.join("\n- ")}
126
- MSG
127
- return
128
- end
129
-
130
- if options[:doctor]
131
- index = RubyIndexer::Index.new
132
-
133
- if File.exist?(".index.yml")
134
- begin
135
- config = YAML.parse_file(".index.yml").to_ruby
136
- rescue => e
137
- abort("Error parsing config: #{e.message}")
138
- end
139
- index.configuration.apply_config(config)
140
- end
141
-
142
- puts "Globbing for indexable files"
143
-
144
- index.configuration.indexable_uris.each do |uri|
145
- puts "indexing: #{uri}"
146
- index.index_file(uri)
147
- end
148
- return
149
- end
150
-
151
105
  server = RubyLsp::Server.new
152
106
 
153
107
  # Ensure all output goes out stderr by default to allow puts/p/pp to work
data/exe/ruby-lsp-check CHANGED
@@ -36,21 +36,6 @@ ensure
36
36
  end
37
37
  puts "\n"
38
38
 
39
- # Indexing
40
- puts "Verifying that indexing executes successfully. This may take a while..."
41
-
42
- index = RubyIndexer::Index.new
43
- uris = index.configuration.indexable_uris
44
-
45
- uris.each_with_index do |uri, i|
46
- index.index_file(uri)
47
- rescue => e
48
- errors[uri.full_path] = e
49
- ensure
50
- print("\033[M\033[0KIndexed #{i + 1}/#{uris.length}") unless ENV["CI"]
51
- end
52
- puts "\n"
53
-
54
39
  if errors.empty?
55
40
  puts "All operations completed successfully!"
56
41
  exit
@@ -74,6 +74,8 @@ module RubyLsp
74
74
  )
75
75
  end
76
76
  end
77
+ rescue URI::Error
78
+ # A client can send a document URI with a scheme Ruby's URI parser rejects, so we don't want to fail
77
79
  rescue Store::NonExistingDocumentError
78
80
  # If we receive a request for a file that no longer exists, we don't want to fail
79
81
  end
@@ -27,9 +27,6 @@ module RubyLsp
27
27
  #: bool
28
28
  attr_reader :has_type_checker
29
29
 
30
- #: RubyIndexer::Index
31
- attr_reader :index
32
-
33
30
  #: Rubydex::Graph
34
31
  attr_reader :graph
35
32
 
@@ -60,7 +57,6 @@ module RubyLsp
60
57
  @linters = [] #: Array[String]
61
58
  @test_library = "minitest" #: String
62
59
  @has_type_checker = true #: bool
63
- @index = RubyIndexer::Index.new #: RubyIndexer::Index
64
60
  @graph = Rubydex::Graph.new #: Rubydex::Graph
65
61
  @supported_formatters = {} #: Hash[String, Requests::Support::Formatter]
66
62
  @type_inferrer = TypeInferrer.new(@graph) #: TypeInferrer
@@ -206,7 +202,6 @@ module RubyLsp
206
202
  @graph.encoding = "utf32"
207
203
  Encoding::UTF_32LE
208
204
  end
209
- @index.configuration.encoding = @encoding
210
205
 
211
206
  @client_capabilities.apply_client_capabilities(options[:capabilities]) if options[:capabilities]
212
207
 
@@ -35,10 +35,11 @@ require "set"
35
35
  require "ruby_lsp/rubydex/declaration"
36
36
  require "ruby_lsp/rubydex/definition"
37
37
  require "ruby_lsp/rubydex/reference"
38
+ require "ruby_lsp/rubydex/signature"
38
39
 
39
40
  require "ruby-lsp"
40
41
  require "ruby_lsp/base_server"
41
- require "ruby_indexer/ruby_indexer"
42
+ require "ruby_lsp/uri"
42
43
  require "ruby_lsp/utils"
43
44
  require "ruby_lsp/scope"
44
45
  require "ruby_lsp/client_capabilities"
@@ -279,7 +279,7 @@ module RubyLsp
279
279
  when Prism::StringNode
280
280
  first_argument.content
281
281
  when Prism::ConstantReadNode, Prism::ConstantPathNode
282
- RubyIndexer::Index.constant_name(first_argument)
282
+ constant_name(first_argument)
283
283
  end
284
284
 
285
285
  return unless name