language_server-protocol 3.14.0.0 → 3.14.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/circle.yml +0 -6
- data/docker-compose.ci.yml +0 -4
- data/docker-compose.override.yml +1 -4
- data/docker-compose.yml +3 -15
- data/language_server-protocol.gemspec +2 -0
- data/lib/language_server/protocol/transport/io/reader.rb +47 -0
- data/lib/language_server/protocol/transport/io/writer.rb +34 -0
- data/lib/language_server/protocol/transport/io.rb +2 -0
- data/lib/language_server/protocol/transport/stdio/reader.rb +3 -29
- data/lib/language_server/protocol/transport/stdio/writer.rb +3 -18
- data/lib/language_server/protocol/transport.rb +1 -0
- data/lib/language_server/protocol/version.rb +1 -1
- metadata +7 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 421a684037f06cc7621698f2e85f9032a5d8f67a469a4d36266bbdef355af192
|
4
|
+
data.tar.gz: 46566651baf77dc574777806f6b2d0fb8d7a43015380b9f688dc772d0cdf8ac9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd257d1aab4eb25a25765826ffbe7924d8dc5e76a7645289da8d3863ef7d873156e2ca30bed215768bc873fdf5c9fb29043604d56d4322fcc2a47cdfed00af0d
|
7
|
+
data.tar.gz: 23005ed19a166de779eecd57643d5eebec4c7aad3172a8af50f840080f102248aba6d98df6274a1157c117d85885341b893e871831a1f0629b16783f3e63171a
|
data/CHANGELOG.md
CHANGED
data/circle.yml
CHANGED
data/docker-compose.ci.yml
CHANGED
data/docker-compose.override.yml
CHANGED
@@ -6,14 +6,11 @@ services:
|
|
6
6
|
- $HOME/.gitconfig:/home/ruby/.gitconfig:ro
|
7
7
|
- $HOME/.ssh:/home/ruby/.ssh:ro
|
8
8
|
- $HOME/.gem:/home/ruby/.gem
|
9
|
+
- $HOME/.netrc:/home/ruby/.netrc
|
9
10
|
ruby-2-5:
|
10
11
|
<<: *latest
|
11
12
|
ruby-2-4:
|
12
13
|
<<: *latest
|
13
|
-
ruby-2-3:
|
14
|
-
<<: *latest
|
15
|
-
ruby-2-2:
|
16
|
-
<<: *latest
|
17
14
|
node:
|
18
15
|
volumes:
|
19
16
|
- .:/app:cached
|
data/docker-compose.yml
CHANGED
@@ -5,7 +5,7 @@ services:
|
|
5
5
|
context: .
|
6
6
|
dockerfile: Dockerfile.development
|
7
7
|
args:
|
8
|
-
RUBY_VERSION: 2.6.
|
8
|
+
RUBY_VERSION: 2.6.3
|
9
9
|
volumes:
|
10
10
|
- vendor:/vendor
|
11
11
|
- home:/home/ruby
|
@@ -14,25 +14,13 @@ services:
|
|
14
14
|
build:
|
15
15
|
<<: *build
|
16
16
|
args:
|
17
|
-
RUBY_VERSION: 2.5.
|
17
|
+
RUBY_VERSION: 2.5.5
|
18
18
|
ruby-2-4:
|
19
19
|
<<: *latest
|
20
20
|
build:
|
21
21
|
<<: *build
|
22
22
|
args:
|
23
|
-
RUBY_VERSION: 2.4.
|
24
|
-
ruby-2-3:
|
25
|
-
<<: *latest
|
26
|
-
build:
|
27
|
-
<<: *build
|
28
|
-
args:
|
29
|
-
RUBY_VERSION: 2.3.8
|
30
|
-
ruby-2-2:
|
31
|
-
<<: *latest
|
32
|
-
build:
|
33
|
-
<<: *build
|
34
|
-
args:
|
35
|
-
RUBY_VERSION: 2.2.10
|
23
|
+
RUBY_VERSION: 2.4.6
|
36
24
|
node:
|
37
25
|
build:
|
38
26
|
context: .
|
@@ -21,6 +21,8 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
22
|
spec.require_paths = ["lib"]
|
23
23
|
|
24
|
+
spec.required_ruby_version = ">= 2.4.0"
|
25
|
+
|
24
26
|
spec.add_development_dependency "bundler", "~> 1.15"
|
25
27
|
spec.add_development_dependency "rake", "~> 10.0"
|
26
28
|
spec.add_development_dependency "minitest", "~> 5.0"
|
@@ -0,0 +1,47 @@
|
|
1
|
+
require "json"
|
2
|
+
|
3
|
+
module LanguageServer
|
4
|
+
module Protocol
|
5
|
+
module Transport
|
6
|
+
module Io
|
7
|
+
class Reader
|
8
|
+
def initialize(io)
|
9
|
+
@io = io
|
10
|
+
end
|
11
|
+
|
12
|
+
def read(&block)
|
13
|
+
buffer = ""
|
14
|
+
header_parsed = false
|
15
|
+
content_length = nil
|
16
|
+
|
17
|
+
while char = io.getc
|
18
|
+
buffer << char
|
19
|
+
|
20
|
+
unless header_parsed
|
21
|
+
if buffer[-4..-1] == "\r\n" * 2
|
22
|
+
content_length = buffer.match(/Content-Length: (\d+)/i)[1].to_i
|
23
|
+
|
24
|
+
header_parsed = true
|
25
|
+
buffer.clear
|
26
|
+
end
|
27
|
+
else
|
28
|
+
if buffer.bytesize == content_length
|
29
|
+
request = JSON.parse(buffer, symbolize_names: true)
|
30
|
+
|
31
|
+
block.call(request)
|
32
|
+
|
33
|
+
header_parsed = false
|
34
|
+
buffer.clear
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
private
|
41
|
+
|
42
|
+
attr_reader :io
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
module LanguageServer
|
2
|
+
module Protocol
|
3
|
+
module Transport
|
4
|
+
module Io
|
5
|
+
class Writer
|
6
|
+
attr_reader :io
|
7
|
+
|
8
|
+
def initialize(io)
|
9
|
+
@io = io
|
10
|
+
end
|
11
|
+
|
12
|
+
def write(response)
|
13
|
+
response_str = response.merge(
|
14
|
+
jsonrpc: "2.0"
|
15
|
+
).to_json
|
16
|
+
|
17
|
+
headers = {
|
18
|
+
"Content-Length" => response_str.bytesize
|
19
|
+
}
|
20
|
+
|
21
|
+
headers.each do |k, v|
|
22
|
+
io.print "#{k}: #{v}\r\n"
|
23
|
+
end
|
24
|
+
|
25
|
+
io.print "\r\n"
|
26
|
+
|
27
|
+
io.print response_str
|
28
|
+
io.flush
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -1,36 +1,10 @@
|
|
1
|
-
require "json"
|
2
|
-
|
3
1
|
module LanguageServer
|
4
2
|
module Protocol
|
5
3
|
module Transport
|
6
4
|
module Stdio
|
7
|
-
class Reader
|
8
|
-
def
|
9
|
-
|
10
|
-
header_parsed = false
|
11
|
-
content_length = nil
|
12
|
-
|
13
|
-
while char = STDIN.getc
|
14
|
-
buffer << char
|
15
|
-
|
16
|
-
unless header_parsed
|
17
|
-
if buffer[-4..-1] == "\r\n" * 2
|
18
|
-
content_length = buffer.match(/Content-Length: (\d+)/i)[1].to_i
|
19
|
-
|
20
|
-
header_parsed = true
|
21
|
-
buffer.clear
|
22
|
-
end
|
23
|
-
else
|
24
|
-
if buffer.bytesize == content_length
|
25
|
-
request = JSON.parse(buffer, symbolize_names: true)
|
26
|
-
|
27
|
-
block.call(request)
|
28
|
-
|
29
|
-
header_parsed = false
|
30
|
-
buffer.clear
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
5
|
+
class Reader < Io::Reader
|
6
|
+
def initialize
|
7
|
+
super STDIN
|
34
8
|
end
|
35
9
|
end
|
36
10
|
end
|
@@ -2,24 +2,9 @@ module LanguageServer
|
|
2
2
|
module Protocol
|
3
3
|
module Transport
|
4
4
|
module Stdio
|
5
|
-
class Writer
|
6
|
-
def
|
7
|
-
|
8
|
-
jsonrpc: "2.0"
|
9
|
-
).to_json
|
10
|
-
|
11
|
-
headers = {
|
12
|
-
"Content-Length" => response_str.bytesize
|
13
|
-
}
|
14
|
-
|
15
|
-
headers.each do |k, v|
|
16
|
-
STDOUT.print "#{k}: #{v}\r\n"
|
17
|
-
end
|
18
|
-
|
19
|
-
STDOUT.print "\r\n"
|
20
|
-
|
21
|
-
STDOUT.print response_str
|
22
|
-
STDOUT.flush
|
5
|
+
class Writer < Io::Writer
|
6
|
+
def initialize
|
7
|
+
super STDOUT
|
23
8
|
end
|
24
9
|
end
|
25
10
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: language_server-protocol
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.14.0.
|
4
|
+
version: 3.14.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fumiaki MATSUSHIMA
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-04-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -276,6 +276,9 @@ files:
|
|
276
276
|
- lib/language_server/protocol/interface/workspace_folders_change_event.rb
|
277
277
|
- lib/language_server/protocol/interface/workspace_symbol_params.rb
|
278
278
|
- lib/language_server/protocol/transport.rb
|
279
|
+
- lib/language_server/protocol/transport/io.rb
|
280
|
+
- lib/language_server/protocol/transport/io/reader.rb
|
281
|
+
- lib/language_server/protocol/transport/io/writer.rb
|
279
282
|
- lib/language_server/protocol/transport/stdio.rb
|
280
283
|
- lib/language_server/protocol/transport/stdio/reader.rb
|
281
284
|
- lib/language_server/protocol/transport/stdio/writer.rb
|
@@ -295,14 +298,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
295
298
|
requirements:
|
296
299
|
- - ">="
|
297
300
|
- !ruby/object:Gem::Version
|
298
|
-
version:
|
301
|
+
version: 2.4.0
|
299
302
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
300
303
|
requirements:
|
301
304
|
- - ">="
|
302
305
|
- !ruby/object:Gem::Version
|
303
306
|
version: '0'
|
304
307
|
requirements: []
|
305
|
-
rubygems_version: 3.0.
|
308
|
+
rubygems_version: 3.0.3
|
306
309
|
signing_key:
|
307
310
|
specification_version: 4
|
308
311
|
summary: A Language Server Protocol SDK
|