Skip to content

Commit

Permalink
Merge pull request #878 from soutaro/update-steep
Browse files Browse the repository at this point in the history
Update steep
  • Loading branch information
soutaro committed Jul 20, 2023
2 parents d932897 + 31a4b3b commit 78dd2b6
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 64 deletions.
20 changes: 11 additions & 9 deletions Gemfile.steep.lock
Original file line number Diff line number Diff line change
@@ -1,36 +1,38 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (7.0.5)
activesupport (7.0.6)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
ast (2.4.2)
concurrent-ruby (1.2.2)
csv (3.2.6)
csv (3.2.7)
ffi (1.15.5)
fileutils (1.7.1)
i18n (1.13.0)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
json (2.6.3)
language_server-protocol (3.17.0.3)
listen (3.8.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
logger (1.5.3)
minitest (5.18.0)
parser (3.2.2.1)
minitest (5.18.1)
parser (3.2.2.3)
ast (~> 2.4.1)
racc
racc (1.7.1)
rainbow (3.1.1)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
rbs (3.1.0)
rbs (3.1.1)
securerandom (0.2.2)
steep (1.4.0)
steep (1.5.0)
activesupport (>= 5.1)
concurrent-ruby (>= 1.2.2)
concurrent-ruby (>= 1.1.10)
csv (>= 3.0.9)
fileutils (>= 1.1.0)
json (>= 2.1.0)
Expand All @@ -39,7 +41,7 @@ GEM
logger (>= 1.3.0)
parser (>= 3.1)
rainbow (>= 2.2.2, < 4.0)
rbs (>= 2.8.0)
rbs (>= 3.1.0)
securerandom (>= 0.1)
strscan (>= 1.0.0)
terminal-table (>= 2, < 4)
Expand Down
5 changes: 2 additions & 3 deletions Steepfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ D = Steep::Diagnostic
target :app do
check "lib"
ignore "lib/steep/shims"

signature "sig"

collection_config "rbs_collection.steep.yaml"

configure_code_diagnostics do |hash| # You can setup everything yourself
hash[D::Ruby::MethodDefinitionMissing] = :hint
configure_code_diagnostics(D::Ruby.strict) do |hash|
end

FileUtils.mkpath("tmp")
Expand Down
12 changes: 6 additions & 6 deletions lib/steep/ast/annotation/collection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,20 +110,20 @@ def break_type
end

def lvar_types
var_type_annotations.each_key.with_object({}) do |name, hash|
hash[name] = var_type(lvar: name)
var_type_annotations.each_key.with_object({}) do |name, hash| #$ Hash[Symbol, Types::t]
hash[name] = var_type(lvar: name) || raise
end
end

def ivar_types
ivar_type_annotations.each_key.with_object({}) do |name, hash|
hash[name] = var_type(ivar: name)
ivar_type_annotations.each_key.with_object({}) do |name, hash| #$ Hash[Symbol, Types::t]
hash[name] = var_type(ivar: name) || raise
end
end

def const_types
const_type_annotations.each_key.with_object({}) do |name, hash|
hash[name] = var_type(const: name)
const_type_annotations.each_key.with_object({}) do |name, hash| #$ Hash[RBS::TypeName, Types::t]
hash[name] = var_type(const: name) || raise
end
end

Expand Down
13 changes: 0 additions & 13 deletions lib/steep/ast/type_params.rb

This file was deleted.

47 changes: 25 additions & 22 deletions sig/steep/ast/annotation/collection.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Steep
module AST
module Annotation
class Collection
attr_reader annotations: untyped
attr_reader annotations: Array[Annotation::t]

attr_reader factory: Types::Factory

Expand All @@ -14,31 +14,34 @@ module Steep

attr_reader ivar_type_annotations: Hash[Symbol, IvarType]

attr_reader method_type_annotations: untyped
attr_reader method_type_annotations: Hash[Symbol, MethodType?]

attr_reader block_type_annotation: untyped
attr_reader block_type_annotation: BlockType?

attr_reader return_type_annotation: untyped
attr_reader return_type_annotation: ReturnType?

attr_reader self_type_annotation: untyped
attr_reader self_type_annotation: SelfType?

attr_reader instance_type_annotation: untyped
attr_reader instance_type_annotation: InstanceType?

attr_reader module_type_annotation: untyped
attr_reader module_type_annotation: ModuleType?

attr_reader implement_module_annotation: Implements?

attr_reader dynamic_annotations: untyped
attr_reader dynamic_annotations: Array[Dynamic]

attr_reader break_type_annotation: untyped
attr_reader break_type_annotation: BreakType?

def initialize: (annotations: untyped, factory: untyped, context: untyped) -> void
def initialize: (annotations: Array[Annotation::t], factory: Types::Factory, context: RBS::Resolver::context) -> void

def absolute_type: (untyped `type`) -> (untyped | nil)
def absolute_type: (Types::t) -> Types::t
| (Types::t?) -> Types::t?

def var_type: (?lvar: untyped?, ?ivar: untyped?, ?const: untyped?) -> untyped
def var_type: (lvar: Symbol) -> Types::t?
| (ivar: Symbol) -> Types::t?
| (const: RBS::TypeName) -> Types::t?

def method_type: (untyped name) -> (untyped | nil)
def method_type: (Symbol name) -> Interface::MethodType?

%a{pure} def block_type: () -> Types::t?

Expand All @@ -52,23 +55,23 @@ module Steep

%a{pure} def break_type: () -> Types::t?

def lvar_types: () -> untyped
def lvar_types: () -> Hash[Symbol, Types::t]

def ivar_types: () -> untyped
def ivar_types: () -> Hash[Symbol, Types::t]

def const_types: () -> untyped
def const_types: () -> Hash[RBS::TypeName, Types::t]

def instance_dynamics: () -> untyped
def instance_dynamics: () -> Array[Symbol]

def module_dynamics: () -> untyped
def module_dynamics: () -> Array[Symbol]

def merge_block_annotations: (untyped annotations) -> untyped
def merge_block_annotations: (Collection annotations) -> Collection

def any?: () { () -> untyped } -> untyped
def any?: () { (Annotation::t) -> boolish } -> bool

def size: () -> untyped
def size: () -> Integer

def include?: (untyped obj) -> untyped
def include?: (Annotation::t obj) -> bool
end
end
end
Expand Down
11 changes: 0 additions & 11 deletions sig/steep/ast/type_params.rbs

This file was deleted.

0 comments on commit 78dd2b6

Please sign in to comment.