ruby-lsp 0.14.1 → 0.14.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5881826c3ac1a810dd585343edde142df892845da187fa12bb6e95073441b1c3
4
- data.tar.gz: 4fb97013a3ed44bef08cf0a42e1ed3439af38849cf36c1649bcdae317ff62e01
3
+ metadata.gz: e762c728055d0a7ee471dd6455cb0b8ed5f1a2ed1137a71c70f4238e18d7b8bd
4
+ data.tar.gz: 61636e671131322ffd9792c1e23f70e54ebea9f9dd15401abac8ec0c91bf4131
5
5
  SHA512:
6
- metadata.gz: 3cd87e2979f87711c141dcf78a9041e783d903289ce4edbef0cec238a4ed8291e936935cce043e8c455c8a0dfd1da8f57decf0765391b2c49a7c7e9b79fd3136
7
- data.tar.gz: 5a427cb75dd28cadd4d92992f4ba679510c281ca92ba8c39af973d4498cd575e3b4f5b30bc58e6417ad57f396a761fb5a0f37ce9a956f2ef616d43c0168aee90
6
+ metadata.gz: dd8712a89c31f1a43bed4744537a08997acf927e7dad6cd3e64aa31f8c2beb08bfdf2867b66a7c302cf11f7c803a52e2a4dfe46930bcb17f7f57c6cf196140ee
7
+ data.tar.gz: 7bd900943556a4e5e54d46894ca855740de8effb0f2675ec4b01efd9a08f3b2517a516e38ab99abf3266a3984dcbcc4ec5b2de5c976a0eabd08dfdd0ce38516f
data/README.md CHANGED
@@ -54,7 +54,7 @@ default gems, except for
54
54
  - Gems that only appear under the `:development` group
55
55
  - All Ruby files under `test/**/*.rb`
56
56
 
57
- By creating a `.index.yml` file, these configurations can be overridden and tuned.
57
+ By creating a `.index.yml` file, these configurations can be overridden and tuned. Note that indexing dependent behavior, such as definition, hover, completion or workspace symbol will be impacted by the configurations placed here.
58
58
 
59
59
  ```yaml
60
60
  # Exclude files based on a given pattern. Often used to exclude test files or fixtures
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.14.1
1
+ 0.14.3
data/exe/ruby-lsp CHANGED
@@ -94,13 +94,6 @@ if options[:debug]
94
94
  exit 1
95
95
  end
96
96
 
97
- sockets_dir = "/tmp/ruby-lsp-debug-sockets"
98
- Dir.mkdir(sockets_dir) unless Dir.exist?(sockets_dir)
99
- # ruby-debug-ENV["USER"] is an implicit naming pattern in ruby/debug
100
- # if it's not present, rdbg will not find the socket
101
- socket_identifier = "ruby-debug-#{ENV["USER"]}-#{File.basename(Dir.pwd)}.sock"
102
- ENV["RUBY_DEBUG_SOCK_PATH"] = "#{sockets_dir}/#{socket_identifier}"
103
-
104
97
  begin
105
98
  require "debug/open_nonstop"
106
99
  rescue LoadError
data/exe/ruby-lsp-doctor CHANGED
@@ -6,6 +6,8 @@ require "ruby_lsp/internal"
6
6
 
7
7
  index = RubyIndexer::Index.new
8
8
 
9
+ puts "Globbing for indexable files"
10
+
9
11
  RubyIndexer.configuration.indexables.each do |indexable|
10
12
  puts "indexing: #{indexable.full_path}"
11
13
  content = File.read(indexable.full_path)
@@ -25,21 +25,25 @@ module RubyLsp
25
25
 
26
26
  abstract!
27
27
 
28
+ @addons = T.let([], T::Array[Addon])
29
+ @addon_classes = T.let([], T::Array[T.class_of(Addon)])
30
+
28
31
  class << self
29
32
  extend T::Sig
30
33
 
34
+ sig { returns(T::Array[Addon]) }
35
+ attr_accessor :addons
36
+
37
+ sig { returns(T::Array[T.class_of(Addon)]) }
38
+ attr_reader :addon_classes
39
+
31
40
  # Automatically track and instantiate addon classes
32
41
  sig { params(child_class: T.class_of(Addon)).void }
33
42
  def inherited(child_class)
34
- addons << child_class.new
43
+ addon_classes << child_class
35
44
  super
36
45
  end
37
46
 
38
- sig { returns(T::Array[Addon]) }
39
- def addons
40
- @addons ||= T.let([], T.nilable(T::Array[Addon]))
41
- end
42
-
43
47
  # Discovers and loads all addons. Returns the list of activated addons
44
48
  sig { params(message_queue: Thread::Queue).returns(T::Array[Addon]) }
45
49
  def load_addons(message_queue)
@@ -51,11 +55,13 @@ module RubyLsp
51
55
  $stderr.puts(e.full_message)
52
56
  end
53
57
 
58
+ # Instantiate all discovered addon classes
59
+ self.addons = addon_classes.map(&:new)
60
+
54
61
  # Activate each one of the discovered addons. If any problems occur in the addons, we don't want to
55
62
  # fail to boot the server
56
63
  addons.each do |addon|
57
64
  addon.activate(message_queue)
58
- nil
59
65
  rescue => e
60
66
  addon.add_error(e)
61
67
  end
@@ -7,13 +7,17 @@ yarp_require_paths = Gem.loaded_specs["yarp"]&.full_require_paths
7
7
  $LOAD_PATH.delete_if { |path| yarp_require_paths.include?(path) } if yarp_require_paths
8
8
 
9
9
  require "sorbet-runtime"
10
- require "prism"
11
- require "prism/visitor"
12
- require "language_server-protocol"
10
+
11
+ # Set Bundler's UI level to silent as soon as possible to prevent any prints to STDOUT
13
12
  require "bundler"
13
+ Bundler.ui.level = :silent
14
+
14
15
  require "uri"
15
16
  require "cgi"
16
17
  require "set"
18
+ require "prism"
19
+ require "prism/visitor"
20
+ require "language_server-protocol"
17
21
 
18
22
  require "ruby-lsp"
19
23
  require "ruby_indexer/ruby_indexer"
@@ -29,5 +33,3 @@ require "ruby_lsp/ruby_document"
29
33
  require "ruby_lsp/store"
30
34
  require "ruby_lsp/addon"
31
35
  require "ruby_lsp/requests/support/rubocop_runner"
32
-
33
- Bundler.ui.level = :silent
@@ -139,7 +139,7 @@ module RubyLsp
139
139
  Interface::CompletionItem.new(
140
140
  label: name,
141
141
  filter_text: name,
142
- text_edit: Interface::TextEdit.new(range: range_from_node(node), new_text: name),
142
+ text_edit: Interface::TextEdit.new(range: range_from_location(T.must(node.message_loc)), new_text: name),
143
143
  kind: Constant::CompletionItemKind::METHOD,
144
144
  label_details: Interface::CompletionItemLabelDetails.new(
145
145
  detail: "(#{entry.parameters.map(&:decorated_name).join(", ")})",
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-lsp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.1
4
+ version: 0.14.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-02-16 00:00:00.000000000 Z
11
+ date: 2024-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: language_server-protocol
@@ -159,6 +159,7 @@ licenses:
159
159
  - MIT
160
160
  metadata:
161
161
  allowed_push_host: https://rubygems.org
162
+ documentation_uri: https://shopify.github.io/ruby-lsp/
162
163
  post_install_message:
163
164
  rdoc_options: []
164
165
  require_paths: