lsp-protocol 0.0.4 → 0.0.5
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/lib/lsp.rb +14 -0
- data/lsp-protocol.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fded7d142743940e36e6b8a38630cae77df4fc6f243436e32e9a513d00363293
|
|
4
|
+
data.tar.gz: 951ea21544f22fc937cf6a795eb71b0e01867511dfeae72a73193ac731e235c6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3f3457bcca090879e4f21506f78bab7813c64ba01b8c20d8bcccbaae8f0436602524e708c5a0a7eb1434eecaeeccb55831f08ff437ece95d44119cae7ca94724
|
|
7
|
+
data.tar.gz: b5592d39d55e99be34d1f01decc93097edcf3964135e0e25aad5c71ec08d426071f2d68d3804f7ab896b4e69653e3df261708a017f58e9ca2c35c8c57a0031ca
|
data/lib/lsp.rb
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
module Lsp
|
|
2
2
|
TextDocumentIdentifier = Struct.new(:uri)
|
|
3
3
|
|
|
4
|
+
DidChangeTextDocumentParams = Struct.new(:text_document, :content_changes)
|
|
5
|
+
TextDocumentContentChangeEvent = Struct.new(:text)
|
|
6
|
+
VersionedTextDocumentIdentifier = Struct.new(:uri, :version)
|
|
4
7
|
TextDocumentPositionParams = Struct.new(:text_document, :position)
|
|
5
8
|
InitializeRequest = Struct.new(:root_uri)
|
|
6
9
|
CompletionItem = Struct.new(:label, :text_edit) do
|
|
@@ -114,6 +117,17 @@ module Lsp
|
|
|
114
117
|
TextDocumentIdentifier.new(
|
|
115
118
|
URI(params.fetch(:textDocument).fetch(:uri))),
|
|
116
119
|
Position.from_hash(params.fetch(:position))))
|
|
120
|
+
when "textDocument/didChange"
|
|
121
|
+
handle_text_document_did_change(
|
|
122
|
+
DidChangeTextDocumentParams.new(
|
|
123
|
+
VersionedTextDocumentIdentifier.new(
|
|
124
|
+
URI(params.fetch(:textDocument).fetch(:uri)),
|
|
125
|
+
params.fetch(:textDocument).fetch(:version)),
|
|
126
|
+
params.fetch(:contentChanges).map do |contentChange|
|
|
127
|
+
next if contentChange[:range]
|
|
128
|
+
TextDocumentContentChangeEvent.new(
|
|
129
|
+
contentChange.fetch(:text))
|
|
130
|
+
end.compact))
|
|
117
131
|
else
|
|
118
132
|
ResponseMessage.new(nil, ResponseError::MethodNotFound.new)
|
|
119
133
|
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.5'
|
|
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.5
|
|
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-09-
|
|
11
|
+
date: 2018-09-06 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|