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
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Solargraph
|
2
4
|
module Pin
|
3
5
|
module Common
|
@@ -11,10 +13,6 @@ module Solargraph
|
|
11
13
|
@name ||= ''
|
12
14
|
end
|
13
15
|
|
14
|
-
def kind
|
15
|
-
@kind ||= Pin::KEYWORD
|
16
|
-
end
|
17
|
-
|
18
16
|
def return_type
|
19
17
|
@return_type ||= ComplexType::UNDEFINED
|
20
18
|
end
|
@@ -49,7 +47,7 @@ module Solargraph
|
|
49
47
|
def find_context
|
50
48
|
here = closure
|
51
49
|
until here.nil?
|
52
|
-
return here.return_type if here.
|
50
|
+
return here.return_type if here.is_a?(Pin::Namespace)
|
53
51
|
here = here.closure
|
54
52
|
end
|
55
53
|
ComplexType::ROOT
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Solargraph
|
2
4
|
module Pin
|
3
5
|
class Constant < BaseVariable
|
@@ -8,10 +10,6 @@ module Solargraph
|
|
8
10
|
@visibility = visibility
|
9
11
|
end
|
10
12
|
|
11
|
-
def kind
|
12
|
-
Pin::CONSTANT
|
13
|
-
end
|
14
|
-
|
15
13
|
def completion_item_kind
|
16
14
|
Solargraph::LanguageServer::CompletionItemKinds::CONSTANT
|
17
15
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Solargraph
|
2
4
|
module Pin
|
3
5
|
# @todo Move this stuff. It should be the responsibility of the language server.
|
@@ -43,8 +45,8 @@ module Solargraph
|
|
43
45
|
def detail
|
44
46
|
# This property is not cached in an instance variable because it can
|
45
47
|
# change when pins get proxied.
|
46
|
-
detail =
|
47
|
-
detail += "(#{parameters.join(', ')}) " unless
|
48
|
+
detail = String.new
|
49
|
+
detail += "(#{parameters.join(', ')}) " unless !is_a?(Pin::BaseMethod) or parameters.empty?
|
48
50
|
detail += "=#{probed? ? '~' : (proxied? ? '^' : '>')} #{return_type}" unless return_type.undefined?
|
49
51
|
detail.strip!
|
50
52
|
return nil if detail.empty?
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Solargraph
|
2
4
|
module Pin
|
3
5
|
class LocalVariable < BaseVariable
|
@@ -9,10 +11,6 @@ module Solargraph
|
|
9
11
|
@presence = presence
|
10
12
|
end
|
11
13
|
|
12
|
-
def kind
|
13
|
-
Pin::LOCAL_VARIABLE
|
14
|
-
end
|
15
|
-
|
16
14
|
def try_merge! pin
|
17
15
|
return false unless super
|
18
16
|
@presence = pin.presence
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'htmlentities'
|
2
4
|
|
3
5
|
module Solargraph
|
@@ -24,10 +26,6 @@ module Solargraph
|
|
24
26
|
@parameter_names ||= parameters.map{|p| p.split(/[ =:]/).first.gsub(/^(\*{1,2}|&)/, '')}
|
25
27
|
end
|
26
28
|
|
27
|
-
def kind
|
28
|
-
Solargraph::Pin::METHOD
|
29
|
-
end
|
30
|
-
|
31
29
|
def completion_item_kind
|
32
30
|
Solargraph::LanguageServer::CompletionItemKinds::METHOD
|
33
31
|
end
|
@@ -73,6 +71,18 @@ module Solargraph
|
|
73
71
|
true
|
74
72
|
end
|
75
73
|
|
74
|
+
# @return [Array<Pin::Method>]
|
75
|
+
def overloads
|
76
|
+
@overloads ||= docstring.tags(:overload).map do |tag|
|
77
|
+
Solargraph::Pin::Method.new(
|
78
|
+
name: name,
|
79
|
+
closure: closure,
|
80
|
+
args: tag.parameters.map(&:first),
|
81
|
+
comments: tag.text
|
82
|
+
)
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
76
86
|
private
|
77
87
|
|
78
88
|
# @return [Parser::AST::Node, nil]
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Solargraph
|
2
4
|
module Pin
|
3
5
|
# Use this class to track method aliases for later remapping. Common
|
@@ -17,10 +19,6 @@ module Solargraph
|
|
17
19
|
@original = original
|
18
20
|
end
|
19
21
|
|
20
|
-
def kind
|
21
|
-
Pin::METHOD_ALIAS
|
22
|
-
end
|
23
|
-
|
24
22
|
def visibility
|
25
23
|
:public
|
26
24
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Solargraph
|
2
4
|
module Pin
|
3
5
|
class Namespace < Closure
|
@@ -7,23 +9,25 @@ module Solargraph
|
|
7
9
|
# @return [::Symbol] :class or :module
|
8
10
|
attr_reader :type
|
9
11
|
|
10
|
-
#
|
11
|
-
|
12
|
+
# @param type [Symbol] :class or :module
|
13
|
+
# @param visibility [Symbol] :public or :private
|
14
|
+
# @param gates [Array<String>]
|
15
|
+
def initialize type: :class, visibility: :public, gates: [''], **splat
|
12
16
|
# super(location, namespace, name, comments)
|
13
17
|
super(splat)
|
14
18
|
@type = type
|
15
19
|
@visibility = visibility
|
16
20
|
if name.start_with?('::')
|
17
21
|
@name = name[2..-1]
|
18
|
-
@closure = Pin::ROOT_PIN
|
22
|
+
@closure = Solargraph::Pin::ROOT_PIN
|
19
23
|
end
|
20
|
-
@
|
21
|
-
if @
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
@closure = Pin::Namespace.new(name:
|
24
|
+
@open_gates = gates
|
25
|
+
if @open_gates.one? && @open_gates.first.empty? && @name.include?('::')
|
26
|
+
# In this case, a chained namespace was opened (e.g., Foo::Bar)
|
27
|
+
# but Foo does not exist.
|
28
|
+
parts = @name.split('::')
|
29
|
+
@name = parts.pop
|
30
|
+
@closure = Pin::Namespace.new(name: parts.join('::'), gates: [parts.join('::')])
|
27
31
|
@context = nil
|
28
32
|
end
|
29
33
|
end
|
@@ -32,10 +36,6 @@ module Solargraph
|
|
32
36
|
context.namespace
|
33
37
|
end
|
34
38
|
|
35
|
-
def kind
|
36
|
-
Pin::NAMESPACE
|
37
|
-
end
|
38
|
-
|
39
39
|
def full_context
|
40
40
|
@full_context ||= ComplexType.try_parse("#{type.to_s.capitalize}<#{path}>")
|
41
41
|
end
|
@@ -72,6 +72,14 @@ module Solargraph
|
|
72
72
|
def typify api_map
|
73
73
|
return_type
|
74
74
|
end
|
75
|
+
|
76
|
+
def gates
|
77
|
+
@gates ||= if path.empty?
|
78
|
+
@open_gates
|
79
|
+
else
|
80
|
+
[path] + @open_gates
|
81
|
+
end
|
82
|
+
end
|
75
83
|
end
|
76
84
|
end
|
77
85
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Solargraph
|
2
4
|
module Pin
|
3
5
|
class Parameter < LocalVariable
|
@@ -68,18 +70,14 @@ module Solargraph
|
|
68
70
|
locals = clip.locals - [self]
|
69
71
|
meths = chain.define(api_map, closure, locals)
|
70
72
|
meths.each do |meth|
|
71
|
-
if
|
73
|
+
if meth.docstring.has_tag?(:yieldparam_single_parameter)
|
72
74
|
bmeth = chain.base.define(api_map, closure, locals).first
|
73
75
|
return ComplexType::UNDEFINED if bmeth.nil? || bmeth.return_type.undefined? || bmeth.return_type.subtypes.empty?
|
74
76
|
return bmeth.return_type.subtypes.first.qualify(api_map, bmeth.context.namespace)
|
75
|
-
elsif (Solargraph::CoreFills::METHODS_WITH_YIELDPARAM_SELF.include?(meth.path))
|
76
|
-
bmeth = chain.base.define(api_map, closure, locals).first
|
77
|
-
return ComplexType::UNDEFINED if bmeth.nil?
|
78
|
-
return bmeth.typify(api_map)
|
79
77
|
else
|
80
78
|
yps = meth.docstring.tags(:yieldparam)
|
81
79
|
unless yps[index].nil? or yps[index].types.nil? or yps[index].types.empty?
|
82
|
-
return ComplexType.try_parse(yps[index].types.first).qualify(api_map, meth.context.namespace)
|
80
|
+
return ComplexType.try_parse(yps[index].types.first).self_to(chain.base.infer(api_map, closure, locals).namespace).qualify(api_map, meth.context.namespace)
|
83
81
|
end
|
84
82
|
end
|
85
83
|
end
|
@@ -1,16 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Solargraph
|
2
4
|
module Pin
|
3
5
|
class Reference
|
4
6
|
class Override < Reference
|
5
7
|
attr_reader :tags
|
6
8
|
|
7
|
-
|
9
|
+
attr_reader :delete
|
10
|
+
|
11
|
+
def initialize location, name, tags, delete = []
|
8
12
|
super(location: location, name: name)
|
9
13
|
@tags = tags
|
14
|
+
@delete = delete
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.method_return name, *tags, delete: []
|
18
|
+
new(nil, name, [YARD::Tags::Tag.new('return', nil, tags)], delete)
|
10
19
|
end
|
11
20
|
|
12
|
-
def
|
13
|
-
|
21
|
+
def self.from_comment name, comment
|
22
|
+
new(nil, name, Solargraph::Source.parse_docstring(comment).to_docstring.tags)
|
14
23
|
end
|
15
24
|
end
|
16
25
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Solargraph
|
2
4
|
module Pin
|
3
5
|
class Reference
|
@@ -6,10 +8,6 @@ module Solargraph
|
|
6
8
|
# super(location, '', name)
|
7
9
|
super(location: location, name: name)
|
8
10
|
end
|
9
|
-
|
10
|
-
def kind
|
11
|
-
Pin::REQUIRE_REFERENCE
|
12
|
-
end
|
13
11
|
end
|
14
12
|
end
|
15
13
|
end
|
@@ -1,19 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Solargraph
|
2
4
|
module Pin
|
3
5
|
module YardPin
|
4
6
|
class Constant < Pin::Constant
|
5
7
|
include YardMixin
|
6
8
|
|
7
|
-
def initialize code_object,
|
9
|
+
def initialize code_object, closure = nil, spec = nil
|
8
10
|
@code_object = code_object
|
11
|
+
@spec = spec
|
9
12
|
closure ||= Solargraph::Pin::Namespace.new(
|
10
|
-
name: code_object.namespace.to_s
|
13
|
+
name: code_object.namespace.to_s,
|
14
|
+
gates: [code_object.namespace.to_s]
|
11
15
|
)
|
12
16
|
super(
|
13
17
|
location: location,
|
14
18
|
closure: closure,
|
15
19
|
name: code_object.name.to_s,
|
16
|
-
comments:
|
20
|
+
comments: nil,
|
17
21
|
visibility: code_object.visibility
|
18
22
|
)
|
19
23
|
end
|