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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d8036332dcdfd3db5e87daff4f720ec35f7f6872b9f8830e7bf1393dd0c471ee
4
- data.tar.gz: 82e22e32d17d27fb3500e8366e1aeac95afa199c179f02b29f3367f3185b7cf7
3
+ metadata.gz: b775ff47aedcc50ee7f1b3c10db47ad78ae5de1c7be7763a3870bd36a5f1b25d
4
+ data.tar.gz: c860cd9e682a6065229d2a14142665b195232c3dd6a2e78e21bea0d9b30aabf1
5
5
  SHA512:
6
- metadata.gz: bdda954fdbb8e7e071f96f004027646387529a3df7af0706ea7f5a0839ac32436582f9c57fb94c3ff5f1a962cce7cbe7140dc40b278a4d715e6ab4a59eb2f02c
7
- data.tar.gz: 891e88524fb9d45190b326a29dabb36eff73c0ea1e9993a58b0cc443e7ee0c7b0265af9a74fe3beb3ca75e8c1ce833684ebbf6616e26507d94c8e495640b8f5f
6
+ metadata.gz: ea4070ee58a6ab2c00e7a86674e787395d5325c10cc4aa46f3f8c3b3f4f23726b93b639a479be9a3a86835eda0110672fddb63936637737350614bc2fe59df8b
7
+ data.tar.gz: 956f38e583f416eeabf0a95508ccaec1be6ea6f1d1a55e1461b3f5cd2612f07c939eabacf69516742d6f3c8dee9a6c14be78f522593441bc7016515f3c8254e0
data/.gitignore CHANGED
@@ -1,5 +1,5 @@
1
1
  /Gemfile.lock
2
-
2
+ .Gemfile
3
3
  .idea
4
4
  .vscode
5
5
  .yardoc
data/Gemfile CHANGED
@@ -1,3 +1,7 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gemspec name: 'solargraph'
4
+
5
+ # Local gemfile for development tools, etc.
6
+ local_gemfile = File.expand_path(".Gemfile", __dir__)
7
+ instance_eval File.read local_gemfile if File.exist? local_gemfile
@@ -10,15 +10,11 @@ module Solargraph
10
10
  #
11
11
  class DownloadCore < Base
12
12
  def process
13
- cmd = "solargraph download-core"
14
- o, s = Open3.capture2(cmd)
15
- if s != 0
16
- host.show_message "An error occurred while downloading documentation.", LanguageServer::MessageTypes::ERROR
17
- else
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
@@ -2,7 +2,7 @@
2
2
 
3
3
  require 'ostruct'
4
4
  require 'tilt'
5
- require 'kramdown'
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
- Kramdown::Document.new(
28
- text.to_s.lines.map{|l| l.gsub(/^ /, "\t")}.join,
29
- input: 'GFM',
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
- pos = Solargraph::Position.new(node.loc.expression.last_line, node.loc.expression.last_column)
47
- clip = api_map.clip_at(location.filename, pos)
48
- # Use the return node for inference. The clip might infer from the
49
- # first node in a method call instead of the entire call.
50
- chain = Solargraph::Source::NodeChainer.chain(node, nil, clip.in_block?)
51
- result = chain.infer(api_map, closure, clip.locals)
52
- types.push result unless result.undefined?
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 'kramdown'
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 = Kramdown::Document.new(
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Solargraph
4
- VERSION = '0.35.2'
4
+ VERSION = '0.36.0'
5
5
  end
@@ -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 = ['solargraph', 'solargraph-runtime']
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 'kramdown', '~> 1.16'
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.35.2
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-06 00:00:00.000000000 Z
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: kramdown
76
+ name: maruku
77
77
  requirement: !ruby/object:Gem::Requirement
78
78
  requirements:
79
79
  - - "~>"
80
80
  - !ruby/object:Gem::Version
81
- version: '1.16'
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: '1.16'
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
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require 'solargraph/plugin/process'
4
-
5
- Solargraph::Plugin::Process.new.run