language_server 0.10.0 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +4 -1
- data/CHANGELOG.md +5 -0
- data/Gemfile +1 -2
- data/Rakefile +1 -0
- data/language_server.gemspec +1 -2
- data/lib/language_server.rb +6 -6
- data/lib/language_server/project/node.rb +1 -1
- data/lib/language_server/version.rb +1 -1
- metadata +5 -20
- data/lib/language_server/completion_provider/rcodetools.rb +0 -43
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 468e34ca809d762b9c90a5ed0d1906777e01a570fb085a92dc345c90e6a71e59
|
4
|
+
data.tar.gz: 3ec3706c296754ba08a6b5262407eafbd91cd5a1413efafc0f881db99f18876c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a830d47d8e451e9b1584d98540d4808c90288176d84ac726585f4d5ce4802a58ee2558ba00cb045df3095131fff06a6c5cdb8bc547045cabf038b21eb5d48953
|
7
|
+
data.tar.gz: 3e180506cfec812ed29c7ef21cf845896fe169f911ab69989430c38b70e45b11cfe276e5e39c92d37086003ac642941999ebeadda05f82dfc13f2dbefde34c2e
|
data/.rubocop.yml
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
inherit_from:
|
2
|
-
- https://github.com/onk/onkcop/raw/v0.
|
2
|
+
- https://github.com/onk/onkcop/raw/v0.52.0.0/config/rubocop.yml
|
3
3
|
|
4
4
|
AllCops:
|
5
5
|
TargetRubyVersion: 2.2
|
@@ -43,3 +43,6 @@ Metrics/ModuleLength:
|
|
43
43
|
|
44
44
|
Metrics/LineLength:
|
45
45
|
Max: 200
|
46
|
+
Exclude:
|
47
|
+
# To use power_assert, we must pub assertion in one line
|
48
|
+
- 'test/**/*'
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
@@ -3,5 +3,4 @@ source "https://rubygems.org"
|
|
3
3
|
# Specify your gem's dependencies in language_server.gemspec
|
4
4
|
gemspec
|
5
5
|
|
6
|
-
|
7
|
-
gem "rubocop", git: "https://github.com/bbatsov/rubocop", ref: "88d9e3b"
|
6
|
+
gem "rubocop", "0.52.1"
|
data/Rakefile
CHANGED
data/language_server.gemspec
CHANGED
@@ -25,8 +25,7 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
26
26
|
spec.require_paths = ["lib"]
|
27
27
|
|
28
|
-
spec.add_dependency "language_server-protocol", "0.
|
29
|
-
spec.add_dependency "rcodetools"
|
28
|
+
spec.add_dependency "language_server-protocol", "0.5.0"
|
30
29
|
|
31
30
|
spec.add_development_dependency "awesome_print"
|
32
31
|
spec.add_development_dependency "benchmark-ips"
|
data/lib/language_server.rb
CHANGED
@@ -3,7 +3,6 @@ require "language_server/logger"
|
|
3
3
|
require "language_server/protocol"
|
4
4
|
require "language_server/linter/ruby_wc"
|
5
5
|
require "language_server/linter/rubocop"
|
6
|
-
require "language_server/completion_provider/rcodetools"
|
7
6
|
require "language_server/completion_provider/ad_hoc"
|
8
7
|
require "language_server/definition_provider/ad_hoc"
|
9
8
|
require "language_server/file_store"
|
@@ -137,14 +136,15 @@ module LanguageServer
|
|
137
136
|
)
|
138
137
|
end
|
139
138
|
|
140
|
-
on :"textDocument/completion" do |request:,
|
139
|
+
on :"textDocument/completion" do |request:, project:|
|
141
140
|
uri = request[:params][:textDocument][:uri]
|
142
141
|
line, character = request[:params][:position].fetch_values(:line, :character).map(&:to_i)
|
143
142
|
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
143
|
+
if LanguageServer.adhoc_enabled?
|
144
|
+
[
|
145
|
+
CompletionProvider::AdHoc.new(uri: uri, line: line, character: character, project: project),
|
146
|
+
].flat_map(&:call)
|
147
|
+
end
|
148
148
|
end
|
149
149
|
|
150
150
|
on :"textDocument/definition" do |request:, project:|
|
@@ -5,7 +5,7 @@ module LanguageServer
|
|
5
5
|
def attributes(*attrs)
|
6
6
|
attr_accessor(*attrs)
|
7
7
|
attribute_names.concat(attrs)
|
8
|
-
class_eval <<-RUBY, __FILE__, __LINE__
|
8
|
+
class_eval <<-RUBY, __FILE__, __LINE__ + 1
|
9
9
|
def initialize(#{attribute_names.map { |n| "#{n}:" }.join(",")})
|
10
10
|
#{attribute_names.map { |n|
|
11
11
|
"@#{n} = #{n}"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: language_server
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fumiaki MATSUSHIMA
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-01-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: language_server-protocol
|
@@ -16,28 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.5.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: rcodetools
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
26
|
+
version: 0.5.0
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: awesome_print
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -231,7 +217,6 @@ files:
|
|
231
217
|
- language_server.gemspec
|
232
218
|
- lib/language_server.rb
|
233
219
|
- lib/language_server/completion_provider/ad_hoc.rb
|
234
|
-
- lib/language_server/completion_provider/rcodetools.rb
|
235
220
|
- lib/language_server/definition_provider/ad_hoc.rb
|
236
221
|
- lib/language_server/file_store.rb
|
237
222
|
- lib/language_server/linter/rubocop.rb
|
@@ -262,7 +247,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
262
247
|
version: '0'
|
263
248
|
requirements: []
|
264
249
|
rubyforge_project:
|
265
|
-
rubygems_version: 2.7.
|
250
|
+
rubygems_version: 2.7.3
|
266
251
|
signing_key:
|
267
252
|
specification_version: 4
|
268
253
|
summary: A Ruby Language Server implementation
|
@@ -1,43 +0,0 @@
|
|
1
|
-
require "language_server/protocol"
|
2
|
-
require "rcodetools/completion"
|
3
|
-
|
4
|
-
module LanguageServer
|
5
|
-
module CompletionProvider
|
6
|
-
class Filter < ::Rcodetools::XMPCompletionFilter
|
7
|
-
@candidates_with_description_flag = true
|
8
|
-
|
9
|
-
def completion_code(*args)
|
10
|
-
candidates_with_class(*args)
|
11
|
-
rescue NewCodeError, RuntimeDataError, NoCandidates
|
12
|
-
[nil, []]
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
class Rcodetools
|
17
|
-
def initialize(uri:, line:, character:, file_store:)
|
18
|
-
@uri = uri
|
19
|
-
@line = line
|
20
|
-
@character = character
|
21
|
-
@file_store = file_store
|
22
|
-
end
|
23
|
-
|
24
|
-
def call
|
25
|
-
_, candidates = Filter.run(source, lineno: @line + 1, column: @character)
|
26
|
-
candidates.map do |candidate|
|
27
|
-
method_name, description = candidate.split(/\0/, 2)
|
28
|
-
Protocol::Interface::CompletionItem.new(
|
29
|
-
label: method_name,
|
30
|
-
detail: description,
|
31
|
-
kind: Protocol::Constant::CompletionItemKind::METHOD,
|
32
|
-
)
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
private
|
37
|
-
|
38
|
-
def source
|
39
|
-
@file_store.read_remote_uri(@uri)
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|