ruby_language_server 0.3.18 → 0.4.2
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/CHANGELOG.txt +16 -0
- data/Gemfile.lock +111 -71
- data/Guardfile +1 -1
- data/lib/config/initializers/active_record.rb +10 -8
- data/lib/ruby_language_server/application.rb +0 -1
- data/lib/ruby_language_server/io.rb +2 -2
- data/lib/ruby_language_server/project_manager.rb +14 -23
- data/lib/ruby_language_server/scope_data/scope.rb +1 -1
- data/lib/ruby_language_server/server.rb +2 -6
- data/lib/ruby_language_server/version.rb +1 -1
- data/ruby_language_server.gemspec +10 -13
- metadata +64 -55
- data/lib/resources/fallback_rubocop.yml +0 -2
- data/lib/ruby_language_server/good_cop.rb +0 -172
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c147d20c737d5ee363a4d645a57a909d72387982e7f7f62eb7b440f5bc12f4be
|
4
|
+
data.tar.gz: f61b4d860cf155d8eab9b3e72c9446f3c3c57d5fe17f2304f6c75cab89ef01f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 87e60a0f25d911eb4a60b7cb37b3c50784d82bf3c4479bd91a15d2758382434334e43508fc8dd72a69649f31fa32a26d8c8940a18f8864ab4e442c03b16991dd
|
7
|
+
data.tar.gz: 5e7efae883dc54a1627738a0ea41a477b603d9f387b28af09d90247170a7f4ff62f10f10a63618e09cc6ce7bb0f4401727f25bb8d24d2110bfa851a075345836
|
data/CHANGELOG.txt
CHANGED
@@ -1,5 +1,21 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
#### 0.4.2 Sat Aug 2 09:20:41 PDT 2025
|
4
|
+
|
5
|
+
* Update thor (security advisory)
|
6
|
+
|
7
|
+
#### 0.4.1 Mon May 12 20:49:11 PDT 2025
|
8
|
+
|
9
|
+
* Update ruby
|
10
|
+
* Update rails
|
11
|
+
* Add autopublish
|
12
|
+
* tweak extension loading to address bug - maybe
|
13
|
+
|
14
|
+
#### 0.4.0 Fri May 9 22:33:03 PDT 2025
|
15
|
+
|
16
|
+
* Ditch rubocop - it has its own LSP
|
17
|
+
* Also update rails version
|
18
|
+
|
3
19
|
#### 0.3.18 Tue Sep 10 20:10:21 PDT 2024
|
4
20
|
|
5
21
|
* bump dependencies
|
data/Gemfile.lock
CHANGED
@@ -1,51 +1,67 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ruby_language_server (0.
|
5
|
-
activerecord (~>
|
4
|
+
ruby_language_server (0.4.2)
|
5
|
+
activerecord (~> 8.0)
|
6
6
|
amatch
|
7
7
|
bundler
|
8
8
|
etc
|
9
9
|
fuzzy_match
|
10
10
|
json
|
11
|
-
|
12
|
-
|
13
|
-
rubocop-performance
|
14
|
-
rubocop-rspec
|
15
|
-
sqlite3 (< 1.5.0)
|
11
|
+
ostruct
|
12
|
+
sqlite3
|
16
13
|
|
17
14
|
GEM
|
18
15
|
remote: https://rubygems.org/
|
19
16
|
specs:
|
20
|
-
activemodel (
|
21
|
-
activesupport (=
|
22
|
-
activerecord (
|
23
|
-
activemodel (=
|
24
|
-
activesupport (=
|
25
|
-
|
26
|
-
|
17
|
+
activemodel (8.0.2)
|
18
|
+
activesupport (= 8.0.2)
|
19
|
+
activerecord (8.0.2)
|
20
|
+
activemodel (= 8.0.2)
|
21
|
+
activesupport (= 8.0.2)
|
22
|
+
timeout (>= 0.4.0)
|
23
|
+
activesupport (8.0.2)
|
24
|
+
base64
|
25
|
+
benchmark (>= 0.3)
|
26
|
+
bigdecimal
|
27
|
+
concurrent-ruby (~> 1.0, >= 1.3.1)
|
28
|
+
connection_pool (>= 2.2.5)
|
29
|
+
drb
|
27
30
|
i18n (>= 1.6, < 2)
|
31
|
+
logger (>= 1.4.2)
|
28
32
|
minitest (>= 5.1)
|
29
|
-
|
30
|
-
|
33
|
+
securerandom (>= 0.3)
|
34
|
+
tzinfo (~> 2.0, >= 2.0.5)
|
35
|
+
uri (>= 0.13.1)
|
36
|
+
amatch (0.4.2)
|
31
37
|
mize
|
32
38
|
tins (~> 1.0)
|
33
39
|
ansi (1.5.0)
|
34
|
-
ast (2.4.
|
35
|
-
|
36
|
-
|
40
|
+
ast (2.4.3)
|
41
|
+
base64 (0.2.0)
|
42
|
+
benchmark (0.4.0)
|
43
|
+
bigdecimal (3.1.9)
|
44
|
+
builder (3.3.0)
|
37
45
|
coderay (1.1.3)
|
38
|
-
concurrent-ruby (1.
|
39
|
-
|
40
|
-
|
46
|
+
concurrent-ruby (1.3.5)
|
47
|
+
connection_pool (2.5.3)
|
48
|
+
debug (1.10.0)
|
49
|
+
irb (~> 1.10)
|
50
|
+
reline (>= 0.3.8)
|
51
|
+
drb (2.2.1)
|
52
|
+
etc (1.4.5)
|
53
|
+
ffi (1.17.2-aarch64-linux-musl)
|
54
|
+
ffi (1.17.2-x86_64-linux-gnu)
|
41
55
|
formatador (1.1.0)
|
42
56
|
fuzzy_match (2.1.0)
|
43
|
-
guard (2.
|
57
|
+
guard (2.19.1)
|
44
58
|
formatador (>= 0.2.4)
|
45
59
|
listen (>= 2.7, < 4.0)
|
60
|
+
logger (~> 1.6)
|
46
61
|
lumberjack (>= 1.0.12, < 2.0)
|
47
62
|
nenv (~> 0.1)
|
48
63
|
notiffany (~> 0.0)
|
64
|
+
ostruct (~> 0.6)
|
49
65
|
pry (>= 0.13.0)
|
50
66
|
shellany (~> 0.0)
|
51
67
|
thor (>= 0.18.1)
|
@@ -56,96 +72,120 @@ GEM
|
|
56
72
|
guard-rubocop (1.5.0)
|
57
73
|
guard (~> 2.0)
|
58
74
|
rubocop (< 2.0)
|
59
|
-
i18n (1.14.
|
75
|
+
i18n (1.14.7)
|
60
76
|
concurrent-ruby (~> 1.0)
|
61
|
-
|
62
|
-
|
77
|
+
io-console (0.7.1)
|
78
|
+
irb (1.13.1)
|
79
|
+
rdoc (>= 4.0.0)
|
80
|
+
reline (>= 0.4.2)
|
81
|
+
json (2.11.3)
|
82
|
+
language_server-protocol (3.17.0.4)
|
83
|
+
lint_roller (1.1.0)
|
84
|
+
listen (3.9.0)
|
63
85
|
rb-fsevent (~> 0.10, >= 0.10.3)
|
64
86
|
rb-inotify (~> 0.9, >= 0.9.10)
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
minitest
|
87
|
+
logger (1.7.0)
|
88
|
+
lumberjack (1.2.10)
|
89
|
+
method_source (1.1.0)
|
90
|
+
minitest (5.25.5)
|
91
|
+
minitest-reporters (1.7.1)
|
69
92
|
ansi
|
70
93
|
builder
|
71
94
|
minitest (>= 5.0)
|
72
95
|
ruby-progressbar
|
73
|
-
mize (0.
|
74
|
-
protocol (~> 2.0)
|
96
|
+
mize (0.6.1)
|
75
97
|
nenv (0.3.0)
|
76
98
|
notiffany (0.1.3)
|
77
99
|
nenv (~> 0.1)
|
78
100
|
shellany (~> 0.0)
|
79
|
-
|
80
|
-
|
101
|
+
ostruct (0.6.1)
|
102
|
+
parallel (1.27.0)
|
103
|
+
parser (3.3.8.0)
|
81
104
|
ast (~> 2.4.1)
|
82
105
|
racc
|
83
|
-
|
84
|
-
|
85
|
-
pry (0.14.1)
|
106
|
+
prism (1.4.0)
|
107
|
+
pry (0.15.2)
|
86
108
|
coderay (~> 1.1)
|
87
109
|
method_source (~> 1.0)
|
110
|
+
psych (5.1.2)
|
111
|
+
stringio
|
88
112
|
racc (1.8.1)
|
89
113
|
rainbow (3.1.1)
|
90
|
-
rake (13.
|
114
|
+
rake (13.2.1)
|
91
115
|
rb-fsevent (0.11.2)
|
92
|
-
rb-inotify (0.
|
116
|
+
rb-inotify (0.11.1)
|
93
117
|
ffi (~> 1.0)
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
118
|
+
rdoc (6.6.3.1)
|
119
|
+
psych (>= 4.0.0)
|
120
|
+
regexp_parser (2.10.0)
|
121
|
+
reline (0.5.10)
|
122
|
+
io-console (~> 0.5)
|
123
|
+
rubocop (1.75.5)
|
98
124
|
json (~> 2.3)
|
125
|
+
language_server-protocol (~> 3.17.0.2)
|
126
|
+
lint_roller (~> 1.1.0)
|
99
127
|
parallel (~> 1.10)
|
100
|
-
parser (>= 3.
|
128
|
+
parser (>= 3.3.0.2)
|
101
129
|
rainbow (>= 2.2.2, < 4.0)
|
102
|
-
regexp_parser (>=
|
103
|
-
|
104
|
-
rubocop-ast (>= 1.24.1, < 2.0)
|
130
|
+
regexp_parser (>= 2.9.3, < 3.0)
|
131
|
+
rubocop-ast (>= 1.44.0, < 2.0)
|
105
132
|
ruby-progressbar (~> 1.7)
|
106
|
-
unicode-display_width (>=
|
107
|
-
rubocop-ast (1.
|
108
|
-
parser (>= 3.3.
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
rubocop (>= 1.
|
114
|
-
|
115
|
-
|
116
|
-
rubocop (
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
133
|
+
unicode-display_width (>= 2.4.0, < 4.0)
|
134
|
+
rubocop-ast (1.44.1)
|
135
|
+
parser (>= 3.3.7.2)
|
136
|
+
prism (~> 1.4)
|
137
|
+
rubocop-minitest (0.38.0)
|
138
|
+
lint_roller (~> 1.1)
|
139
|
+
rubocop (>= 1.75.0, < 2.0)
|
140
|
+
rubocop-ast (>= 1.38.0, < 2.0)
|
141
|
+
rubocop-performance (1.25.0)
|
142
|
+
lint_roller (~> 1.1)
|
143
|
+
rubocop (>= 1.75.0, < 2.0)
|
144
|
+
rubocop-ast (>= 1.38.0, < 2.0)
|
145
|
+
rubocop-rake (0.7.1)
|
146
|
+
lint_roller (~> 1.1)
|
147
|
+
rubocop (>= 1.72.1)
|
148
|
+
rubocop-rspec (3.6.0)
|
149
|
+
lint_roller (~> 1.1)
|
150
|
+
rubocop (~> 1.72, >= 1.72.1)
|
151
|
+
ruby-progressbar (1.13.0)
|
152
|
+
securerandom (0.4.1)
|
123
153
|
shellany (0.0.1)
|
124
|
-
sqlite3 (
|
125
|
-
|
154
|
+
sqlite3 (2.6.0-aarch64-linux-musl)
|
155
|
+
sqlite3 (2.6.0-x86_64-linux-gnu)
|
156
|
+
stringio (3.1.1)
|
126
157
|
sync (0.5.0)
|
127
|
-
thor (1.
|
128
|
-
|
158
|
+
thor (1.4.0)
|
159
|
+
timeout (0.4.3)
|
160
|
+
tins (1.38.0)
|
161
|
+
bigdecimal
|
129
162
|
sync
|
130
163
|
tzinfo (2.0.6)
|
131
164
|
concurrent-ruby (~> 1.0)
|
132
|
-
unicode-display_width (
|
165
|
+
unicode-display_width (3.1.4)
|
166
|
+
unicode-emoji (~> 4.0, >= 4.0.4)
|
167
|
+
unicode-emoji (4.0.4)
|
168
|
+
uri (1.0.3)
|
133
169
|
|
134
170
|
PLATFORMS
|
135
171
|
aarch64-linux-musl
|
136
172
|
x86_64-linux
|
137
173
|
|
138
174
|
DEPENDENCIES
|
139
|
-
|
175
|
+
debug
|
140
176
|
guard
|
141
177
|
guard-minitest
|
142
178
|
guard-rubocop
|
143
179
|
minitest
|
144
180
|
minitest-reporters
|
145
181
|
rake
|
182
|
+
rubocop (> 1.38.0)
|
183
|
+
rubocop-ast (> 1.32.0)
|
146
184
|
rubocop-minitest
|
185
|
+
rubocop-performance
|
147
186
|
rubocop-rake
|
187
|
+
rubocop-rspec
|
148
188
|
ruby_language_server!
|
149
189
|
|
150
190
|
BUNDLED WITH
|
151
|
-
2.
|
191
|
+
2.6.8
|
data/Guardfile
CHANGED
@@ -25,7 +25,7 @@ group :red_green_refactor, halt_on_fail: true do
|
|
25
25
|
# watch(%r{^test/test_helper\.rb$}) { 'test' }
|
26
26
|
|
27
27
|
# with Minitest::Spec
|
28
|
-
watch(%r{^spec
|
28
|
+
watch(%r{^spec/*/(.*)_spec\.rb$})
|
29
29
|
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
|
30
30
|
watch(%r{^spec/spec_helper\.rb$}) { 'spec' }
|
31
31
|
end
|
@@ -7,15 +7,17 @@ ActiveRecord::Base.establish_connection(
|
|
7
7
|
timeout: 30.seconds # does not seem to help
|
8
8
|
)
|
9
9
|
|
10
|
-
|
11
|
-
database.
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
10
|
+
ActiveSupport.on_load(:active_record) do
|
11
|
+
database = ActiveRecord::Base.connection.raw_connection
|
12
|
+
database.enable_load_extension(1)
|
13
|
+
if Gem.win_platform?
|
14
|
+
# load DLL from PATH
|
15
|
+
database.load_extension('liblevenshtein.dll')
|
16
|
+
else
|
17
|
+
database.load_extension('/usr/local/lib/liblevenshtein.so.0.0.0')
|
18
|
+
end
|
19
|
+
database.enable_load_extension(0)
|
17
20
|
end
|
18
|
-
database.enable_load_extension(0)
|
19
21
|
|
20
22
|
if ENV['LOG_LEVEL'] == 'DEBUG'
|
21
23
|
begin
|
@@ -13,7 +13,7 @@ module RubyLanguageServer
|
|
13
13
|
return_response(id, response, $stdout) unless id.nil?
|
14
14
|
rescue SignalException => e
|
15
15
|
RubyLanguageServer.logger.error "We received a signal. Let's bail: #{e}"
|
16
|
-
exit
|
16
|
+
exit
|
17
17
|
rescue Exception => e
|
18
18
|
RubyLanguageServer.logger.error "Something when horribly wrong: #{e}"
|
19
19
|
backtrace = e.backtrace * "\n"
|
@@ -69,7 +69,7 @@ module RubyLanguageServer
|
|
69
69
|
retry unless retries <= 0
|
70
70
|
end
|
71
71
|
end
|
72
|
-
exit
|
72
|
+
exit if response == 'EXIT'
|
73
73
|
[id, response]
|
74
74
|
else
|
75
75
|
RubyLanguageServer.logger.warn "SERVER DOES NOT RESPOND TO #{method_name}"
|
@@ -49,22 +49,13 @@ module RubyLanguageServer
|
|
49
49
|
|
50
50
|
@root_uri = "file://#{path}"
|
51
51
|
# This is {uri: code_file} where content stuff is like
|
52
|
-
@additional_gems_installed = false
|
53
|
-
@additional_gem_mutex = Mutex.new
|
52
|
+
# @additional_gems_installed = false
|
53
|
+
# @additional_gem_mutex = Mutex.new
|
54
54
|
end
|
55
55
|
|
56
|
-
def diagnostics_ready?
|
57
|
-
|
58
|
-
end
|
59
|
-
|
60
|
-
def install_additional_gems(gem_names)
|
61
|
-
Thread.new do
|
62
|
-
RubyLanguageServer::GemInstaller.install_gems(gem_names)
|
63
|
-
@additional_gem_mutex.synchronize { @additional_gems_installed = true }
|
64
|
-
rescue StandardError => e
|
65
|
-
RubyLanguageServer.logger.error("Issue installing rubocop gems: #{e} #{e.backtrace}")
|
66
|
-
end
|
67
|
-
end
|
56
|
+
# def diagnostics_ready?
|
57
|
+
# @additional_gem_mutex.synchronize { @additional_gems_installed }
|
58
|
+
# end
|
68
59
|
|
69
60
|
def text_for_uri(uri)
|
70
61
|
code_file = code_file_for_uri(uri)
|
@@ -219,17 +210,17 @@ module RubyLanguageServer
|
|
219
210
|
return code_file.diagnostics if code_file.text == text
|
220
211
|
|
221
212
|
code_file.update_text(text)
|
222
|
-
diagnostics_ready? ? updated_diagnostics_for_codefile(code_file) : []
|
213
|
+
# diagnostics_ready? ? updated_diagnostics_for_codefile(code_file) : []
|
223
214
|
end
|
224
215
|
|
225
|
-
def updated_diagnostics_for_codefile(code_file)
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
end
|
216
|
+
# def updated_diagnostics_for_codefile(code_file)
|
217
|
+
# # Maybe we should be sharing this GoodCop across instances
|
218
|
+
# RubyLanguageServer.logger.debug("updated_diagnostics_for_codefile: #{code_file.uri}")
|
219
|
+
# project_relative_filename = filename_relative_to_project(code_file.uri)
|
220
|
+
# # code_file.diagnostics = GoodCop.instance&.diagnostics(code_file.text, project_relative_filename)
|
221
|
+
# RubyLanguageServer.logger.debug("code_file.diagnostics: #{code_file.diagnostics}")
|
222
|
+
# code_file.diagnostics
|
223
|
+
# end
|
233
224
|
|
234
225
|
# Returns the context of what is being typed in the given line
|
235
226
|
def context_at_location(uri, position)
|
@@ -25,7 +25,7 @@ module RubyLanguageServer
|
|
25
25
|
# attr_accessor :superclass_name # superclass name
|
26
26
|
|
27
27
|
def self.build(parent = nil, type = TYPE_ROOT, name = '', top_line = 1, column = 1)
|
28
|
-
full_name = [parent
|
28
|
+
full_name = [parent&.full_name, name].compact.join(JoinHash[type])
|
29
29
|
create!(
|
30
30
|
parent:,
|
31
31
|
top_line:,
|
@@ -5,6 +5,7 @@ require 'json'
|
|
5
5
|
# Deal with the various languageserver calls.
|
6
6
|
module RubyLanguageServer
|
7
7
|
class Server
|
8
|
+
Position = Struct.new('Position', :line, :character)
|
8
9
|
attr_accessor :io
|
9
10
|
|
10
11
|
def initialize(mutex)
|
@@ -18,9 +19,6 @@ module RubyLanguageServer
|
|
18
19
|
root_uri = params['rootUri']
|
19
20
|
@project_manager = ProjectManager.new(root_path, root_uri)
|
20
21
|
@project_manager.scan_all_project_files
|
21
|
-
gem_string = ENV.fetch('ADDITIONAL_GEMS', nil)
|
22
|
-
gem_array = (gem_string.split(',').compact.map(&:strip).reject { |string| string == '' } if gem_string && !gem_string.empty?)
|
23
|
-
@project_manager.install_additional_gems(gem_array)
|
24
22
|
{
|
25
23
|
capabilities: {
|
26
24
|
textDocumentSync: 1,
|
@@ -124,11 +122,9 @@ module RubyLanguageServer
|
|
124
122
|
textDocument['uri']
|
125
123
|
end
|
126
124
|
|
127
|
-
Position = Struct.new('Position', :line, :character)
|
128
|
-
|
129
125
|
def postition_from_params(params)
|
130
126
|
position = params['position']
|
131
|
-
Position.new(
|
127
|
+
Position.new(position['line'].to_i, position['character'].to_i)
|
132
128
|
end
|
133
129
|
end
|
134
130
|
end
|
@@ -35,30 +35,27 @@ Gem::Specification.new do |spec|
|
|
35
35
|
spec.require_paths = ['lib']
|
36
36
|
|
37
37
|
# Normally the system will have these - but not if it's a stripped down docker image
|
38
|
+
spec.add_dependency 'activerecord', '~>8.0'
|
39
|
+
spec.add_dependency 'amatch' # in c
|
38
40
|
spec.add_dependency 'bundler'
|
39
41
|
spec.add_dependency 'etc'
|
40
|
-
spec.add_dependency 'json'
|
41
|
-
|
42
|
-
# No - do not put these in dev - they are needed for the app
|
43
|
-
spec.add_dependency 'rubocop', '>1.38.0' # Something broke in 1.38.0. Move to rubocop --server?
|
44
|
-
spec.add_dependency 'rubocop-ast', '>1.32.0' # Something broke in 1.38.0. Move to rubocop --server?
|
45
|
-
spec.add_dependency 'rubocop-performance' # Linter - no longer needed - use additional gems?
|
46
|
-
spec.add_dependency 'rubocop-rspec' # Linter - no longer needed - use additional gems?
|
47
|
-
|
48
|
-
spec.add_dependency 'amatch' # in c
|
49
42
|
spec.add_dependency 'fuzzy_match' # completion matching
|
43
|
+
spec.add_dependency 'json'
|
44
|
+
spec.add_dependency 'ostruct'
|
45
|
+
spec.add_dependency 'sqlite3'
|
50
46
|
|
51
|
-
spec.
|
52
|
-
spec.add_dependency 'sqlite3', '<1.5.0' # 1.5.0 breaks in docker M1 at least
|
53
|
-
|
54
|
-
spec.add_development_dependency 'byebug'
|
47
|
+
spec.add_development_dependency 'debug'
|
55
48
|
spec.add_development_dependency 'guard'
|
56
49
|
spec.add_development_dependency 'guard-minitest'
|
57
50
|
spec.add_development_dependency 'guard-rubocop'
|
58
51
|
spec.add_development_dependency 'minitest'
|
59
52
|
spec.add_development_dependency 'minitest-reporters'
|
60
53
|
spec.add_development_dependency 'rake' # required by guard :-(
|
54
|
+
spec.add_development_dependency 'rubocop', '>1.38.0' # Something broke in 1.38.0. Move to rubocop --server?
|
55
|
+
spec.add_development_dependency 'rubocop-ast', '>1.32.0' # Something broke in 1.38.0. Move to rubocop --server?
|
61
56
|
spec.add_development_dependency 'rubocop-minitest'
|
57
|
+
spec.add_development_dependency 'rubocop-performance' # Linter - no longer needed - use additional gems?
|
62
58
|
spec.add_development_dependency 'rubocop-rake'
|
59
|
+
spec.add_development_dependency 'rubocop-rspec' # Linter - no longer needed - use additional gems?
|
63
60
|
spec.metadata['rubygems_mfa_required'] = 'true'
|
64
61
|
end
|
metadata
CHANGED
@@ -1,31 +1,30 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby_language_server
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kurt Werle
|
8
|
-
autorequire:
|
9
8
|
bindir: exe
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
13
|
+
name: activerecord
|
15
14
|
requirement: !ruby/object:Gem::Requirement
|
16
15
|
requirements:
|
17
|
-
- - "
|
16
|
+
- - "~>"
|
18
17
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
18
|
+
version: '8.0'
|
20
19
|
type: :runtime
|
21
20
|
prerelease: false
|
22
21
|
version_requirements: !ruby/object:Gem::Requirement
|
23
22
|
requirements:
|
24
|
-
- - "
|
23
|
+
- - "~>"
|
25
24
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
25
|
+
version: '8.0'
|
27
26
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
27
|
+
name: amatch
|
29
28
|
requirement: !ruby/object:Gem::Requirement
|
30
29
|
requirements:
|
31
30
|
- - ">="
|
@@ -39,7 +38,7 @@ dependencies:
|
|
39
38
|
- !ruby/object:Gem::Version
|
40
39
|
version: '0'
|
41
40
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
41
|
+
name: bundler
|
43
42
|
requirement: !ruby/object:Gem::Requirement
|
44
43
|
requirements:
|
45
44
|
- - ">="
|
@@ -53,35 +52,35 @@ dependencies:
|
|
53
52
|
- !ruby/object:Gem::Version
|
54
53
|
version: '0'
|
55
54
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
55
|
+
name: etc
|
57
56
|
requirement: !ruby/object:Gem::Requirement
|
58
57
|
requirements:
|
59
|
-
- - "
|
58
|
+
- - ">="
|
60
59
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
60
|
+
version: '0'
|
62
61
|
type: :runtime
|
63
62
|
prerelease: false
|
64
63
|
version_requirements: !ruby/object:Gem::Requirement
|
65
64
|
requirements:
|
66
|
-
- - "
|
65
|
+
- - ">="
|
67
66
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
67
|
+
version: '0'
|
69
68
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
69
|
+
name: fuzzy_match
|
71
70
|
requirement: !ruby/object:Gem::Requirement
|
72
71
|
requirements:
|
73
|
-
- - "
|
72
|
+
- - ">="
|
74
73
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
74
|
+
version: '0'
|
76
75
|
type: :runtime
|
77
76
|
prerelease: false
|
78
77
|
version_requirements: !ruby/object:Gem::Requirement
|
79
78
|
requirements:
|
80
|
-
- - "
|
79
|
+
- - ">="
|
81
80
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
81
|
+
version: '0'
|
83
82
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
83
|
+
name: json
|
85
84
|
requirement: !ruby/object:Gem::Requirement
|
86
85
|
requirements:
|
87
86
|
- - ">="
|
@@ -95,7 +94,7 @@ dependencies:
|
|
95
94
|
- !ruby/object:Gem::Version
|
96
95
|
version: '0'
|
97
96
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
97
|
+
name: ostruct
|
99
98
|
requirement: !ruby/object:Gem::Requirement
|
100
99
|
requirements:
|
101
100
|
- - ">="
|
@@ -109,7 +108,7 @@ dependencies:
|
|
109
108
|
- !ruby/object:Gem::Version
|
110
109
|
version: '0'
|
111
110
|
- !ruby/object:Gem::Dependency
|
112
|
-
name:
|
111
|
+
name: sqlite3
|
113
112
|
requirement: !ruby/object:Gem::Requirement
|
114
113
|
requirements:
|
115
114
|
- - ">="
|
@@ -123,13 +122,13 @@ dependencies:
|
|
123
122
|
- !ruby/object:Gem::Version
|
124
123
|
version: '0'
|
125
124
|
- !ruby/object:Gem::Dependency
|
126
|
-
name:
|
125
|
+
name: debug
|
127
126
|
requirement: !ruby/object:Gem::Requirement
|
128
127
|
requirements:
|
129
128
|
- - ">="
|
130
129
|
- !ruby/object:Gem::Version
|
131
130
|
version: '0'
|
132
|
-
type: :
|
131
|
+
type: :development
|
133
132
|
prerelease: false
|
134
133
|
version_requirements: !ruby/object:Gem::Requirement
|
135
134
|
requirements:
|
@@ -137,35 +136,35 @@ dependencies:
|
|
137
136
|
- !ruby/object:Gem::Version
|
138
137
|
version: '0'
|
139
138
|
- !ruby/object:Gem::Dependency
|
140
|
-
name:
|
139
|
+
name: guard
|
141
140
|
requirement: !ruby/object:Gem::Requirement
|
142
141
|
requirements:
|
143
|
-
- - "
|
142
|
+
- - ">="
|
144
143
|
- !ruby/object:Gem::Version
|
145
|
-
version: '
|
146
|
-
type: :
|
144
|
+
version: '0'
|
145
|
+
type: :development
|
147
146
|
prerelease: false
|
148
147
|
version_requirements: !ruby/object:Gem::Requirement
|
149
148
|
requirements:
|
150
|
-
- - "
|
149
|
+
- - ">="
|
151
150
|
- !ruby/object:Gem::Version
|
152
|
-
version: '
|
151
|
+
version: '0'
|
153
152
|
- !ruby/object:Gem::Dependency
|
154
|
-
name:
|
153
|
+
name: guard-minitest
|
155
154
|
requirement: !ruby/object:Gem::Requirement
|
156
155
|
requirements:
|
157
|
-
- - "
|
156
|
+
- - ">="
|
158
157
|
- !ruby/object:Gem::Version
|
159
|
-
version:
|
160
|
-
type: :
|
158
|
+
version: '0'
|
159
|
+
type: :development
|
161
160
|
prerelease: false
|
162
161
|
version_requirements: !ruby/object:Gem::Requirement
|
163
162
|
requirements:
|
164
|
-
- - "
|
163
|
+
- - ">="
|
165
164
|
- !ruby/object:Gem::Version
|
166
|
-
version:
|
165
|
+
version: '0'
|
167
166
|
- !ruby/object:Gem::Dependency
|
168
|
-
name:
|
167
|
+
name: guard-rubocop
|
169
168
|
requirement: !ruby/object:Gem::Requirement
|
170
169
|
requirements:
|
171
170
|
- - ">="
|
@@ -179,7 +178,7 @@ dependencies:
|
|
179
178
|
- !ruby/object:Gem::Version
|
180
179
|
version: '0'
|
181
180
|
- !ruby/object:Gem::Dependency
|
182
|
-
name:
|
181
|
+
name: minitest
|
183
182
|
requirement: !ruby/object:Gem::Requirement
|
184
183
|
requirements:
|
185
184
|
- - ">="
|
@@ -193,7 +192,7 @@ dependencies:
|
|
193
192
|
- !ruby/object:Gem::Version
|
194
193
|
version: '0'
|
195
194
|
- !ruby/object:Gem::Dependency
|
196
|
-
name:
|
195
|
+
name: minitest-reporters
|
197
196
|
requirement: !ruby/object:Gem::Requirement
|
198
197
|
requirements:
|
199
198
|
- - ">="
|
@@ -207,7 +206,7 @@ dependencies:
|
|
207
206
|
- !ruby/object:Gem::Version
|
208
207
|
version: '0'
|
209
208
|
- !ruby/object:Gem::Dependency
|
210
|
-
name:
|
209
|
+
name: rake
|
211
210
|
requirement: !ruby/object:Gem::Requirement
|
212
211
|
requirements:
|
213
212
|
- - ">="
|
@@ -221,21 +220,35 @@ dependencies:
|
|
221
220
|
- !ruby/object:Gem::Version
|
222
221
|
version: '0'
|
223
222
|
- !ruby/object:Gem::Dependency
|
224
|
-
name:
|
223
|
+
name: rubocop
|
225
224
|
requirement: !ruby/object:Gem::Requirement
|
226
225
|
requirements:
|
227
|
-
- - "
|
226
|
+
- - ">"
|
228
227
|
- !ruby/object:Gem::Version
|
229
|
-
version:
|
228
|
+
version: 1.38.0
|
230
229
|
type: :development
|
231
230
|
prerelease: false
|
232
231
|
version_requirements: !ruby/object:Gem::Requirement
|
233
232
|
requirements:
|
234
|
-
- - "
|
233
|
+
- - ">"
|
235
234
|
- !ruby/object:Gem::Version
|
236
|
-
version:
|
235
|
+
version: 1.38.0
|
237
236
|
- !ruby/object:Gem::Dependency
|
238
|
-
name:
|
237
|
+
name: rubocop-ast
|
238
|
+
requirement: !ruby/object:Gem::Requirement
|
239
|
+
requirements:
|
240
|
+
- - ">"
|
241
|
+
- !ruby/object:Gem::Version
|
242
|
+
version: 1.32.0
|
243
|
+
type: :development
|
244
|
+
prerelease: false
|
245
|
+
version_requirements: !ruby/object:Gem::Requirement
|
246
|
+
requirements:
|
247
|
+
- - ">"
|
248
|
+
- !ruby/object:Gem::Version
|
249
|
+
version: 1.32.0
|
250
|
+
- !ruby/object:Gem::Dependency
|
251
|
+
name: rubocop-minitest
|
239
252
|
requirement: !ruby/object:Gem::Requirement
|
240
253
|
requirements:
|
241
254
|
- - ">="
|
@@ -249,7 +262,7 @@ dependencies:
|
|
249
262
|
- !ruby/object:Gem::Version
|
250
263
|
version: '0'
|
251
264
|
- !ruby/object:Gem::Dependency
|
252
|
-
name:
|
265
|
+
name: rubocop-performance
|
253
266
|
requirement: !ruby/object:Gem::Requirement
|
254
267
|
requirements:
|
255
268
|
- - ">="
|
@@ -263,7 +276,7 @@ dependencies:
|
|
263
276
|
- !ruby/object:Gem::Version
|
264
277
|
version: '0'
|
265
278
|
- !ruby/object:Gem::Dependency
|
266
|
-
name: rubocop-
|
279
|
+
name: rubocop-rake
|
267
280
|
requirement: !ruby/object:Gem::Requirement
|
268
281
|
requirements:
|
269
282
|
- - ">="
|
@@ -277,7 +290,7 @@ dependencies:
|
|
277
290
|
- !ruby/object:Gem::Version
|
278
291
|
version: '0'
|
279
292
|
- !ruby/object:Gem::Dependency
|
280
|
-
name: rubocop-
|
293
|
+
name: rubocop-rspec
|
281
294
|
requirement: !ruby/object:Gem::Requirement
|
282
295
|
requirements:
|
283
296
|
- - ">="
|
@@ -315,13 +328,11 @@ files:
|
|
315
328
|
- lib/config/initializers/active_record.rb
|
316
329
|
- lib/config/initializers/sqlite.rb
|
317
330
|
- lib/db/schema.rb
|
318
|
-
- lib/resources/fallback_rubocop.yml
|
319
331
|
- lib/ruby_language_server.rb
|
320
332
|
- lib/ruby_language_server/application.rb
|
321
333
|
- lib/ruby_language_server/code_file.rb
|
322
334
|
- lib/ruby_language_server/completion.rb
|
323
335
|
- lib/ruby_language_server/gem_installer.rb
|
324
|
-
- lib/ruby_language_server/good_cop.rb
|
325
336
|
- lib/ruby_language_server/io.rb
|
326
337
|
- lib/ruby_language_server/line_context.rb
|
327
338
|
- lib/ruby_language_server/location.rb
|
@@ -347,7 +358,6 @@ metadata:
|
|
347
358
|
source_code_uri: https://github.com/kwerle/ruby_language_server
|
348
359
|
changelog_uri: https://github.com/kwerle/ruby_language_server/blob/develop/CHANGELOG.txt
|
349
360
|
rubygems_mfa_required: 'true'
|
350
|
-
post_install_message:
|
351
361
|
rdoc_options: []
|
352
362
|
require_paths:
|
353
363
|
- lib
|
@@ -362,8 +372,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
362
372
|
- !ruby/object:Gem::Version
|
363
373
|
version: '0'
|
364
374
|
requirements: []
|
365
|
-
rubygems_version: 3.
|
366
|
-
signing_key:
|
375
|
+
rubygems_version: 3.6.9
|
367
376
|
specification_version: 4
|
368
377
|
summary: Provide a language server implementation for ruby in ruby.
|
369
378
|
test_files: []
|
@@ -1,172 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'rubocop'
|
4
|
-
|
5
|
-
module RubyLanguageServer
|
6
|
-
class GoodCop < RuboCop::Runner
|
7
|
-
def initialize(config_path, initialization_error = nil)
|
8
|
-
@initialization_error = initialization_error
|
9
|
-
unless @initialization_error
|
10
|
-
initialize_rubocop_ivars
|
11
|
-
@config_store.options_config = config_path
|
12
|
-
RubyLanguageServer.logger.debug("Rubocop config_path: #{config_path}")
|
13
|
-
super({}, @config_store)
|
14
|
-
end
|
15
|
-
rescue Exception => e
|
16
|
-
RubyLanguageServer.logger.error(e)
|
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?"
|
18
|
-
end
|
19
|
-
|
20
|
-
# namespace DiagnosticSeverity {
|
21
|
-
# /**
|
22
|
-
# * Reports an error.
|
23
|
-
# */
|
24
|
-
# export const Error = 1;
|
25
|
-
# /**
|
26
|
-
# * Reports a warning.
|
27
|
-
# */
|
28
|
-
# export const Warning = 2;
|
29
|
-
# /**
|
30
|
-
# * Reports an information.
|
31
|
-
# */
|
32
|
-
# export const Information = 3;
|
33
|
-
# /**
|
34
|
-
# * Reports a hint.
|
35
|
-
# */
|
36
|
-
# export const Hint = 4;
|
37
|
-
# }
|
38
|
-
|
39
|
-
# interface Diagnostic {
|
40
|
-
# /**
|
41
|
-
# * The range at which the message applies.
|
42
|
-
# */
|
43
|
-
# range: Range;
|
44
|
-
#
|
45
|
-
# /**
|
46
|
-
# * The diagnostic's severity. Can be omitted. If omitted it is up to the
|
47
|
-
# * client to interpret diagnostics as error, warning, info or hint.
|
48
|
-
# */
|
49
|
-
# severity?: number;
|
50
|
-
#
|
51
|
-
# /**
|
52
|
-
# * The diagnostic's code. Can be omitted.
|
53
|
-
# */
|
54
|
-
# code?: number | string;
|
55
|
-
#
|
56
|
-
# /**
|
57
|
-
# * A human-readable string describing the source of this
|
58
|
-
# * diagnostic, e.g. 'typescript' or 'super lint'.
|
59
|
-
# */
|
60
|
-
# source?: string;
|
61
|
-
#
|
62
|
-
# /**
|
63
|
-
# * The diagnostic's message.
|
64
|
-
# */
|
65
|
-
# message: string;
|
66
|
-
# }
|
67
|
-
|
68
|
-
def diagnostic_severity_for(severity)
|
69
|
-
case severity.to_s
|
70
|
-
when 'error', 'fatal'
|
71
|
-
1
|
72
|
-
when 'warning'
|
73
|
-
2
|
74
|
-
when 'refactor', 'convention'
|
75
|
-
3
|
76
|
-
else
|
77
|
-
RubyLanguageServer.logger.error("Could not map severity for #{severity} - returning 2")
|
78
|
-
2
|
79
|
-
end
|
80
|
-
end
|
81
|
-
|
82
|
-
def diagnostics(text, filename = nil)
|
83
|
-
return initialization_offenses unless @initialization_error.nil?
|
84
|
-
|
85
|
-
maximum_severity = 4 # (ENV['LINT_LEVEL'] || 4).to_i
|
86
|
-
enabled_offenses = offenses(text, filename).reject { |offense| offense.status == :disabled }
|
87
|
-
enabled_offenses.map do |offense|
|
88
|
-
{
|
89
|
-
range: Location.position_hash(offense.location.line, offense.location.column, offense.location.last_line, offense.location.last_column),
|
90
|
-
severity: diagnostic_severity_for(offense.severity),
|
91
|
-
# code?: number | string;
|
92
|
-
code: 'code',
|
93
|
-
source: "RuboCop:#{offense.cop_name}",
|
94
|
-
message: offense.message
|
95
|
-
}
|
96
|
-
end.select { |hash| hash[:severity] <= maximum_severity }
|
97
|
-
end
|
98
|
-
|
99
|
-
private
|
100
|
-
|
101
|
-
def offenses(text, filename)
|
102
|
-
if excluded_file?(filename)
|
103
|
-
[]
|
104
|
-
else
|
105
|
-
ruby_version = 3.1
|
106
|
-
processed_source = RuboCop::ProcessedSource.new(text, ruby_version, filename)
|
107
|
-
offenses = inspect_file(processed_source)
|
108
|
-
offenses.compact.flatten.reject(&:blank?) # reject blank because some are `false`
|
109
|
-
end
|
110
|
-
end
|
111
|
-
|
112
|
-
def initialize_rubocop_ivars
|
113
|
-
@config_store ||= RuboCop::ConfigStore.new
|
114
|
-
@options ||= {}
|
115
|
-
@errors ||= []
|
116
|
-
@warnings ||= []
|
117
|
-
end
|
118
|
-
|
119
|
-
def inspect_file(source)
|
120
|
-
initialize_rubocop_ivars
|
121
|
-
super
|
122
|
-
end
|
123
|
-
|
124
|
-
def initialization_offenses
|
125
|
-
[
|
126
|
-
{
|
127
|
-
range: Location.position_hash(1, 1, 1, 1),
|
128
|
-
severity: 'startup', # diagnostic_severity_for(offense.severity),
|
129
|
-
# code?: number | string;
|
130
|
-
code: 'code',
|
131
|
-
source: 'RuboCop:RubyLanguageServer',
|
132
|
-
message: @initialization_error
|
133
|
-
}
|
134
|
-
]
|
135
|
-
end
|
136
|
-
|
137
|
-
class << self
|
138
|
-
def instance
|
139
|
-
return @instance if @instance
|
140
|
-
|
141
|
-
@config_path ||= config_path
|
142
|
-
config_path_timestamp = File.mtime(@config_path)
|
143
|
-
if @cached_config_path_timestamp.nil? || @cached_config_path_timestamp < config_path_timestamp
|
144
|
-
@cached_config_path_timestamp = config_path_timestamp
|
145
|
-
@instance = new(@config_path)
|
146
|
-
else
|
147
|
-
@instance = new
|
148
|
-
end
|
149
|
-
rescue StandardError => e
|
150
|
-
@instance = new(@config_path, e.to_s)
|
151
|
-
end
|
152
|
-
|
153
|
-
private
|
154
|
-
|
155
|
-
def config_path
|
156
|
-
my_path = __FILE__
|
157
|
-
pathname = Pathname.new(my_path)
|
158
|
-
my_directory = pathname.dirname
|
159
|
-
fallback_pathname = "#{my_directory}/../resources/fallback_rubocop.yml"
|
160
|
-
project_path = "#{RubyLanguageServer::ProjectManager.root_path}.rubocop.yml"
|
161
|
-
possible_config_paths = [project_path, fallback_pathname.to_s]
|
162
|
-
possible_config_paths.detect { |path| File.exist?(path) }
|
163
|
-
end
|
164
|
-
end
|
165
|
-
|
166
|
-
def excluded_file?(filename)
|
167
|
-
initialize_rubocop_ivars
|
168
|
-
file_config = @config_store.for(filename)
|
169
|
-
file_config.file_to_exclude?(filename)
|
170
|
-
end
|
171
|
-
end
|
172
|
-
end
|