lsp-protocol 0.0.3 → 0.0.4
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 +5 -5
- data/Gemfile.lock +2 -2
- data/lib/lsp.rb +26 -0
- data/lsp-protocol.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 239a639762813d65f2039b8023e07355ef6f235e33086bae243c9acc2379500c
|
|
4
|
+
data.tar.gz: 3916e4176f0f871d41f8d5d33ef2b35d002c59ddcac5360506c6ba385c1a4e02
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 34f2b7bfd7b7f645073513a8c69b091eb70fa51109847573b74c77c8e38615a55a9333a8a1ea49b1a0de9960644d1e3ad6a279091c2eb037e946ed9537606424
|
|
7
|
+
data.tar.gz: a2554f4d80e7610667fe4ef8ec15c44b8c1fd8af4f6dfc844db4bb28bd285cbddc3200b2f9551248ab6fcfc689e34d96bd3cc0fab86fc4461244e3bdda9151bc
|
data/Gemfile.lock
CHANGED
data/lib/lsp.rb
CHANGED
|
@@ -3,6 +3,22 @@ module Lsp
|
|
|
3
3
|
|
|
4
4
|
TextDocumentPositionParams = Struct.new(:text_document, :position)
|
|
5
5
|
InitializeRequest = Struct.new(:root_uri)
|
|
6
|
+
CompletionItem = Struct.new(:label, :text_edit) do
|
|
7
|
+
def to_h
|
|
8
|
+
{
|
|
9
|
+
label: label,
|
|
10
|
+
textEdit: text_edit.to_h,
|
|
11
|
+
}
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
TextEdit = Struct.new(:range, :new_text) do
|
|
15
|
+
def to_h
|
|
16
|
+
{
|
|
17
|
+
range: range.to_h,
|
|
18
|
+
newText: new_text,
|
|
19
|
+
}
|
|
20
|
+
end
|
|
21
|
+
end
|
|
6
22
|
|
|
7
23
|
Position = Struct.new(:line, :character) do
|
|
8
24
|
def self.from_hash(line:, character:)
|
|
@@ -30,6 +46,10 @@ module Lsp
|
|
|
30
46
|
def self.successful(result)
|
|
31
47
|
new(result, nil)
|
|
32
48
|
end
|
|
49
|
+
|
|
50
|
+
def self.error(error)
|
|
51
|
+
new(error, nil)
|
|
52
|
+
end
|
|
33
53
|
end
|
|
34
54
|
|
|
35
55
|
TextDocumentHoverResult = Struct.new(:contents) do
|
|
@@ -88,6 +108,12 @@ module Lsp
|
|
|
88
108
|
handle_initialize(
|
|
89
109
|
InitializeRequest.new(
|
|
90
110
|
URI(params.fetch(:rootUri))))
|
|
111
|
+
when "textDocument/completion"
|
|
112
|
+
handle_text_document_completion(
|
|
113
|
+
TextDocumentPositionParams.new(
|
|
114
|
+
TextDocumentIdentifier.new(
|
|
115
|
+
URI(params.fetch(:textDocument).fetch(:uri))),
|
|
116
|
+
Position.from_hash(params.fetch(:position))))
|
|
91
117
|
else
|
|
92
118
|
ResponseMessage.new(nil, ResponseError::MethodNotFound.new)
|
|
93
119
|
end
|
data/lsp-protocol.gemspec
CHANGED
|
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
|
4
4
|
|
|
5
5
|
Gem::Specification.new do |spec|
|
|
6
6
|
spec.name = 'lsp-protocol'
|
|
7
|
-
spec.version = '0.0.
|
|
7
|
+
spec.version = '0.0.4'
|
|
8
8
|
spec.licenses = ['MIT']
|
|
9
9
|
spec.authors = ['Rafał Łasocha']
|
|
10
10
|
spec.email = 'lsp@swistak35.com'
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: lsp-protocol
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Rafał Łasocha
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-
|
|
11
|
+
date: 2018-09-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -101,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
101
101
|
version: '0'
|
|
102
102
|
requirements: []
|
|
103
103
|
rubyforge_project:
|
|
104
|
-
rubygems_version: 2.6
|
|
104
|
+
rubygems_version: 2.7.6
|
|
105
105
|
signing_key:
|
|
106
106
|
specification_version: 4
|
|
107
107
|
summary: Language Server Protocol implementation
|