ruby_language_server 0.3.10 → 0.3.11

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: bd91d47c15d866df0d207db2e5f9d289200e006620bf0457a62309630e3da707
4
- data.tar.gz: 4dfac7f73cc17285a0543596d17bdd5326603d3716a625add6644ee55966c59d
3
+ metadata.gz: fe54fa7e2447945dfdec7a3e4115d6a31d028842d78b26631885d4e324cd77bc
4
+ data.tar.gz: 178acfce9a35034338ae281542c46c84ae96982c0202a5568585f976239abe20
5
5
  SHA512:
6
- metadata.gz: 7d7782c575a27ab425bd3c3e73330a3196407e2a1caedcc4b9ac90f238f245bd0a6f2d98b1966e34ce203646bffec484831cf7b02828d063797cc5091d984be7
7
- data.tar.gz: 5506cfa8697302b0be73362f709f51f0ac70b264749bcae831a278f355d44f8eff360b2b5aca8d895bc1508145253d585860fa946512be7d148167768173dd35
6
+ metadata.gz: 48e6196bf2fd6ae860211a5e31e670ef22fbe66d1cca0c44ae239b8ab82faa7ad3a657a3afcda15b6930e54becc8f743a2e415cef5648f3e03583158be5d507c
7
+ data.tar.gz: 4a5b80426e7e08be93eb514e42420c9f8bc15563b427fc20cc0d648d3a7280db092756ba1980153385696cc4e9249fb3843c26047e856a6ebfef39791f5dbe26
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ #### 0.3.11 Wed Jan 29 06:48:37 UTC 2020
4
+
5
+ * #57 rubocop gemfiles mismatch
6
+ * #56 .rubocop.yml changes do not rerun rubocop validations
7
+
3
8
  #### 0.3.10 Fri Jan 24 00:19:14 PST 2020
4
9
 
5
10
  * botched the 0.3.9 release
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ruby_language_server (0.3.10)
4
+ ruby_language_server (0.3.11)
5
5
  activerecord (~> 5.2)
6
6
  amatch
7
7
  bundler
@@ -65,7 +65,7 @@ GEM
65
65
  ruby_dep (~> 1.2)
66
66
  lumberjack (1.0.13)
67
67
  method_source (0.9.2)
68
- minitest (5.11.3)
68
+ minitest (5.13.0)
69
69
  minitest-color (0.0.2)
70
70
  minitest (~> 5)
71
71
  mize (0.4.0)
@@ -124,7 +124,7 @@ DEPENDENCIES
124
124
  guard
125
125
  guard-minitest
126
126
  guard-rubocop
127
- minitest (~> 5.11)
127
+ minitest (= 5.13.0)
128
128
  minitest-color
129
129
  pry
130
130
  pry-byebug
@@ -133,4 +133,4 @@ DEPENDENCIES
133
133
  sexp_processor
134
134
 
135
135
  BUNDLED WITH
136
- 2.1.3
136
+ 2.1.4
@@ -16,6 +16,7 @@ module RubyLanguageServer
16
16
  gemfile do
17
17
  source 'https://rubygems.org'
18
18
  gem 'rubocop', rubocop_gem.version.to_s
19
+ gem 'minitest', '5.13.0' # Very specific version matching one in gemspec
19
20
  gem_names.each do |gem_name|
20
21
  gem gem_name
21
22
  end
@@ -4,12 +4,14 @@ require 'rubocop'
4
4
 
5
5
  module RubyLanguageServer
6
6
  class GoodCop < RuboCop::Runner
7
- def initialize
8
- @initialization_error = nil
9
- config_store = RuboCop::ConfigStore.new
10
- config_store.options_config = config_path
11
- RubyLanguageServer.logger.debug("Rubocop config_path: #{config_path}")
12
- super({}, config_store)
7
+ def initialize(config_path, initialization_error = nil)
8
+ @initialization_error = initialization_error
9
+ unless @initialization_error
10
+ config_store = RuboCop::ConfigStore.new
11
+ config_store.options_config = config_path
12
+ RubyLanguageServer.logger.debug("Rubocop config_path: #{config_path}")
13
+ super({}, config_store)
14
+ end
13
15
  rescue Exception => e
14
16
  RubyLanguageServer.logger.error(e)
15
17
  @initialization_error = "There was an issue loading the rubocop configuration file: #{e}. Maybe you need to add some additional gems to the ide-ruby settings?"
@@ -100,7 +102,8 @@ module RubyLanguageServer
100
102
  if excluded_file?(filename)
101
103
  []
102
104
  else
103
- processed_source = RuboCop::ProcessedSource.new(text, 2.7, filename)
105
+ ruby_version = 2.7
106
+ processed_source = RuboCop::ProcessedSource.new(text, ruby_version, filename)
104
107
  offenses = inspect_file(processed_source)
105
108
  offenses.compact.flatten
106
109
  end
@@ -119,14 +122,31 @@ module RubyLanguageServer
119
122
  ]
120
123
  end
121
124
 
122
- def config_path
123
- my_path = __FILE__
124
- pathname = Pathname.new(my_path)
125
- my_directory = pathname.dirname
126
- fallback_pathname = my_directory + '../resources/fallback_rubocop.yml'
127
- project_path = RubyLanguageServer::ProjectManager.root_path + '.rubocop.yml'
128
- possible_config_paths = [project_path, fallback_pathname.to_s]
129
- possible_config_paths.detect { |path| File.exist?(path) }
125
+ class << self
126
+ def instance
127
+ @config_path ||= config_path
128
+ config_path_timestamp = File.mtime(@config_path)
129
+ if @cached_config_path_timestamp.nil? || @cached_config_path_timestamp < config_path_timestamp
130
+ @cached_config_path_timestamp = config_path_timestamp
131
+ @instance = new(@config_path)
132
+ else
133
+ @instance
134
+ end
135
+ rescue StandardError => e
136
+ @instance = new(@config_path, e.to_s)
137
+ end
138
+
139
+ private
140
+
141
+ def config_path
142
+ my_path = __FILE__
143
+ pathname = Pathname.new(my_path)
144
+ my_directory = pathname.dirname
145
+ fallback_pathname = my_directory + '../resources/fallback_rubocop.yml'
146
+ project_path = RubyLanguageServer::ProjectManager.root_path + '.rubocop.yml'
147
+ possible_config_paths = [project_path, fallback_pathname.to_s]
148
+ possible_config_paths.detect { |path| File.exist?(path) }
149
+ end
130
150
  end
131
151
 
132
152
  def excluded_file?(filename)
@@ -217,9 +217,8 @@ module RubyLanguageServer
217
217
  def updated_diagnostics_for_codefile(code_file)
218
218
  # Maybe we should be sharing this GoodCop across instances
219
219
  RubyLanguageServer.logger.debug("updated_diagnostics_for_codefile: #{code_file.uri}")
220
- @good_cop ||= GoodCop.new
221
220
  project_relative_filename = filename_relative_to_project(code_file.uri)
222
- code_file.diagnostics = @good_cop.diagnostics(code_file.text, project_relative_filename)
221
+ code_file.diagnostics = GoodCop.instance.diagnostics(code_file.text, project_relative_filename)
223
222
  RubyLanguageServer.logger.debug("code_file.diagnostics: #{code_file.diagnostics}")
224
223
  code_file.diagnostics
225
224
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RubyLanguageServer
4
- VERSION = '0.3.10'
4
+ VERSION = '0.3.11'
5
5
  end
@@ -52,7 +52,7 @@ Gem::Specification.new do |spec|
52
52
  spec.add_development_dependency 'guard'
53
53
  spec.add_development_dependency 'guard-minitest'
54
54
  spec.add_development_dependency 'guard-rubocop'
55
- spec.add_development_dependency 'minitest', '~>5.11'
55
+ spec.add_development_dependency 'minitest', '5.13.0' # Very exact verion matching the one in gem_installer.rb because of runtime gem version conflicts
56
56
  spec.add_development_dependency 'minitest-color'
57
57
  spec.add_development_dependency 'pry'
58
58
  spec.add_development_dependency 'pry-byebug'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_language_server
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.10
4
+ version: 0.3.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kurt Werle
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-01-24 00:00:00.000000000 Z
11
+ date: 2020-01-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -196,16 +196,16 @@ dependencies:
196
196
  name: minitest
197
197
  requirement: !ruby/object:Gem::Requirement
198
198
  requirements:
199
- - - "~>"
199
+ - - '='
200
200
  - !ruby/object:Gem::Version
201
- version: '5.11'
201
+ version: 5.13.0
202
202
  type: :development
203
203
  prerelease: false
204
204
  version_requirements: !ruby/object:Gem::Requirement
205
205
  requirements:
206
- - - "~>"
206
+ - - '='
207
207
  - !ruby/object:Gem::Version
208
- version: '5.11'
208
+ version: 5.13.0
209
209
  - !ruby/object:Gem::Dependency
210
210
  name: minitest-color
211
211
  requirement: !ruby/object:Gem::Requirement