ruby-lsp 0.7.4 → 0.7.5

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: 5488592df860b1fd1439a1b2780a7d0da850fcb9b9164713fbf5ce07b6e67270
4
- data.tar.gz: '055789cf32db04550a7bd4f602a4e3d69a96760698c567450eceffde5a7ef152'
3
+ metadata.gz: 4825b35aef41194e36092d705d02735786950d140842c20d210ae79ece322a00
4
+ data.tar.gz: 980bb51fca93844ec0e2bcf2ce57779441fd90a243bf8dab1c30d6dec683e438
5
5
  SHA512:
6
- metadata.gz: a3f710de0df843d8c45499b5f818433b9d25b56547d19b2a7cd3896b73ff29c6a6e2be35d091df7d9a7058d9d0d3994dc63898328efa689a198faf864ef61ffc
7
- data.tar.gz: cc97f72b359d8125269d17cac6d0c8313ca7e2debcae54a81beb270f620b12b100ec89a2bf9c9a82990bb41411a9acf37f76909c09b561bf53eb7fcd74d407b6
6
+ metadata.gz: 5ce7d7401bf7a817a90b6cabeb3d2da7bcc7115d5cb2bf38d5866d4e30061eab615e1fc5366059e7c46630701e11345eb00ac8a09d171d17864ec7fae2ef5a58
7
+ data.tar.gz: cb90d3684d0ea67aa35b53ff694821ecac2b30d43a878a6b24ac6bed873c8ed1eb284fb94a01f4295abda13a612dc0c757e233e0e6a96b2ab70e08c1ce2ddaf1
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.7.4
1
+ 0.7.5
data/exe/ruby-lsp CHANGED
@@ -25,9 +25,9 @@ if ENV["BUNDLE_GEMFILE"].nil? && File.exist?("Gemfile.lock")
25
25
  # SetupBundler to install the gems
26
26
  path = Bundler.settings["path"]
27
27
 
28
- command = +"BUNDLE_GEMFILE=#{bundle_gemfile} bundle exec ruby-lsp #{ARGV.join(" ")}"
29
- command.prepend("BUNDLE_PATH=#{File.expand_path(path, Dir.pwd)} ") if path
30
- exit exec(command)
28
+ env = { "BUNDLE_GEMFILE" => bundle_gemfile }
29
+ env["BUNDLE_PATH"] = File.expand_path(path, Dir.pwd) if path
30
+ exit exec(env, "bundle exec ruby-lsp #{ARGV.join(" ")}")
31
31
  end
32
32
 
33
33
  require "sorbet-runtime"
@@ -47,7 +47,7 @@ module RubyLsp
47
47
  start_char = scanner.find_char_position(range[:start])
48
48
  end_char = scanner.find_char_position(range[:end])
49
49
 
50
- queue = T.cast(@document.tree, SyntaxTree::Program).statements.body
50
+ queue = T.cast(@document.tree, SyntaxTree::Program).statements.body.dup
51
51
  found_nodes = []
52
52
 
53
53
  until queue.empty?
@@ -26,7 +26,7 @@ module RubyLsp
26
26
  params(node: T.any(SyntaxTree::ConstPathRef, SyntaxTree::ConstRef, SyntaxTree::TopConstRef)).returns(String)
27
27
  end
28
28
  def full_constant_name(node)
29
- name = +node.constant.value
29
+ name = node.constant.value.dup
30
30
  constant = T.let(node, SyntaxTree::Node)
31
31
 
32
32
  while constant.is_a?(SyntaxTree::ConstPathRef)
@@ -38,7 +38,10 @@ module RubyLsp
38
38
 
39
39
  sig { params(gem_pattern: Regexp).returns(T::Boolean) }
40
40
  def direct_dependency?(gem_pattern)
41
- Bundler.locked_gems.dependencies.keys.grep(gem_pattern).any?
41
+ Bundler.with_original_env { Bundler.default_gemfile } &&
42
+ Bundler.locked_gems.dependencies.keys.grep(gem_pattern).any?
43
+ rescue Bundler::GemfileNotFound
44
+ false
42
45
  end
43
46
  end
44
47
  end
@@ -120,16 +120,18 @@ module RubyLsp
120
120
  # want to install it in the top level `vendor` and not `.ruby-lsp/vendor`
121
121
  path = Bundler.settings["path"]
122
122
 
123
- command = +""
124
123
  # Use the absolute `BUNDLE_PATH` to prevent accidentally creating unwanted folders under `.ruby-lsp`
125
- command << "BUNDLE_PATH=#{File.expand_path(path, Dir.pwd)} " if path
126
- command << "BUNDLE_GEMFILE=#{bundle_gemfile} " if bundle_gemfile
124
+ env = {}
125
+ env["BUNDLE_GEMFILE"] = bundle_gemfile if bundle_gemfile
126
+ env["BUNDLE_PATH"] = File.expand_path(path, Dir.pwd) if path
127
127
 
128
128
  # If both `ruby-lsp` and `debug` are already in the Gemfile, then we shouldn't try to upgrade them or else we'll
129
129
  # produce undesired source control changes. If the custom bundle was just created and either `ruby-lsp` or `debug`
130
130
  # weren't a part of the Gemfile, then we need to run `bundle install` for the first time to generate the
131
131
  # Gemfile.lock with them included or else Bundler will complain that they're missing. We can only update if the
132
132
  # custom `.ruby-lsp/Gemfile.lock` already exists and includes both gems
133
+ command = +""
134
+
133
135
  if (@dependencies["ruby-lsp"] && @dependencies["debug"]) ||
134
136
  @custom_bundle_dependencies["ruby-lsp"].nil? || @custom_bundle_dependencies["debug"].nil?
135
137
  # Install gems using the custom bundle
@@ -147,7 +149,7 @@ module RubyLsp
147
149
 
148
150
  # Add bundle update
149
151
  warn("Ruby LSP> Running bundle install for the custom bundle. This may take a while...")
150
- system(command)
152
+ system(env, command)
151
153
  end
152
154
  end
153
155
  end
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.7.4
4
+ version: 0.7.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-07-25 00:00:00.000000000 Z
11
+ date: 2023-08-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: language_server-protocol