solargraph 0.33.2 → 0.34.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +0 -1
- data/README.md +1 -1
- data/lib/solargraph.rb +5 -0
- data/lib/solargraph/api_map.rb +36 -18
- data/lib/solargraph/api_map/cache.rb +2 -0
- data/lib/solargraph/api_map/source_to_yard.rb +14 -5
- data/lib/solargraph/api_map/store.rb +17 -19
- data/lib/solargraph/bundle.rb +2 -0
- data/lib/solargraph/complex_type.rb +18 -4
- data/lib/solargraph/complex_type/type_methods.rb +2 -0
- data/lib/solargraph/complex_type/unique_type.rb +2 -0
- data/lib/solargraph/convention.rb +38 -0
- data/lib/solargraph/convention/base.rb +28 -0
- data/lib/solargraph/convention/gemfile.rb +18 -0
- data/lib/solargraph/convention/gemspec.rb +25 -0
- data/lib/solargraph/convention/rspec.rb +23 -0
- data/lib/solargraph/core_fills.rb +66 -42
- data/lib/solargraph/diagnostics.rb +2 -0
- data/lib/solargraph/diagnostics/base.rb +2 -0
- data/lib/solargraph/diagnostics/require_not_found.rb +2 -0
- data/lib/solargraph/diagnostics/rubocop.rb +2 -0
- data/lib/solargraph/diagnostics/rubocop_helpers.rb +2 -0
- data/lib/solargraph/diagnostics/severities.rb +15 -13
- data/lib/solargraph/diagnostics/type_check.rb +2 -0
- data/lib/solargraph/diagnostics/update_errors.rb +2 -0
- data/lib/solargraph/documentor.rb +42 -0
- data/lib/solargraph/environ.rb +40 -0
- data/lib/solargraph/language_server.rb +19 -17
- data/lib/solargraph/language_server/completion_item_kinds.rb +2 -0
- data/lib/solargraph/language_server/error_codes.rb +2 -0
- data/lib/solargraph/language_server/host.rb +3 -1
- data/lib/solargraph/language_server/host/cataloger.rb +2 -0
- data/lib/solargraph/language_server/host/diagnoser.rb +2 -0
- data/lib/solargraph/language_server/host/dispatch.rb +2 -0
- data/lib/solargraph/language_server/host/sources.rb +2 -0
- data/lib/solargraph/language_server/message.rb +2 -0
- data/lib/solargraph/language_server/message/base.rb +2 -0
- data/lib/solargraph/language_server/message/cancel_request.rb +13 -11
- data/lib/solargraph/language_server/message/client.rb +11 -9
- data/lib/solargraph/language_server/message/client/register_capability.rb +15 -13
- data/lib/solargraph/language_server/message/completion_item.rb +11 -9
- data/lib/solargraph/language_server/message/completion_item/resolve.rb +2 -0
- data/lib/solargraph/language_server/message/exit_notification.rb +2 -0
- data/lib/solargraph/language_server/message/extended.rb +2 -0
- data/lib/solargraph/language_server/message/extended/check_gem_version.rb +2 -0
- data/lib/solargraph/language_server/message/extended/document.rb +2 -0
- data/lib/solargraph/language_server/message/extended/document_gems.rb +2 -0
- data/lib/solargraph/language_server/message/extended/download_core.rb +27 -25
- data/lib/solargraph/language_server/message/extended/environment.rb +5 -0
- data/lib/solargraph/language_server/message/extended/search.rb +2 -0
- data/lib/solargraph/language_server/message/initialize.rb +2 -0
- data/lib/solargraph/language_server/message/initialized.rb +2 -0
- data/lib/solargraph/language_server/message/method_not_found.rb +16 -14
- data/lib/solargraph/language_server/message/method_not_implemented.rb +14 -12
- data/lib/solargraph/language_server/message/shutdown.rb +2 -0
- data/lib/solargraph/language_server/message/text_document.rb +2 -0
- data/lib/solargraph/language_server/message/text_document/base.rb +19 -17
- data/lib/solargraph/language_server/message/text_document/code_action.rb +2 -0
- data/lib/solargraph/language_server/message/text_document/completion.rb +3 -1
- data/lib/solargraph/language_server/message/text_document/definition.rb +2 -0
- data/lib/solargraph/language_server/message/text_document/did_change.rb +2 -0
- data/lib/solargraph/language_server/message/text_document/did_close.rb +15 -13
- data/lib/solargraph/language_server/message/text_document/did_open.rb +15 -13
- data/lib/solargraph/language_server/message/text_document/did_save.rb +17 -15
- data/lib/solargraph/language_server/message/text_document/document_symbol.rb +2 -0
- data/lib/solargraph/language_server/message/text_document/folding_range.rb +2 -0
- data/lib/solargraph/language_server/message/text_document/formatting.rb +8 -1
- data/lib/solargraph/language_server/message/text_document/hover.rb +3 -1
- data/lib/solargraph/language_server/message/text_document/on_type_formatting.rb +2 -0
- data/lib/solargraph/language_server/message/text_document/prepare_rename.rb +2 -0
- data/lib/solargraph/language_server/message/text_document/references.rb +2 -0
- data/lib/solargraph/language_server/message/text_document/rename.rb +2 -0
- data/lib/solargraph/language_server/message/text_document/signature_help.rb +7 -1
- data/lib/solargraph/language_server/message/workspace.rb +2 -0
- data/lib/solargraph/language_server/message/workspace/did_change_configuration.rb +2 -0
- data/lib/solargraph/language_server/message/workspace/did_change_watched_files.rb +2 -0
- data/lib/solargraph/language_server/message/workspace/did_change_workspace_folders.rb +2 -0
- data/lib/solargraph/language_server/message/workspace/workspace_symbol.rb +2 -0
- data/lib/solargraph/language_server/message_types.rb +14 -12
- data/lib/solargraph/language_server/request.rb +2 -0
- data/lib/solargraph/language_server/symbol_kinds.rb +2 -0
- data/lib/solargraph/language_server/transport.rb +2 -0
- data/lib/solargraph/language_server/transport/adapter.rb +2 -0
- data/lib/solargraph/language_server/transport/data_reader.rb +3 -1
- data/lib/solargraph/language_server/uri_helpers.rb +2 -0
- data/lib/solargraph/library.rb +2 -0
- data/lib/solargraph/location.rb +2 -0
- data/lib/solargraph/logging.rb +2 -0
- data/lib/solargraph/page.rb +2 -0
- data/lib/solargraph/pin.rb +3 -20
- data/lib/solargraph/pin/attribute.rb +2 -4
- data/lib/solargraph/pin/base.rb +3 -5
- data/lib/solargraph/pin/base_method.rb +2 -4
- data/lib/solargraph/pin/base_variable.rb +2 -0
- data/lib/solargraph/pin/block.rb +2 -4
- data/lib/solargraph/pin/class_variable.rb +2 -3
- data/lib/solargraph/pin/closure.rb +9 -0
- data/lib/solargraph/pin/common.rb +3 -5
- data/lib/solargraph/pin/constant.rb +2 -4
- data/lib/solargraph/pin/conversions.rb +4 -2
- data/lib/solargraph/pin/documenting.rb +2 -0
- data/lib/solargraph/pin/duck_method.rb +2 -0
- data/lib/solargraph/pin/global_variable.rb +2 -3
- data/lib/solargraph/pin/instance_variable.rb +2 -4
- data/lib/solargraph/pin/keyword.rb +2 -4
- data/lib/solargraph/pin/keyword_param.rb +8 -0
- data/lib/solargraph/pin/local_variable.rb +2 -4
- data/lib/solargraph/pin/localized.rb +2 -0
- data/lib/solargraph/pin/method.rb +14 -4
- data/lib/solargraph/pin/method_alias.rb +2 -4
- data/lib/solargraph/pin/namespace.rb +22 -14
- data/lib/solargraph/pin/parameter.rb +4 -6
- data/lib/solargraph/pin/proxy_type.rb +2 -0
- data/lib/solargraph/pin/reference.rb +2 -0
- data/lib/solargraph/pin/reference/extend.rb +2 -3
- data/lib/solargraph/pin/reference/include.rb +2 -3
- data/lib/solargraph/pin/reference/override.rb +12 -3
- data/lib/solargraph/pin/reference/require.rb +2 -4
- data/lib/solargraph/pin/reference/superclass.rb +2 -3
- data/lib/solargraph/pin/singleton.rb +2 -0
- data/lib/solargraph/pin/symbol.rb +2 -4
- data/lib/solargraph/pin/yard_pin.rb +2 -0
- data/lib/solargraph/pin/yard_pin/constant.rb +7 -3
- data/lib/solargraph/pin/yard_pin/method.rb +12 -10
- data/lib/solargraph/pin/yard_pin/namespace.rb +9 -4
- data/lib/solargraph/pin/yard_pin/yard_mixin.rb +30 -3
- data/lib/solargraph/position.rb +2 -0
- data/lib/solargraph/range.rb +2 -0
- data/lib/solargraph/server_methods.rb +2 -0
- data/lib/solargraph/shell.rb +33 -2
- data/lib/solargraph/source.rb +2 -0
- data/lib/solargraph/source/chain.rb +2 -0
- data/lib/solargraph/source/chain/call.rb +63 -14
- data/lib/solargraph/source/chain/class_variable.rb +2 -0
- data/lib/solargraph/source/chain/constant.rb +18 -11
- data/lib/solargraph/source/chain/global_variable.rb +2 -0
- data/lib/solargraph/source/chain/head.rb +2 -0
- data/lib/solargraph/source/chain/instance_variable.rb +2 -0
- data/lib/solargraph/source/chain/link.rb +2 -0
- data/lib/solargraph/source/chain/literal.rb +2 -0
- data/lib/solargraph/source/chain/or.rb +2 -0
- data/lib/solargraph/source/chain/variable.rb +2 -0
- data/lib/solargraph/source/change.rb +2 -0
- data/lib/solargraph/source/cursor.rb +4 -1
- data/lib/solargraph/source/encoding_fixes.rb +2 -0
- data/lib/solargraph/source/flawed_builder.rb +15 -13
- data/lib/solargraph/source/node_chainer.rb +2 -0
- data/lib/solargraph/source/node_methods.rb +9 -5
- data/lib/solargraph/source/source_chainer.rb +2 -0
- data/lib/solargraph/source/updater.rb +52 -50
- data/lib/solargraph/source_map.rb +15 -7
- data/lib/solargraph/source_map/clip.rb +35 -3
- data/lib/solargraph/source_map/completion.rb +2 -0
- data/lib/solargraph/source_map/mapper.rb +2 -0
- data/lib/solargraph/source_map/node_processor.rb +2 -0
- data/lib/solargraph/source_map/node_processor/alias_node.rb +2 -0
- data/lib/solargraph/source_map/node_processor/args_node.rb +2 -0
- data/lib/solargraph/source_map/node_processor/base.rb +5 -3
- data/lib/solargraph/source_map/node_processor/begin_node.rb +2 -0
- data/lib/solargraph/source_map/node_processor/block_node.rb +2 -0
- data/lib/solargraph/source_map/node_processor/casgn_node.rb +2 -0
- data/lib/solargraph/source_map/node_processor/cvasgn_node.rb +2 -0
- data/lib/solargraph/source_map/node_processor/def_node.rb +2 -0
- data/lib/solargraph/source_map/node_processor/defs_node.rb +2 -0
- data/lib/solargraph/source_map/node_processor/gvasgn_node.rb +2 -0
- data/lib/solargraph/source_map/node_processor/ivasgn_node.rb +3 -1
- data/lib/solargraph/source_map/node_processor/lvasgn_node.rb +2 -0
- data/lib/solargraph/source_map/node_processor/namespace_node.rb +4 -1
- data/lib/solargraph/source_map/node_processor/orasgn_node.rb +2 -0
- data/lib/solargraph/source_map/node_processor/resbody_node.rb +2 -0
- data/lib/solargraph/source_map/node_processor/sclass_node.rb +2 -0
- data/lib/solargraph/source_map/node_processor/send_node.rb +11 -6
- data/lib/solargraph/source_map/node_processor/sym_node.rb +2 -0
- data/lib/solargraph/source_map/region.rb +2 -0
- data/lib/solargraph/type_checker.rb +35 -17
- data/lib/solargraph/type_checker/param_def.rb +2 -0
- data/lib/solargraph/type_checker/problem.rb +2 -0
- data/lib/solargraph/version.rb +3 -1
- data/lib/solargraph/views/document.erb +3 -3
- data/lib/solargraph/views/environment.erb +3 -0
- data/lib/solargraph/workspace.rb +5 -1
- data/lib/solargraph/workspace/config.rb +14 -0
- data/lib/solargraph/yard_map.rb +64 -5
- data/lib/solargraph/yard_map/cache.rb +2 -0
- data/lib/solargraph/yard_map/core_docs.rb +2 -0
- data/lib/solargraph/yard_map/core_gen.rb +2 -0
- data/lib/solargraph/yard_map/mapper.rb +15 -14
- data/lib/solargraph/yard_map/rdoc_to_yard.rb +129 -0
- data/lib/yard-solargraph.rb +8 -0
- metadata +11 -2
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Solargraph
|
4
|
+
module Convention
|
5
|
+
class Base
|
6
|
+
EMPTY_ENVIRON = Environ.new
|
7
|
+
|
8
|
+
# True if the source qualifies for this convention.
|
9
|
+
# Subclasses should override this method.
|
10
|
+
def match? source
|
11
|
+
false
|
12
|
+
end
|
13
|
+
|
14
|
+
# @return [Environ]
|
15
|
+
def process
|
16
|
+
match? ? EMPTY_ENVIRON : environ
|
17
|
+
end
|
18
|
+
|
19
|
+
# The Environ for this convention.
|
20
|
+
# Subclasses should override this method.
|
21
|
+
#
|
22
|
+
# @return [Environ]
|
23
|
+
def environ
|
24
|
+
EMPTY_ENVIRON
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Solargraph
|
4
|
+
module Convention
|
5
|
+
class Gemfile < Base
|
6
|
+
def match? source
|
7
|
+
File.basename(source.filename) == 'Gemfile'
|
8
|
+
end
|
9
|
+
|
10
|
+
def environ
|
11
|
+
@environ ||= Environ.new(
|
12
|
+
requires: ['bundler'],
|
13
|
+
domains: ['Bundler::Dsl']
|
14
|
+
)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Solargraph
|
4
|
+
module Convention
|
5
|
+
class Gemspec < Base
|
6
|
+
def match? source
|
7
|
+
File.basename(source.filename).end_with?('.gemspec')
|
8
|
+
end
|
9
|
+
|
10
|
+
def environ
|
11
|
+
@environ ||= Environ.new(
|
12
|
+
requires: ['rubygems'],
|
13
|
+
overrides: [
|
14
|
+
Solargraph::Pin::Reference::Override.from_comment(
|
15
|
+
'Gem::Specification.new',
|
16
|
+
%(
|
17
|
+
@yieldparam [self]
|
18
|
+
)
|
19
|
+
)
|
20
|
+
]
|
21
|
+
)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Solargraph
|
4
|
+
module Convention
|
5
|
+
class Rspec < Base
|
6
|
+
def match? source
|
7
|
+
File.basename(source.filename) =~ /_spec\.rb$/
|
8
|
+
end
|
9
|
+
|
10
|
+
def environ
|
11
|
+
@environ ||= Environ.new(
|
12
|
+
requires: ['rspec'],
|
13
|
+
domains: ['RSpec::Matchers', 'RSpec::ExpectationGroups'],
|
14
|
+
# This override is necessary due to an erroneous @return tag in
|
15
|
+
# rspec's YARD documentation.
|
16
|
+
overrides: [
|
17
|
+
Solargraph::Pin::Reference::Override.method_return('RSpec::Matchers#expect', 'RSpec::Expectations::ExpectationTarget')
|
18
|
+
]
|
19
|
+
)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -1,5 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Solargraph
|
2
4
|
module CoreFills
|
5
|
+
Override = Pin::Reference::Override
|
6
|
+
|
3
7
|
KEYWORDS = [
|
4
8
|
'__ENCODING__', '__LINE__', '__FILE__', 'BEGIN', 'END', 'alias', 'and',
|
5
9
|
'begin', 'break', 'case', 'class', 'def', 'defined?', 'do', 'else',
|
@@ -8,58 +12,78 @@ module Solargraph
|
|
8
12
|
'then', 'true', 'undef', 'unless', 'until', 'when', 'while', 'yield'
|
9
13
|
].freeze
|
10
14
|
|
11
|
-
|
12
|
-
Array#[] Array#first Array#last
|
13
|
-
].freeze
|
14
|
-
|
15
|
-
METHODS_RETURNING_VALUE_TYPES = %w[
|
16
|
-
Hash#[]
|
17
|
-
].freeze
|
18
|
-
|
19
|
-
METHODS_WITH_YIELDPARAM_SELF = %w[
|
20
|
-
Object#tap
|
21
|
-
].freeze
|
22
|
-
|
23
|
-
METHODS_WITH_YIELDPARAM_SUBTYPES = %w[
|
15
|
+
methods_with_yieldparam_subtypes = %w[
|
24
16
|
Array#each Array#map Array#any? Array#all? Array#index Array#keep_if
|
25
17
|
Array#delete_if
|
26
18
|
Enumerable#each_entry Enumerable#map Enumerable#any? Enumerable#all?
|
27
19
|
Enumerable#select Enumerable#reject
|
28
20
|
Set#each
|
29
|
-
]
|
30
|
-
|
31
|
-
class << self
|
32
|
-
private
|
33
|
-
|
34
|
-
def override path, *tags
|
35
|
-
Solargraph::Pin::Reference::Override.new(nil, path, [YARD::Tags::Tag.new('return', nil, tags)])
|
36
|
-
end
|
37
|
-
end
|
21
|
+
]
|
38
22
|
|
39
23
|
OVERRIDES = [
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
24
|
+
Override.method_return('Array#select', 'self'),
|
25
|
+
Override.method_return('Array#reject', 'self'),
|
26
|
+
Override.method_return('Array#keep_if', 'self'),
|
27
|
+
Override.method_return('Array#delete_if', 'self'),
|
28
|
+
Override.from_comment('Array#[]', %(
|
29
|
+
@overload [](range)
|
30
|
+
@param range [Range]
|
31
|
+
@return [self]
|
32
|
+
@overload [](num1, num2)
|
33
|
+
@param num1 [Integer]
|
34
|
+
@param num2 [Integer]
|
35
|
+
@return [self]
|
36
|
+
@overload [](num)
|
37
|
+
@param num [Integer]
|
38
|
+
@return_single_parameter
|
39
|
+
@return_single_parameter
|
40
|
+
)),
|
41
|
+
Override.from_comment('Array#first', %(
|
42
|
+
@overload first(num)
|
43
|
+
@param num [Integer]
|
44
|
+
@return [self]
|
45
|
+
@return_single_parameter
|
46
|
+
)),
|
47
|
+
Override.from_comment('Array#last', %(
|
48
|
+
@overload last(num)
|
49
|
+
@param num [Integer]
|
50
|
+
@return [self]
|
51
|
+
@return_single_parameter
|
52
|
+
)),
|
53
|
+
|
54
|
+
Override.method_return('Class#new', 'self'),
|
55
|
+
Override.method_return('Class.new', 'Class<Object>'),
|
56
|
+
Override.method_return('Class#allocate', 'self'),
|
57
|
+
Override.method_return('Class.allocate', 'Class<Object>'),
|
44
58
|
|
45
|
-
|
46
|
-
override('Class.new', 'Class<Object>'),
|
47
|
-
override('Class#allocate', 'self'),
|
48
|
-
override('Class.allocate', 'Class<Object>'),
|
59
|
+
Override.method_return('Enumerable#select', 'self'),
|
49
60
|
|
50
|
-
|
61
|
+
Override.method_return('File.dirname', 'String'),
|
51
62
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
63
|
+
Override.from_comment('Hash#[]', %(
|
64
|
+
@return_value_parameter
|
65
|
+
)),
|
66
|
+
|
67
|
+
Override.method_return('Object#!', 'Boolean'),
|
68
|
+
Override.method_return('Object#clone', 'self', delete: [:overload]),
|
69
|
+
Override.method_return('Object#dup', 'self'),
|
70
|
+
Override.method_return('Object#freeze', 'self'),
|
71
|
+
Override.method_return('Object#taint', 'self'),
|
72
|
+
Override.method_return('Object#untaint', 'self'),
|
73
|
+
Override.from_comment('Object#tap', %(
|
74
|
+
@return [self]
|
75
|
+
@yieldparam [self]
|
76
|
+
)),
|
59
77
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
78
|
+
Override.method_return('String#freeze', 'self'),
|
79
|
+
Override.method_return('String#split', 'Array<String>'),
|
80
|
+
Override.method_return('String#lines', 'Array<String>')
|
81
|
+
].concat(
|
82
|
+
methods_with_yieldparam_subtypes.map do |path|
|
83
|
+
Override.from_comment(path, %(
|
84
|
+
@yieldparam_single_parameter
|
85
|
+
))
|
86
|
+
end
|
87
|
+
)
|
64
88
|
end
|
65
89
|
end
|
@@ -1,13 +1,15 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
#
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Solargraph
|
4
|
+
module Diagnostics
|
5
|
+
# These severity constants match the DiagnosticSeverity constants in the
|
6
|
+
# language server protocol.
|
7
|
+
#
|
8
|
+
module Severities
|
9
|
+
ERROR = 1
|
10
|
+
WARNING = 2
|
11
|
+
INFORMATION = 3
|
12
|
+
HINT = 4
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'bundler'
|
4
|
+
|
5
|
+
module Solargraph
|
6
|
+
class Documentor
|
7
|
+
RDOC_GEMS = %w[
|
8
|
+
actioncable actionmailbox actionmailer actionpack actiontext actionview
|
9
|
+
activejob activemodel activerecord activestorage activesupport railties
|
10
|
+
]
|
11
|
+
|
12
|
+
def initialize directory, rebuild: false
|
13
|
+
@directory = directory
|
14
|
+
@rebuild = rebuild
|
15
|
+
end
|
16
|
+
|
17
|
+
def document
|
18
|
+
Dir.chdir @directory do
|
19
|
+
Bundler.with_clean_env do
|
20
|
+
Bundler.reset!
|
21
|
+
lockfile = Bundler::LockfileParser.new(Bundler.read_file(Bundler.default_lockfile))
|
22
|
+
# @param spec [Gem::Specification]
|
23
|
+
lockfile.specs.each do |spec|
|
24
|
+
spec = spec.__materialize__
|
25
|
+
yd = YARD::Registry.yardoc_file_for_gem(spec.name, spec.version)
|
26
|
+
if !yd || @rebuild
|
27
|
+
puts "Documenting #{spec.name} #{spec.version}"
|
28
|
+
`yard gems #{spec.name} #{spec.version} #{@rebuild ? '--rebuild' : ''}`
|
29
|
+
end
|
30
|
+
if RDOC_GEMS.include?(spec.name)
|
31
|
+
cache = File.join(Solargraph::YardMap::CoreDocs.cache_dir, 'gems', "#{spec.name}-#{spec.version}", 'yardoc')
|
32
|
+
next if File.exist?(cache) && !@rebuild
|
33
|
+
puts "Caching custom documentation for #{spec.name} #{spec.version}"
|
34
|
+
Solargraph::YardMap::RdocToYard.run(spec)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
Bundler.reset!
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Solargraph
|
4
|
+
class Environ
|
5
|
+
# @return [Array<String>]
|
6
|
+
attr_reader :requires
|
7
|
+
|
8
|
+
# @return [Array<String>]
|
9
|
+
attr_reader :domains
|
10
|
+
|
11
|
+
# @return [Array<Pin::Reference::Override>]
|
12
|
+
attr_reader :overrides
|
13
|
+
|
14
|
+
# @param requires [Array<String>]
|
15
|
+
# @param domains [Array<String>]
|
16
|
+
# @param overrides [Array<Pin::Reference::Override>]
|
17
|
+
def initialize requires: [], domains: [], overrides: []
|
18
|
+
@requires = requires
|
19
|
+
@domains = domains
|
20
|
+
@overrides = overrides
|
21
|
+
end
|
22
|
+
|
23
|
+
# @return [self]
|
24
|
+
def clear
|
25
|
+
domains.clear
|
26
|
+
requires.clear
|
27
|
+
overrides.clear
|
28
|
+
self
|
29
|
+
end
|
30
|
+
|
31
|
+
# @param other [Environ]
|
32
|
+
# @return [self]
|
33
|
+
def merge other
|
34
|
+
domains.concat other.domains
|
35
|
+
requires.concat other.requires
|
36
|
+
overrides.concat other.overrides
|
37
|
+
self
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -1,17 +1,19 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
require 'solargraph/language_server/
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
#
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
autoload :
|
13
|
-
autoload :
|
14
|
-
autoload :
|
15
|
-
autoload :
|
16
|
-
|
17
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'solargraph/language_server/error_codes'
|
4
|
+
require 'solargraph/language_server/completion_item_kinds'
|
5
|
+
require 'solargraph/language_server/symbol_kinds'
|
6
|
+
|
7
|
+
module Solargraph
|
8
|
+
# The LanguageServer namespace contains the classes and modules that compose
|
9
|
+
# concrete implementations of language servers.
|
10
|
+
#
|
11
|
+
module LanguageServer
|
12
|
+
autoload :Host, 'solargraph/language_server/host'
|
13
|
+
autoload :Message, 'solargraph/language_server/message'
|
14
|
+
autoload :UriHelpers, 'solargraph/language_server/uri_helpers'
|
15
|
+
autoload :MessageTypes, 'solargraph/language_server/message_types'
|
16
|
+
autoload :Request, 'solargraph/language_server/request'
|
17
|
+
autoload :Transport, 'solargraph/language_server/transport'
|
18
|
+
end
|
19
|
+
end
|