solargraph 0.35.2 → 0.36.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -1
- data/Gemfile +4 -0
- data/lib/solargraph/language_server/message/extended/download_core.rb +5 -9
- data/lib/solargraph/page.rb +4 -12
- data/lib/solargraph/pin/base_variable.rb +12 -7
- data/lib/solargraph/pin/documenting.rb +2 -7
- data/lib/solargraph/version.rb +1 -1
- data/solargraph.gemspec +3 -2
- metadata +19 -7
- data/bin/solargraph-runtime +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b775ff47aedcc50ee7f1b3c10db47ad78ae5de1c7be7763a3870bd36a5f1b25d
|
4
|
+
data.tar.gz: c860cd9e682a6065229d2a14142665b195232c3dd6a2e78e21bea0d9b30aabf1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea4070ee58a6ab2c00e7a86674e787395d5325c10cc4aa46f3f8c3b3f4f23726b93b639a479be9a3a86835eda0110672fddb63936637737350614bc2fe59df8b
|
7
|
+
data.tar.gz: 956f38e583f416eeabf0a95508ccaec1be6ea6f1d1a55e1461b3f5cd2612f07c939eabacf69516742d6f3c8dee9a6c14be78f522593441bc7016515f3c8254e0
|
data/.gitignore
CHANGED
data/Gemfile
CHANGED
@@ -10,15 +10,11 @@ module Solargraph
|
|
10
10
|
#
|
11
11
|
class DownloadCore < Base
|
12
12
|
def process
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
ver = o.match(/[\d]*\.[\d]*\.[\d]*/)[0]
|
19
|
-
host.show_message "Downloaded documentation for Ruby #{ver}.", LanguageServer::MessageTypes::INFO
|
20
|
-
# @todo YardMap should be refreshed
|
21
|
-
end
|
13
|
+
ver = Solargraph::YardMap::CoreDocs.best_download
|
14
|
+
Solargraph::YardMap::CoreDocs.download ver
|
15
|
+
host.show_message "Downloaded documentation for Ruby #{ver}.", LanguageServer::MessageTypes::INFO
|
16
|
+
rescue StandardError => e
|
17
|
+
host.show_message "An error occurred while downloading documentation: [#{e.class}] #{e.message}", LanguageServer::MessageTypes::ERROR
|
22
18
|
end
|
23
19
|
end
|
24
20
|
end
|
data/lib/solargraph/page.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
require 'ostruct'
|
4
4
|
require 'tilt'
|
5
|
-
require '
|
5
|
+
require 'maruku'
|
6
6
|
require 'htmlentities'
|
7
7
|
require 'cgi'
|
8
8
|
|
@@ -24,17 +24,9 @@ module Solargraph
|
|
24
24
|
# @param text [String]
|
25
25
|
# @return [String]
|
26
26
|
def htmlify text
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
entity_output: :symbolic,
|
31
|
-
syntax_highlighter_opts: {
|
32
|
-
block: {
|
33
|
-
line_numbers: false
|
34
|
-
},
|
35
|
-
default_lang: :ruby
|
36
|
-
},
|
37
|
-
).to_html
|
27
|
+
Maruku.new(text.to_s.lines.map{|l| l.gsub(/^ /, "\t")}.join).to_html
|
28
|
+
# redcarpet = Redcarpet::Markdown.new(Redcarpet::Render::HTML)
|
29
|
+
# redcarpet.render(text.to_s.lines.map{|l| l.gsub(/^ /, "\t")}.join)
|
38
30
|
end
|
39
31
|
|
40
32
|
# @param code [String]
|
@@ -43,13 +43,18 @@ module Solargraph
|
|
43
43
|
return ComplexType::UNDEFINED if @assignment.nil?
|
44
44
|
types = []
|
45
45
|
returns_from(@assignment).each do |node|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
46
|
+
# Nil nodes may not have a location
|
47
|
+
if node.type == :nil
|
48
|
+
types.push ComplexType::NIL
|
49
|
+
else
|
50
|
+
pos = Solargraph::Position.new(node.loc.expression.last_line, node.loc.expression.last_column)
|
51
|
+
clip = api_map.clip_at(location.filename, pos)
|
52
|
+
# Use the return node for inference. The clip might infer from the
|
53
|
+
# first node in a method call instead of the entire call.
|
54
|
+
chain = Solargraph::Source::NodeChainer.chain(node, nil, clip.in_block?)
|
55
|
+
result = chain.infer(api_map, closure, clip.locals)
|
56
|
+
types.push result unless result.undefined?
|
57
|
+
end
|
53
58
|
end
|
54
59
|
return ComplexType::UNDEFINED if types.empty?
|
55
60
|
ComplexType.try_parse(*types.map(&:tag))
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
require 'rdoc'
|
4
4
|
require 'reverse_markdown'
|
5
|
-
require '
|
5
|
+
require 'maruku'
|
6
6
|
|
7
7
|
module Solargraph
|
8
8
|
module Pin
|
@@ -12,12 +12,7 @@ module Solargraph
|
|
12
12
|
# @return [String]
|
13
13
|
def documentation
|
14
14
|
@documentation ||= begin
|
15
|
-
html =
|
16
|
-
normalize_indentation(docstring.to_s),
|
17
|
-
input: 'GFM',
|
18
|
-
entity_output: :symbolic,
|
19
|
-
syntax_highlighter: nil
|
20
|
-
).to_html
|
15
|
+
html = Maruku.new(normalize_indentation(docstring.to_s)).to_html
|
21
16
|
ReverseMarkdown.convert(html, github_flavored: true).lines.map(&:rstrip).join("\n")
|
22
17
|
end
|
23
18
|
end
|
data/lib/solargraph/version.rb
CHANGED
data/solargraph.gemspec
CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
|
|
15
15
|
end
|
16
16
|
s.homepage = 'http://solargraph.org'
|
17
17
|
s.license = 'MIT'
|
18
|
-
s.executables
|
18
|
+
s.executables = ['solargraph']
|
19
19
|
|
20
20
|
s.required_ruby_version = '>= 2.1'
|
21
21
|
|
@@ -23,7 +23,8 @@ Gem::Specification.new do |s|
|
|
23
23
|
s.add_runtime_dependency 'bundler', '>= 1.17.2'
|
24
24
|
s.add_runtime_dependency 'htmlentities', '~> 4.3', '>= 4.3.4'
|
25
25
|
s.add_runtime_dependency 'jaro_winkler', '~> 1.5'
|
26
|
-
s.add_runtime_dependency '
|
26
|
+
s.add_runtime_dependency 'maruku', '~> 0.7'
|
27
|
+
s.add_runtime_dependency 'nokogiri', '>= 1.9.1'
|
27
28
|
s.add_runtime_dependency 'parser', '~> 2.3'
|
28
29
|
s.add_runtime_dependency 'reverse_markdown', '~> 1.0', '>= 1.0.5'
|
29
30
|
s.add_runtime_dependency 'rubocop', '~> 0.52'
|
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.
|
4
|
+
version: 0.36.0
|
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-08-
|
11
|
+
date: 2019-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: backport
|
@@ -73,19 +73,33 @@ dependencies:
|
|
73
73
|
- !ruby/object:Gem::Version
|
74
74
|
version: '1.5'
|
75
75
|
- !ruby/object:Gem::Dependency
|
76
|
-
name:
|
76
|
+
name: maruku
|
77
77
|
requirement: !ruby/object:Gem::Requirement
|
78
78
|
requirements:
|
79
79
|
- - "~>"
|
80
80
|
- !ruby/object:Gem::Version
|
81
|
-
version: '
|
81
|
+
version: '0.7'
|
82
82
|
type: :runtime
|
83
83
|
prerelease: false
|
84
84
|
version_requirements: !ruby/object:Gem::Requirement
|
85
85
|
requirements:
|
86
86
|
- - "~>"
|
87
87
|
- !ruby/object:Gem::Version
|
88
|
-
version: '
|
88
|
+
version: '0.7'
|
89
|
+
- !ruby/object:Gem::Dependency
|
90
|
+
name: nokogiri
|
91
|
+
requirement: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - ">="
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: 1.9.1
|
96
|
+
type: :runtime
|
97
|
+
prerelease: false
|
98
|
+
version_requirements: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - ">="
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: 1.9.1
|
89
103
|
- !ruby/object:Gem::Dependency
|
90
104
|
name: parser
|
91
105
|
requirement: !ruby/object:Gem::Requirement
|
@@ -248,7 +262,6 @@ description: IDE tools for code completion, inline documentation, and static ana
|
|
248
262
|
email: admin@castwide.com
|
249
263
|
executables:
|
250
264
|
- solargraph
|
251
|
-
- solargraph-runtime
|
252
265
|
extensions: []
|
253
266
|
extra_rdoc_files: []
|
254
267
|
files:
|
@@ -263,7 +276,6 @@ files:
|
|
263
276
|
- README.md
|
264
277
|
- Rakefile
|
265
278
|
- bin/solargraph
|
266
|
-
- bin/solargraph-runtime
|
267
279
|
- lib/solargraph.rb
|
268
280
|
- lib/solargraph/api_map.rb
|
269
281
|
- lib/solargraph/api_map/bundler_methods.rb
|