solargraph 0.58.3 → 0.60.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.envrc +3 -0
- data/.github/workflows/linting.yml +12 -5
- data/.github/workflows/plugins.yml +54 -34
- data/.github/workflows/rspec.yml +18 -28
- data/.github/workflows/typecheck.yml +6 -3
- data/.rubocop.yml +39 -6
- data/.rubocop_todo.yml +53 -966
- data/CHANGELOG.md +44 -0
- data/Gemfile +6 -1
- data/README.md +3 -3
- data/Rakefile +26 -23
- data/bin/solargraph +2 -1
- data/lib/solargraph/api_map/cache.rb +3 -3
- data/lib/solargraph/api_map/constants.rb +12 -3
- data/lib/solargraph/api_map/index.rb +42 -20
- data/lib/solargraph/api_map/source_to_yard.rb +22 -9
- data/lib/solargraph/api_map/store.rb +61 -36
- data/lib/solargraph/api_map.rb +192 -78
- data/lib/solargraph/bench.rb +2 -3
- data/lib/solargraph/complex_type/conformance.rb +176 -0
- data/lib/solargraph/complex_type/type_methods.rb +31 -18
- data/lib/solargraph/complex_type/unique_type.rb +225 -63
- data/lib/solargraph/complex_type.rb +177 -59
- data/lib/solargraph/convention/active_support_concern.rb +111 -111
- data/lib/solargraph/convention/base.rb +50 -50
- data/lib/solargraph/convention/data_definition/data_assignment_node.rb +1 -1
- data/lib/solargraph/convention/data_definition/data_definition_node.rb +7 -5
- data/lib/solargraph/convention/data_definition.rb +5 -2
- data/lib/solargraph/convention/gemfile.rb +1 -1
- data/lib/solargraph/convention/gemspec.rb +1 -1
- data/lib/solargraph/convention/rakefile.rb +1 -1
- data/lib/solargraph/convention/struct_definition/struct_assignment_node.rb +2 -1
- data/lib/solargraph/convention/struct_definition/struct_definition_node.rb +4 -3
- data/lib/solargraph/convention/struct_definition.rb +8 -4
- data/lib/solargraph/convention.rb +2 -2
- data/lib/solargraph/converters/dd.rb +2 -0
- data/lib/solargraph/converters/dl.rb +2 -0
- data/lib/solargraph/converters/dt.rb +2 -0
- data/lib/solargraph/converters/misc.rb +2 -0
- data/lib/solargraph/diagnostics/require_not_found.rb +1 -0
- data/lib/solargraph/diagnostics/rubocop.rb +11 -10
- data/lib/solargraph/diagnostics/rubocop_helpers.rb +5 -3
- data/lib/solargraph/diagnostics/type_check.rb +11 -10
- data/lib/solargraph/diagnostics/update_errors.rb +4 -8
- data/lib/solargraph/diagnostics.rb +55 -55
- data/lib/solargraph/doc_map.rb +39 -39
- data/lib/solargraph/environ.rb +52 -52
- data/lib/solargraph/equality.rb +4 -4
- data/lib/solargraph/gem_pins.rb +4 -15
- data/lib/solargraph/language_server/error_codes.rb +10 -10
- data/lib/solargraph/language_server/host/diagnoser.rb +1 -1
- data/lib/solargraph/language_server/host/dispatch.rb +3 -3
- data/lib/solargraph/language_server/host/message_worker.rb +4 -3
- data/lib/solargraph/language_server/host/sources.rb +2 -1
- data/lib/solargraph/language_server/host.rb +35 -28
- data/lib/solargraph/language_server/message/base.rb +1 -1
- data/lib/solargraph/language_server/message/client/register_capability.rb +1 -3
- data/lib/solargraph/language_server/message/completion_item/resolve.rb +6 -8
- data/lib/solargraph/language_server/message/extended/check_gem_version.rb +12 -18
- data/lib/solargraph/language_server/message/extended/document.rb +1 -0
- data/lib/solargraph/language_server/message/extended/document_gems.rb +7 -7
- data/lib/solargraph/language_server/message/extended/download_core.rb +2 -1
- data/lib/solargraph/language_server/message/extended/environment.rb +25 -25
- data/lib/solargraph/language_server/message/extended/search.rb +1 -1
- data/lib/solargraph/language_server/message/initialize.rb +20 -14
- data/lib/solargraph/language_server/message/initialized.rb +28 -28
- data/lib/solargraph/language_server/message/text_document/completion.rb +10 -8
- data/lib/solargraph/language_server/message/text_document/definition.rb +41 -32
- data/lib/solargraph/language_server/message/text_document/document_highlight.rb +17 -10
- data/lib/solargraph/language_server/message/text_document/document_symbol.rb +29 -19
- data/lib/solargraph/language_server/message/text_document/formatting.rb +8 -6
- data/lib/solargraph/language_server/message/text_document/hover.rb +5 -5
- data/lib/solargraph/language_server/message/text_document/prepare_rename.rb +13 -6
- data/lib/solargraph/language_server/message/text_document/references.rb +17 -10
- data/lib/solargraph/language_server/message/text_document/rename.rb +20 -13
- data/lib/solargraph/language_server/message/text_document/signature_help.rb +3 -2
- data/lib/solargraph/language_server/message/text_document/type_definition.rb +25 -17
- data/lib/solargraph/language_server/message/text_document.rb +28 -28
- data/lib/solargraph/language_server/message/workspace/did_change_configuration.rb +34 -28
- data/lib/solargraph/language_server/message/workspace/did_change_watched_files.rb +38 -30
- data/lib/solargraph/language_server/message/workspace/did_change_workspace_folders.rb +23 -17
- data/lib/solargraph/language_server/message/workspace/workspace_symbol.rb +27 -17
- data/lib/solargraph/language_server/message.rb +1 -1
- data/lib/solargraph/language_server/progress.rb +143 -143
- data/lib/solargraph/language_server/request.rb +4 -2
- data/lib/solargraph/language_server/transport/adapter.rb +68 -68
- data/lib/solargraph/language_server/transport/data_reader.rb +11 -13
- data/lib/solargraph/language_server/uri_helpers.rb +2 -2
- data/lib/solargraph/language_server.rb +20 -20
- data/lib/solargraph/library.rb +57 -38
- data/lib/solargraph/location.rb +17 -14
- data/lib/solargraph/logging.rb +22 -4
- data/lib/solargraph/page.rb +1 -1
- data/lib/solargraph/parser/comment_ripper.rb +19 -4
- data/lib/solargraph/parser/flow_sensitive_typing.rb +324 -108
- data/lib/solargraph/parser/node_processor/base.rb +34 -4
- data/lib/solargraph/parser/node_processor.rb +8 -7
- data/lib/solargraph/parser/parser_gem/class_methods.rb +30 -14
- data/lib/solargraph/parser/parser_gem/flawed_builder.rb +1 -1
- data/lib/solargraph/parser/parser_gem/node_chainer.rb +51 -25
- data/lib/solargraph/parser/parser_gem/node_methods.rb +222 -72
- data/lib/solargraph/parser/parser_gem/node_processors/alias_node.rb +24 -24
- data/lib/solargraph/parser/parser_gem/node_processors/and_node.rb +4 -4
- data/lib/solargraph/parser/parser_gem/node_processors/args_node.rb +13 -11
- data/lib/solargraph/parser/parser_gem/node_processors/begin_node.rb +9 -0
- data/lib/solargraph/parser/parser_gem/node_processors/block_node.rb +11 -12
- data/lib/solargraph/parser/parser_gem/node_processors/casgn_node.rb +36 -36
- data/lib/solargraph/parser/parser_gem/node_processors/cvasgn_node.rb +24 -24
- data/lib/solargraph/parser/parser_gem/node_processors/def_node.rb +10 -3
- data/lib/solargraph/parser/parser_gem/node_processors/defs_node.rb +9 -8
- data/lib/solargraph/parser/parser_gem/node_processors/gvasgn_node.rb +24 -24
- data/lib/solargraph/parser/parser_gem/node_processors/if_node.rb +36 -6
- data/lib/solargraph/parser/parser_gem/node_processors/ivasgn_node.rb +5 -3
- data/lib/solargraph/parser/parser_gem/node_processors/lvasgn_node.rb +1 -0
- data/lib/solargraph/parser/parser_gem/node_processors/masgn_node.rb +3 -1
- data/lib/solargraph/parser/parser_gem/node_processors/namespace_node.rb +64 -40
- data/lib/solargraph/parser/parser_gem/node_processors/opasgn_node.rb +3 -3
- data/lib/solargraph/parser/parser_gem/node_processors/or_node.rb +22 -0
- data/lib/solargraph/parser/parser_gem/node_processors/orasgn_node.rb +1 -1
- data/lib/solargraph/parser/parser_gem/node_processors/resbody_node.rb +2 -1
- data/lib/solargraph/parser/parser_gem/node_processors/sclass_node.rb +4 -5
- data/lib/solargraph/parser/parser_gem/node_processors/send_node.rb +124 -113
- data/lib/solargraph/parser/parser_gem/node_processors/sym_node.rb +20 -20
- data/lib/solargraph/parser/parser_gem/node_processors/until_node.rb +1 -1
- data/lib/solargraph/parser/parser_gem/node_processors/when_node.rb +23 -0
- data/lib/solargraph/parser/parser_gem/node_processors/while_node.rb +6 -2
- data/lib/solargraph/parser/parser_gem/node_processors.rb +4 -0
- data/lib/solargraph/parser/parser_gem.rb +2 -0
- data/lib/solargraph/parser/region.rb +9 -3
- data/lib/solargraph/parser/snippet.rb +3 -1
- data/lib/solargraph/parser.rb +2 -0
- data/lib/solargraph/pin/base.rb +157 -85
- data/lib/solargraph/pin/base_variable.rb +273 -24
- data/lib/solargraph/pin/block.rb +29 -6
- data/lib/solargraph/pin/breakable.rb +7 -1
- data/lib/solargraph/pin/callable.rb +67 -23
- data/lib/solargraph/pin/closure.rb +7 -10
- data/lib/solargraph/pin/common.rb +36 -6
- data/lib/solargraph/pin/compound_statement.rb +55 -0
- data/lib/solargraph/pin/constant.rb +3 -5
- data/lib/solargraph/pin/conversions.rb +10 -4
- data/lib/solargraph/pin/delegated_method.rb +19 -8
- data/lib/solargraph/pin/documenting.rb +4 -2
- data/lib/solargraph/pin/instance_variable.rb +5 -1
- data/lib/solargraph/pin/keyword.rb +0 -4
- data/lib/solargraph/pin/local_variable.rb +15 -59
- data/lib/solargraph/pin/method.rb +205 -111
- data/lib/solargraph/pin/method_alias.rb +8 -0
- data/lib/solargraph/pin/namespace.rb +19 -12
- data/lib/solargraph/pin/parameter.rb +102 -36
- data/lib/solargraph/pin/proxy_type.rb +4 -1
- data/lib/solargraph/pin/reference/override.rb +1 -1
- data/lib/solargraph/pin/reference/require.rb +14 -14
- data/lib/solargraph/pin/reference/superclass.rb +2 -0
- data/lib/solargraph/pin/reference/type_alias.rb +16 -0
- data/lib/solargraph/pin/reference.rb +20 -0
- data/lib/solargraph/pin/search.rb +8 -7
- data/lib/solargraph/pin/signature.rb +15 -12
- data/lib/solargraph/pin/singleton.rb +11 -11
- data/lib/solargraph/pin/symbol.rb +2 -1
- data/lib/solargraph/pin/until.rb +2 -4
- data/lib/solargraph/pin/while.rb +2 -4
- data/lib/solargraph/pin.rb +2 -0
- data/lib/solargraph/pin_cache.rb +22 -19
- data/lib/solargraph/position.rb +17 -10
- data/lib/solargraph/range.rb +16 -15
- data/lib/solargraph/rbs_map/conversions.rb +278 -191
- data/lib/solargraph/rbs_map/core_fills.rb +18 -11
- data/lib/solargraph/rbs_map/core_map.rb +24 -17
- data/lib/solargraph/rbs_map/stdlib_map.rb +33 -5
- data/lib/solargraph/rbs_map.rb +76 -32
- data/lib/solargraph/rbs_translator.rb +206 -0
- data/lib/solargraph/server_methods.rb +1 -1
- data/lib/solargraph/shell.rb +330 -71
- data/lib/solargraph/source/chain/array.rb +3 -12
- data/lib/solargraph/source/chain/block_symbol.rb +13 -13
- data/lib/solargraph/source/chain/block_variable.rb +13 -13
- data/lib/solargraph/source/chain/call.rb +91 -119
- data/lib/solargraph/source/chain/class_variable.rb +1 -1
- data/lib/solargraph/source/chain/constant.rb +5 -1
- data/lib/solargraph/source/chain/global_variable.rb +1 -1
- data/lib/solargraph/source/chain/hash.rb +8 -5
- data/lib/solargraph/source/chain/head.rb +19 -19
- data/lib/solargraph/source/chain/if.rb +12 -10
- data/lib/solargraph/source/chain/instance_variable.rb +24 -1
- data/lib/solargraph/source/chain/link.rb +12 -22
- data/lib/solargraph/source/chain/literal.rb +22 -15
- data/lib/solargraph/source/chain/or.rb +10 -4
- data/lib/solargraph/source/chain/q_call.rb +2 -0
- data/lib/solargraph/source/chain/variable.rb +3 -1
- data/lib/solargraph/source/chain/z_super.rb +1 -3
- data/lib/solargraph/source/chain.rb +51 -38
- data/lib/solargraph/source/change.rb +12 -5
- data/lib/solargraph/source/cursor.rb +33 -18
- data/lib/solargraph/source/encoding_fixes.rb +6 -7
- data/lib/solargraph/source/source_chainer.rb +56 -32
- data/lib/solargraph/source/updater.rb +5 -1
- data/lib/solargraph/source.rb +59 -35
- data/lib/solargraph/source_map/clip.rb +54 -30
- data/lib/solargraph/source_map/data.rb +4 -1
- data/lib/solargraph/source_map/mapper.rb +28 -131
- data/lib/solargraph/source_map.rb +35 -9
- data/lib/solargraph/type_checker/problem.rb +3 -1
- data/lib/solargraph/type_checker/rules.rb +81 -8
- data/lib/solargraph/type_checker.rb +196 -122
- data/lib/solargraph/version.rb +1 -1
- data/lib/solargraph/workspace/config.rb +14 -11
- data/lib/solargraph/workspace/gemspecs.rb +367 -0
- data/lib/solargraph/workspace/require_paths.rb +1 -0
- data/lib/solargraph/workspace.rb +50 -28
- data/lib/solargraph/yard_map/cache.rb +25 -25
- data/lib/solargraph/yard_map/directives/attribute_directive.rb +65 -0
- data/lib/solargraph/yard_map/directives/domain_directive.rb +30 -0
- data/lib/solargraph/yard_map/directives/method_directive.rb +51 -0
- data/lib/solargraph/yard_map/directives/override_directive.rb +30 -0
- data/lib/solargraph/yard_map/directives/parse_directive.rb +53 -0
- data/lib/solargraph/yard_map/directives/visibility_directive.rb +70 -0
- data/lib/solargraph/yard_map/directives.rb +35 -0
- data/lib/solargraph/yard_map/helpers.rb +8 -3
- data/lib/solargraph/yard_map/macro.rb +113 -0
- data/lib/solargraph/yard_map/mapper/to_constant.rb +28 -28
- data/lib/solargraph/yard_map/mapper/to_method.rb +13 -7
- data/lib/solargraph/yard_map/mapper/to_namespace.rb +2 -1
- data/lib/solargraph/yard_map/mapper.rb +31 -8
- data/lib/solargraph/yard_map.rb +19 -18
- data/lib/solargraph/yard_tags.rb +2 -2
- data/lib/solargraph/yardoc.rb +7 -4
- data/lib/solargraph.rb +34 -10
- data/rbs/fills/rubygems/0/dependency.rbs +193 -0
- data/rbs/shims/ast/0/node.rbs +1 -1
- data/rbs/shims/diff-lcs/1.5/diff-lcs.rbs +11 -0
- data/solargraph.gemspec +39 -35
- metadata +77 -41
- data/lib/solargraph/type_checker/checks.rb +0 -124
- data/lib/solargraph/type_checker/param_def.rb +0 -37
- data/lib/solargraph/yard_map/to_method.rb +0 -89
- data/rbs/fills/tuple/tuple.rbs +0 -149
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: solargraph
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.60.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Fred Snyder
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: ast
|
|
@@ -156,33 +156,33 @@ dependencies:
|
|
|
156
156
|
- !ruby/object:Gem::Version
|
|
157
157
|
version: '0.1'
|
|
158
158
|
- !ruby/object:Gem::Dependency
|
|
159
|
-
name:
|
|
159
|
+
name: open3
|
|
160
160
|
requirement: !ruby/object:Gem::Requirement
|
|
161
161
|
requirements:
|
|
162
162
|
- - "~>"
|
|
163
163
|
- !ruby/object:Gem::Version
|
|
164
|
-
version:
|
|
164
|
+
version: 0.2.1
|
|
165
165
|
type: :runtime
|
|
166
166
|
prerelease: false
|
|
167
167
|
version_requirements: !ruby/object:Gem::Requirement
|
|
168
168
|
requirements:
|
|
169
169
|
- - "~>"
|
|
170
170
|
- !ruby/object:Gem::Version
|
|
171
|
-
version:
|
|
171
|
+
version: 0.2.1
|
|
172
172
|
- !ruby/object:Gem::Dependency
|
|
173
|
-
name:
|
|
173
|
+
name: ostruct
|
|
174
174
|
requirement: !ruby/object:Gem::Requirement
|
|
175
175
|
requirements:
|
|
176
176
|
- - "~>"
|
|
177
177
|
- !ruby/object:Gem::Version
|
|
178
|
-
version: 0.
|
|
178
|
+
version: '0.6'
|
|
179
179
|
type: :runtime
|
|
180
180
|
prerelease: false
|
|
181
181
|
version_requirements: !ruby/object:Gem::Requirement
|
|
182
182
|
requirements:
|
|
183
183
|
- - "~>"
|
|
184
184
|
- !ruby/object:Gem::Version
|
|
185
|
-
version: 0.
|
|
185
|
+
version: '0.6'
|
|
186
186
|
- !ruby/object:Gem::Dependency
|
|
187
187
|
name: parser
|
|
188
188
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -217,20 +217,28 @@ dependencies:
|
|
|
217
217
|
requirements:
|
|
218
218
|
- - ">="
|
|
219
219
|
- !ruby/object:Gem::Version
|
|
220
|
-
version: 3.
|
|
221
|
-
- - "<="
|
|
222
|
-
- !ruby/object:Gem::Version
|
|
223
|
-
version: 4.0.0.dev.4
|
|
220
|
+
version: 3.10.0
|
|
224
221
|
type: :runtime
|
|
225
222
|
prerelease: false
|
|
226
223
|
version_requirements: !ruby/object:Gem::Requirement
|
|
227
224
|
requirements:
|
|
228
225
|
- - ">="
|
|
229
226
|
- !ruby/object:Gem::Version
|
|
230
|
-
version: 3.
|
|
231
|
-
|
|
227
|
+
version: 3.10.0
|
|
228
|
+
- !ruby/object:Gem::Dependency
|
|
229
|
+
name: rdoc
|
|
230
|
+
requirement: !ruby/object:Gem::Requirement
|
|
231
|
+
requirements:
|
|
232
|
+
- - "~>"
|
|
232
233
|
- !ruby/object:Gem::Version
|
|
233
|
-
version:
|
|
234
|
+
version: '7.0'
|
|
235
|
+
type: :runtime
|
|
236
|
+
prerelease: false
|
|
237
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
238
|
+
requirements:
|
|
239
|
+
- - "~>"
|
|
240
|
+
- !ruby/object:Gem::Version
|
|
241
|
+
version: '7.0'
|
|
234
242
|
- !ruby/object:Gem::Dependency
|
|
235
243
|
name: reverse_markdown
|
|
236
244
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -259,6 +267,20 @@ dependencies:
|
|
|
259
267
|
- - "~>"
|
|
260
268
|
- !ruby/object:Gem::Version
|
|
261
269
|
version: '1.76'
|
|
270
|
+
- !ruby/object:Gem::Dependency
|
|
271
|
+
name: sord
|
|
272
|
+
requirement: !ruby/object:Gem::Requirement
|
|
273
|
+
requirements:
|
|
274
|
+
- - "~>"
|
|
275
|
+
- !ruby/object:Gem::Version
|
|
276
|
+
version: '7.0'
|
|
277
|
+
type: :runtime
|
|
278
|
+
prerelease: false
|
|
279
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
280
|
+
requirements:
|
|
281
|
+
- - "~>"
|
|
282
|
+
- !ruby/object:Gem::Version
|
|
283
|
+
version: '7.0'
|
|
262
284
|
- !ruby/object:Gem::Dependency
|
|
263
285
|
name: thor
|
|
264
286
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -308,33 +330,33 @@ dependencies:
|
|
|
308
330
|
- !ruby/object:Gem::Version
|
|
309
331
|
version: 0.9.24
|
|
310
332
|
- !ruby/object:Gem::Dependency
|
|
311
|
-
name: yard-
|
|
333
|
+
name: yard-activesupport-concern
|
|
312
334
|
requirement: !ruby/object:Gem::Requirement
|
|
313
335
|
requirements:
|
|
314
336
|
- - "~>"
|
|
315
337
|
- !ruby/object:Gem::Version
|
|
316
|
-
version: '0.
|
|
338
|
+
version: '0.0'
|
|
317
339
|
type: :runtime
|
|
318
340
|
prerelease: false
|
|
319
341
|
version_requirements: !ruby/object:Gem::Requirement
|
|
320
342
|
requirements:
|
|
321
343
|
- - "~>"
|
|
322
344
|
- !ruby/object:Gem::Version
|
|
323
|
-
version: '0.
|
|
345
|
+
version: '0.0'
|
|
324
346
|
- !ruby/object:Gem::Dependency
|
|
325
|
-
name: yard-
|
|
347
|
+
name: yard-solargraph
|
|
326
348
|
requirement: !ruby/object:Gem::Requirement
|
|
327
349
|
requirements:
|
|
328
350
|
- - "~>"
|
|
329
351
|
- !ruby/object:Gem::Version
|
|
330
|
-
version: '0.
|
|
352
|
+
version: '0.1'
|
|
331
353
|
type: :runtime
|
|
332
354
|
prerelease: false
|
|
333
355
|
version_requirements: !ruby/object:Gem::Requirement
|
|
334
356
|
requirements:
|
|
335
357
|
- - "~>"
|
|
336
358
|
- !ruby/object:Gem::Version
|
|
337
|
-
version: '0.
|
|
359
|
+
version: '0.1'
|
|
338
360
|
- !ruby/object:Gem::Dependency
|
|
339
361
|
name: pry
|
|
340
362
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -391,6 +413,20 @@ dependencies:
|
|
|
391
413
|
- - "~>"
|
|
392
414
|
- !ruby/object:Gem::Version
|
|
393
415
|
version: '3.5'
|
|
416
|
+
- !ruby/object:Gem::Dependency
|
|
417
|
+
name: overcommit
|
|
418
|
+
requirement: !ruby/object:Gem::Requirement
|
|
419
|
+
requirements:
|
|
420
|
+
- - "~>"
|
|
421
|
+
- !ruby/object:Gem::Version
|
|
422
|
+
version: 0.68.0
|
|
423
|
+
type: :development
|
|
424
|
+
prerelease: false
|
|
425
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
426
|
+
requirements:
|
|
427
|
+
- - "~>"
|
|
428
|
+
- !ruby/object:Gem::Version
|
|
429
|
+
version: 0.68.0
|
|
394
430
|
- !ruby/object:Gem::Dependency
|
|
395
431
|
name: rubocop
|
|
396
432
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -489,20 +525,6 @@ dependencies:
|
|
|
489
525
|
- - "~>"
|
|
490
526
|
- !ruby/object:Gem::Version
|
|
491
527
|
version: '0.7'
|
|
492
|
-
- !ruby/object:Gem::Dependency
|
|
493
|
-
name: overcommit
|
|
494
|
-
requirement: !ruby/object:Gem::Requirement
|
|
495
|
-
requirements:
|
|
496
|
-
- - "~>"
|
|
497
|
-
- !ruby/object:Gem::Version
|
|
498
|
-
version: 0.68.0
|
|
499
|
-
type: :development
|
|
500
|
-
prerelease: false
|
|
501
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
502
|
-
requirements:
|
|
503
|
-
- - "~>"
|
|
504
|
-
- !ruby/object:Gem::Version
|
|
505
|
-
version: 0.68.0
|
|
506
528
|
- !ruby/object:Gem::Dependency
|
|
507
529
|
name: webmock
|
|
508
530
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -538,6 +560,7 @@ executables:
|
|
|
538
560
|
extensions: []
|
|
539
561
|
extra_rdoc_files: []
|
|
540
562
|
files:
|
|
563
|
+
- ".envrc"
|
|
541
564
|
- ".gitattributes"
|
|
542
565
|
- ".github/FUNDING.yml"
|
|
543
566
|
- ".github/workflows/linting.yml"
|
|
@@ -566,6 +589,7 @@ files:
|
|
|
566
589
|
- lib/solargraph/api_map/store.rb
|
|
567
590
|
- lib/solargraph/bench.rb
|
|
568
591
|
- lib/solargraph/complex_type.rb
|
|
592
|
+
- lib/solargraph/complex_type/conformance.rb
|
|
569
593
|
- lib/solargraph/complex_type/type_methods.rb
|
|
570
594
|
- lib/solargraph/complex_type/unique_type.rb
|
|
571
595
|
- lib/solargraph/convention.rb
|
|
@@ -688,12 +712,14 @@ files:
|
|
|
688
712
|
- lib/solargraph/parser/parser_gem/node_processors/masgn_node.rb
|
|
689
713
|
- lib/solargraph/parser/parser_gem/node_processors/namespace_node.rb
|
|
690
714
|
- lib/solargraph/parser/parser_gem/node_processors/opasgn_node.rb
|
|
715
|
+
- lib/solargraph/parser/parser_gem/node_processors/or_node.rb
|
|
691
716
|
- lib/solargraph/parser/parser_gem/node_processors/orasgn_node.rb
|
|
692
717
|
- lib/solargraph/parser/parser_gem/node_processors/resbody_node.rb
|
|
693
718
|
- lib/solargraph/parser/parser_gem/node_processors/sclass_node.rb
|
|
694
719
|
- lib/solargraph/parser/parser_gem/node_processors/send_node.rb
|
|
695
720
|
- lib/solargraph/parser/parser_gem/node_processors/sym_node.rb
|
|
696
721
|
- lib/solargraph/parser/parser_gem/node_processors/until_node.rb
|
|
722
|
+
- lib/solargraph/parser/parser_gem/node_processors/when_node.rb
|
|
697
723
|
- lib/solargraph/parser/parser_gem/node_processors/while_node.rb
|
|
698
724
|
- lib/solargraph/parser/region.rb
|
|
699
725
|
- lib/solargraph/parser/snippet.rb
|
|
@@ -706,6 +732,7 @@ files:
|
|
|
706
732
|
- lib/solargraph/pin/class_variable.rb
|
|
707
733
|
- lib/solargraph/pin/closure.rb
|
|
708
734
|
- lib/solargraph/pin/common.rb
|
|
735
|
+
- lib/solargraph/pin/compound_statement.rb
|
|
709
736
|
- lib/solargraph/pin/constant.rb
|
|
710
737
|
- lib/solargraph/pin/conversions.rb
|
|
711
738
|
- lib/solargraph/pin/delegated_method.rb
|
|
@@ -728,6 +755,7 @@ files:
|
|
|
728
755
|
- lib/solargraph/pin/reference/prepend.rb
|
|
729
756
|
- lib/solargraph/pin/reference/require.rb
|
|
730
757
|
- lib/solargraph/pin/reference/superclass.rb
|
|
758
|
+
- lib/solargraph/pin/reference/type_alias.rb
|
|
731
759
|
- lib/solargraph/pin/search.rb
|
|
732
760
|
- lib/solargraph/pin/signature.rb
|
|
733
761
|
- lib/solargraph/pin/singleton.rb
|
|
@@ -742,6 +770,7 @@ files:
|
|
|
742
770
|
- lib/solargraph/rbs_map/core_fills.rb
|
|
743
771
|
- lib/solargraph/rbs_map/core_map.rb
|
|
744
772
|
- lib/solargraph/rbs_map/stdlib_map.rb
|
|
773
|
+
- lib/solargraph/rbs_translator.rb
|
|
745
774
|
- lib/solargraph/server_methods.rb
|
|
746
775
|
- lib/solargraph/shell.rb
|
|
747
776
|
- lib/solargraph/source.rb
|
|
@@ -774,8 +803,6 @@ files:
|
|
|
774
803
|
- lib/solargraph/source_map/data.rb
|
|
775
804
|
- lib/solargraph/source_map/mapper.rb
|
|
776
805
|
- lib/solargraph/type_checker.rb
|
|
777
|
-
- lib/solargraph/type_checker/checks.rb
|
|
778
|
-
- lib/solargraph/type_checker/param_def.rb
|
|
779
806
|
- lib/solargraph/type_checker/problem.rb
|
|
780
807
|
- lib/solargraph/type_checker/rules.rb
|
|
781
808
|
- lib/solargraph/version.rb
|
|
@@ -788,27 +815,36 @@ files:
|
|
|
788
815
|
- lib/solargraph/views/search.erb
|
|
789
816
|
- lib/solargraph/workspace.rb
|
|
790
817
|
- lib/solargraph/workspace/config.rb
|
|
818
|
+
- lib/solargraph/workspace/gemspecs.rb
|
|
791
819
|
- lib/solargraph/workspace/require_paths.rb
|
|
792
820
|
- lib/solargraph/yard_map.rb
|
|
793
821
|
- lib/solargraph/yard_map/cache.rb
|
|
822
|
+
- lib/solargraph/yard_map/directives.rb
|
|
823
|
+
- lib/solargraph/yard_map/directives/attribute_directive.rb
|
|
824
|
+
- lib/solargraph/yard_map/directives/domain_directive.rb
|
|
825
|
+
- lib/solargraph/yard_map/directives/method_directive.rb
|
|
826
|
+
- lib/solargraph/yard_map/directives/override_directive.rb
|
|
827
|
+
- lib/solargraph/yard_map/directives/parse_directive.rb
|
|
828
|
+
- lib/solargraph/yard_map/directives/visibility_directive.rb
|
|
794
829
|
- lib/solargraph/yard_map/helpers.rb
|
|
830
|
+
- lib/solargraph/yard_map/macro.rb
|
|
795
831
|
- lib/solargraph/yard_map/mapper.rb
|
|
796
832
|
- lib/solargraph/yard_map/mapper/to_constant.rb
|
|
797
833
|
- lib/solargraph/yard_map/mapper/to_method.rb
|
|
798
834
|
- lib/solargraph/yard_map/mapper/to_namespace.rb
|
|
799
|
-
- lib/solargraph/yard_map/to_method.rb
|
|
800
835
|
- lib/solargraph/yard_tags.rb
|
|
801
836
|
- lib/solargraph/yardoc.rb
|
|
802
837
|
- rbs/fills/bundler/0/bundler.rbs
|
|
803
838
|
- rbs/fills/open3/0/open3.rbs
|
|
804
839
|
- rbs/fills/rubygems/0/basic_specification.rbs
|
|
840
|
+
- rbs/fills/rubygems/0/dependency.rbs
|
|
805
841
|
- rbs/fills/rubygems/0/errors.rbs
|
|
806
842
|
- rbs/fills/rubygems/0/spec_fetcher.rbs
|
|
807
843
|
- rbs/fills/rubygems/0/specification.rbs
|
|
808
|
-
- rbs/fills/tuple/tuple.rbs
|
|
809
844
|
- rbs/shims/ast/0/node.rbs
|
|
810
845
|
- rbs/shims/ast/2.4/.rbs_meta.yaml
|
|
811
846
|
- rbs/shims/ast/2.4/ast.rbs
|
|
847
|
+
- rbs/shims/diff-lcs/1.5/diff-lcs.rbs
|
|
812
848
|
- rbs/shims/parser/3.2.0.1/builders/default.rbs
|
|
813
849
|
- rbs/shims/parser/3.2.0.1/manifest.yaml
|
|
814
850
|
- rbs/shims/parser/3.2.0.1/parser.rbs
|
|
@@ -834,14 +870,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
834
870
|
requirements:
|
|
835
871
|
- - ">="
|
|
836
872
|
- !ruby/object:Gem::Version
|
|
837
|
-
version: '3.
|
|
873
|
+
version: '3.1'
|
|
838
874
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
839
875
|
requirements:
|
|
840
876
|
- - ">="
|
|
841
877
|
- !ruby/object:Gem::Version
|
|
842
878
|
version: '0'
|
|
843
879
|
requirements: []
|
|
844
|
-
rubygems_version:
|
|
880
|
+
rubygems_version: 4.0.6
|
|
845
881
|
specification_version: 4
|
|
846
882
|
summary: A Ruby language server
|
|
847
883
|
test_files: []
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Solargraph
|
|
4
|
-
class TypeChecker
|
|
5
|
-
# Helper methods for performing type checks
|
|
6
|
-
#
|
|
7
|
-
module Checks
|
|
8
|
-
module_function
|
|
9
|
-
|
|
10
|
-
# Compare an expected type with an inferred type. Common usage is to
|
|
11
|
-
# check if the type declared in a method's @return tag matches the type
|
|
12
|
-
# inferred from static analysis of the code.
|
|
13
|
-
#
|
|
14
|
-
# @param api_map [ApiMap]
|
|
15
|
-
# @param expected [ComplexType]
|
|
16
|
-
# @param inferred [ComplexType]
|
|
17
|
-
# @return [Boolean]
|
|
18
|
-
def types_match? api_map, expected, inferred
|
|
19
|
-
return true if expected.to_s == inferred.to_s
|
|
20
|
-
matches = []
|
|
21
|
-
expected.each do |exp|
|
|
22
|
-
found = false
|
|
23
|
-
inferred.each do |inf|
|
|
24
|
-
# if api_map.super_and_sub?(fuzz(inf), fuzz(exp))
|
|
25
|
-
if either_way?(api_map, inf, exp)
|
|
26
|
-
found = true
|
|
27
|
-
matches.push inf
|
|
28
|
-
break
|
|
29
|
-
end
|
|
30
|
-
end
|
|
31
|
-
return false unless found
|
|
32
|
-
end
|
|
33
|
-
inferred.each do |inf|
|
|
34
|
-
next if matches.include?(inf)
|
|
35
|
-
found = false
|
|
36
|
-
expected.each do |exp|
|
|
37
|
-
# if api_map.super_and_sub?(fuzz(inf), fuzz(exp))
|
|
38
|
-
if either_way?(api_map, inf, exp)
|
|
39
|
-
found = true
|
|
40
|
-
break
|
|
41
|
-
end
|
|
42
|
-
end
|
|
43
|
-
return false unless found
|
|
44
|
-
end
|
|
45
|
-
true
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
# @param api_map [ApiMap]
|
|
49
|
-
# @param expected [ComplexType]
|
|
50
|
-
# @param inferred [ComplexType]
|
|
51
|
-
# @return [Boolean]
|
|
52
|
-
def any_types_match? api_map, expected, inferred
|
|
53
|
-
expected = expected.downcast_to_literal_if_possible
|
|
54
|
-
inferred = inferred.downcast_to_literal_if_possible
|
|
55
|
-
return duck_types_match?(api_map, expected, inferred) if expected.duck_type?
|
|
56
|
-
# walk through the union expected type and see if any members
|
|
57
|
-
# of the union match the inferred type
|
|
58
|
-
expected.each do |exp|
|
|
59
|
-
next if exp.duck_type?
|
|
60
|
-
# @todo: there should be a level of typechecking where all
|
|
61
|
-
# unique types in the inferred must match one of the
|
|
62
|
-
# expected unique types
|
|
63
|
-
inferred.each do |inf|
|
|
64
|
-
# return true if exp == inf || api_map.super_and_sub?(fuzz(inf), fuzz(exp))
|
|
65
|
-
return true if exp == inf || either_way?(api_map, inf, exp)
|
|
66
|
-
end
|
|
67
|
-
end
|
|
68
|
-
false
|
|
69
|
-
end
|
|
70
|
-
|
|
71
|
-
# @param api_map [ApiMap]
|
|
72
|
-
# @param inferred [ComplexType]
|
|
73
|
-
# @param expected [ComplexType]
|
|
74
|
-
# @return [Boolean]
|
|
75
|
-
def all_types_match? api_map, inferred, expected
|
|
76
|
-
expected = expected.downcast_to_literal_if_possible
|
|
77
|
-
inferred = inferred.downcast_to_literal_if_possible
|
|
78
|
-
return duck_types_match?(api_map, expected, inferred) if expected.duck_type?
|
|
79
|
-
inferred.each do |inf|
|
|
80
|
-
next if inf.duck_type?
|
|
81
|
-
return false unless expected.any? { |exp| exp == inf || either_way?(api_map, inf, exp) }
|
|
82
|
-
end
|
|
83
|
-
true
|
|
84
|
-
end
|
|
85
|
-
|
|
86
|
-
# @param api_map [ApiMap]
|
|
87
|
-
# @param expected [ComplexType]
|
|
88
|
-
# @param inferred [ComplexType]
|
|
89
|
-
# @return [Boolean]
|
|
90
|
-
def duck_types_match? api_map, expected, inferred
|
|
91
|
-
raise ArgumentError, 'Expected type must be duck type' unless expected.duck_type?
|
|
92
|
-
expected.each do |exp|
|
|
93
|
-
next unless exp.duck_type?
|
|
94
|
-
quack = exp.to_s[1..-1]
|
|
95
|
-
return false if api_map.get_method_stack(inferred.namespace, quack, scope: inferred.scope).empty?
|
|
96
|
-
end
|
|
97
|
-
true
|
|
98
|
-
end
|
|
99
|
-
|
|
100
|
-
# @param type [ComplexType::UniqueType]
|
|
101
|
-
# @return [String]
|
|
102
|
-
def fuzz type
|
|
103
|
-
if type.parameters?
|
|
104
|
-
type.name
|
|
105
|
-
else
|
|
106
|
-
type.tag
|
|
107
|
-
end
|
|
108
|
-
end
|
|
109
|
-
|
|
110
|
-
# @param api_map [ApiMap]
|
|
111
|
-
# @param cls1 [ComplexType::UniqueType]
|
|
112
|
-
# @param cls2 [ComplexType::UniqueType]
|
|
113
|
-
# @return [Boolean]
|
|
114
|
-
def either_way?(api_map, cls1, cls2)
|
|
115
|
-
# @todo there should be a level of typechecking which uses the
|
|
116
|
-
# full tag with parameters to determine compatibility
|
|
117
|
-
f1 = cls1.name
|
|
118
|
-
f2 = cls2.name
|
|
119
|
-
api_map.type_include?(f1, f2) || api_map.super_and_sub?(f1, f2) || api_map.super_and_sub?(f2, f1)
|
|
120
|
-
# api_map.type_include?(f1, f2) || api_map.super_and_sub?(f1, f2) || api_map.super_and_sub?(f2, f1)
|
|
121
|
-
end
|
|
122
|
-
end
|
|
123
|
-
end
|
|
124
|
-
end
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Solargraph
|
|
4
|
-
class TypeChecker
|
|
5
|
-
# Data about a method parameter definition. This is the information from
|
|
6
|
-
# the args list in the def call, not the `@param` tags.
|
|
7
|
-
#
|
|
8
|
-
class ParamDef
|
|
9
|
-
# @return [String]
|
|
10
|
-
attr_reader :name
|
|
11
|
-
|
|
12
|
-
# @return [Symbol]
|
|
13
|
-
attr_reader :type
|
|
14
|
-
|
|
15
|
-
# @param name [String]
|
|
16
|
-
# @param type [Symbol] The type of parameter, such as :req, :opt, :rest, etc.
|
|
17
|
-
def initialize name, type
|
|
18
|
-
@name = name
|
|
19
|
-
@type = type
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
class << self
|
|
23
|
-
# Get an array of ParamDefs from a method pin.
|
|
24
|
-
#
|
|
25
|
-
# @param pin [Solargraph::Pin::Method]
|
|
26
|
-
# @return [Array<ParamDef>]
|
|
27
|
-
def from pin
|
|
28
|
-
result = []
|
|
29
|
-
pin.parameters.each do |par|
|
|
30
|
-
result.push ParamDef.new(par.name, par.decl)
|
|
31
|
-
end
|
|
32
|
-
result
|
|
33
|
-
end
|
|
34
|
-
end
|
|
35
|
-
end
|
|
36
|
-
end
|
|
37
|
-
end
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Solargraph
|
|
4
|
-
class YardMap
|
|
5
|
-
class ToMethod
|
|
6
|
-
module InnerMethods
|
|
7
|
-
module_function
|
|
8
|
-
|
|
9
|
-
# @param code_object [YARD::CodeObjects::Base]
|
|
10
|
-
# @param location [Solargraph::Location]
|
|
11
|
-
# @param comments [String]
|
|
12
|
-
# @return [Array<Solargraph::Pin::Parameter>]
|
|
13
|
-
def get_parameters code_object, location, comments
|
|
14
|
-
return [] unless code_object.is_a?(YARD::CodeObjects::MethodObject)
|
|
15
|
-
# HACK: Skip `nil` and `self` parameters that are sometimes emitted
|
|
16
|
-
# for methods defined in C
|
|
17
|
-
# See https://github.com/castwide/solargraph/issues/345
|
|
18
|
-
# @sg-ignore https://github.com/castwide/solargraph/pull/1114
|
|
19
|
-
code_object.parameters.select { |a| a[0] && a[0] != 'self' }.map do |a|
|
|
20
|
-
Solargraph::Pin::Parameter.new(
|
|
21
|
-
location: location,
|
|
22
|
-
closure: self,
|
|
23
|
-
comments: comments,
|
|
24
|
-
name: arg_name(a),
|
|
25
|
-
presence: nil,
|
|
26
|
-
decl: arg_type(a),
|
|
27
|
-
asgn_code: a[1],
|
|
28
|
-
source: :yard_map
|
|
29
|
-
)
|
|
30
|
-
end
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
# @param a [Array<String>]
|
|
34
|
-
# @return [String]
|
|
35
|
-
def arg_name a
|
|
36
|
-
a[0].gsub(/[^a-z0-9_]/i, '')
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
# @param a [Array]
|
|
40
|
-
# @return [::Symbol]
|
|
41
|
-
def arg_type a
|
|
42
|
-
if a[0].start_with?('**')
|
|
43
|
-
:kwrestarg
|
|
44
|
-
elsif a[0].start_with?('*')
|
|
45
|
-
:restarg
|
|
46
|
-
elsif a[0].start_with?('&')
|
|
47
|
-
:blockarg
|
|
48
|
-
elsif a[0].end_with?(':')
|
|
49
|
-
a[1] ? :kwoptarg : :kwarg
|
|
50
|
-
elsif a[1]
|
|
51
|
-
:optarg
|
|
52
|
-
else
|
|
53
|
-
:arg
|
|
54
|
-
end
|
|
55
|
-
end
|
|
56
|
-
end
|
|
57
|
-
private_constant :InnerMethods
|
|
58
|
-
|
|
59
|
-
include Helpers
|
|
60
|
-
|
|
61
|
-
# @param code_object [YARD::CodeObjects::MethodObject]
|
|
62
|
-
# @param name [String, nil]
|
|
63
|
-
# @param scope [Symbol, nil]
|
|
64
|
-
# @param visibility [Symbol, nil]
|
|
65
|
-
# @param closure [Solargraph::Pin::Base, nil]
|
|
66
|
-
# @param spec [Solargraph::Pin::Base, nil]
|
|
67
|
-
# @return [Solargraph::Pin::Method]
|
|
68
|
-
def make code_object, name = nil, scope = nil, visibility = nil, closure = nil, spec = nil
|
|
69
|
-
closure ||= Solargraph::Pin::Namespace.new(
|
|
70
|
-
name: code_object.namespace.to_s,
|
|
71
|
-
gates: [code_object.namespace.to_s]
|
|
72
|
-
)
|
|
73
|
-
location = object_location(code_object, spec)
|
|
74
|
-
comments = code_object.docstring ? code_object.docstring.all.to_s : ''
|
|
75
|
-
Pin::Method.new(
|
|
76
|
-
location: location,
|
|
77
|
-
closure: closure,
|
|
78
|
-
name: name || code_object.name.to_s,
|
|
79
|
-
comments: comments,
|
|
80
|
-
scope: scope || code_object.scope,
|
|
81
|
-
visibility: visibility || code_object.visibility,
|
|
82
|
-
parameters: InnerMethods.get_parameters(code_object, location, comments),
|
|
83
|
-
explicit: code_object.is_explicit?,
|
|
84
|
-
source: :yard_map
|
|
85
|
-
)
|
|
86
|
-
end
|
|
87
|
-
end
|
|
88
|
-
end
|
|
89
|
-
end
|