ruby-lsp 0.14.1 → 0.14.3
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.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/VERSION +1 -1
- data/exe/ruby-lsp +0 -7
- data/exe/ruby-lsp-doctor +2 -0
- data/lib/ruby_lsp/addon.rb +13 -7
- data/lib/ruby_lsp/internal.rb +7 -5
- data/lib/ruby_lsp/listeners/completion.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e762c728055d0a7ee471dd6455cb0b8ed5f1a2ed1137a71c70f4238e18d7b8bd
|
4
|
+
data.tar.gz: 61636e671131322ffd9792c1e23f70e54ebea9f9dd15401abac8ec0c91bf4131
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
+
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
data/lib/ruby_lsp/addon.rb
CHANGED
@@ -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
|
-
|
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
|
data/lib/ruby_lsp/internal.rb
CHANGED
@@ -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
|
-
|
11
|
-
|
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:
|
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.
|
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-
|
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:
|