solargraph 0.32.4 → 0.32.5
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8c99435136ad89666edbb8b132cd5715509cf0c7c365f1a0d3613db1579a718b
|
4
|
+
data.tar.gz: afc550f621504729249a88461a719d28440a5dc8dcc226a1bb99f87d6ae65b8d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1396aec7a3ca2fb02a71d06a1c994f89c361c38cecdea08fde2d6cba02d73a824e1feca0d1ad886c59158fb52c4022d82e1e410847dbad85784e299e23c3b95
|
7
|
+
data.tar.gz: a6f1252139db4157a3a2fdb2a4322da06de9e16912cbd37c8450d51a921341071223fc10f24cf0e2d3798ba08e73c41dade0ccad20a704360ee2851640fc1e81
|
@@ -34,6 +34,10 @@ module Solargraph
|
|
34
34
|
Logging.logger.info "Completion ignored invalid offset: #{params['textDocument']['uri']}, line #{line}, character #{col}"
|
35
35
|
set_result empty_result
|
36
36
|
end
|
37
|
+
rescue FileNotFoundError => e
|
38
|
+
Logging.logger.warn "[#{e.class}] #{e.message}"
|
39
|
+
Logging.logger.warn e.backtrace
|
40
|
+
set_result empty_result
|
37
41
|
end
|
38
42
|
|
39
43
|
# @param incomplete [Boolean]
|
@@ -1,31 +1,41 @@
|
|
1
1
|
require 'uri'
|
2
2
|
require 'htmlentities'
|
3
3
|
|
4
|
-
module Solargraph
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
4
|
+
module Solargraph
|
5
|
+
module LanguageServer
|
6
|
+
module Message
|
7
|
+
module TextDocument
|
8
|
+
class Hover < Base
|
9
|
+
def process
|
10
|
+
line = params['position']['line']
|
11
|
+
col = params['position']['character']
|
12
|
+
contents = []
|
13
|
+
suggestions = host.definitions_at(params['textDocument']['uri'], line, col)
|
14
|
+
last_link = nil
|
15
|
+
suggestions.each do |pin|
|
16
|
+
parts = []
|
17
|
+
this_link = pin.link_documentation
|
18
|
+
if !this_link.nil? and this_link != last_link
|
19
|
+
parts.push this_link
|
20
|
+
end
|
21
|
+
parts.push HTMLEntities.new.encode(pin.detail) unless pin.kind == Solargraph::Pin::NAMESPACE or pin.detail.nil?
|
22
|
+
parts.push pin.documentation unless pin.documentation.nil? or pin.documentation.empty?
|
23
|
+
contents.push parts.join("\n\n") unless parts.empty?
|
24
|
+
last_link = this_link unless this_link.nil?
|
25
|
+
end
|
26
|
+
set_result(
|
27
|
+
contents: {
|
28
|
+
kind: 'markdown',
|
29
|
+
value: contents.join("\n\n")
|
30
|
+
}
|
31
|
+
)
|
32
|
+
rescue FileNotFoundError => e
|
33
|
+
Logging.logger.warn "[#{e.class}] #{e.message}"
|
34
|
+
Logging.logger.warn e.backtrace
|
35
|
+
set_result nil
|
36
|
+
end
|
17
37
|
end
|
18
|
-
parts.push HTMLEntities.new.encode(pin.detail) unless pin.kind == Solargraph::Pin::NAMESPACE or pin.detail.nil?
|
19
|
-
parts.push pin.documentation unless pin.documentation.nil? or pin.documentation.empty?
|
20
|
-
contents.push parts.join("\n\n") unless parts.empty?
|
21
|
-
last_link = this_link unless this_link.nil?
|
22
38
|
end
|
23
|
-
set_result(
|
24
|
-
contents: {
|
25
|
-
kind: 'markdown',
|
26
|
-
value: contents.join("\n\n")
|
27
|
-
}
|
28
|
-
)
|
29
39
|
end
|
30
40
|
end
|
31
41
|
end
|
data/lib/solargraph/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: solargraph
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.32.
|
4
|
+
version: 0.32.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fred Snyder
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-05-
|
11
|
+
date: 2019-05-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: backport
|