Module: Steep
- Defined in:
- lib/steep.rb,
lib/steep/cli.rb,
lib/steep/names.rb,
lib/steep/errors.rb,
lib/steep/source.rb,
lib/steep/typing.rb,
lib/steep/project.rb,
lib/steep/version.rb,
lib/steep/ast/types.rb,
lib/steep/ast/buffer.rb,
lib/steep/ast/builtin.rb,
lib/steep/project/dsl.rb,
lib/steep/ast/location.rb,
lib/steep/drivers/init.rb,
lib/steep/project/file.rb,
lib/steep/ast/namespace.rb,
lib/steep/ast/types/any.rb,
lib/steep/ast/types/bot.rb,
lib/steep/ast/types/nil.rb,
lib/steep/ast/types/top.rb,
lib/steep/ast/types/var.rb,
lib/steep/drivers/check.rb,
lib/steep/drivers/watch.rb,
lib/steep/ast/annotation.rb,
lib/steep/ast/types/name.rb,
lib/steep/ast/types/proc.rb,
lib/steep/ast/types/self.rb,
lib/steep/ast/types/void.rb,
lib/steep/drivers/vendor.rb,
lib/steep/project/target.rb,
lib/steep/ast/method_type.rb,
lib/steep/ast/type_params.rb,
lib/steep/ast/types/class.rb,
lib/steep/ast/types/tuple.rb,
lib/steep/ast/types/union.rb,
lib/steep/project/options.rb,
lib/steep/subtyping/check.rb,
lib/steep/subtyping/trace.rb,
lib/steep/ast/types/helper.rb,
lib/steep/ast/types/record.rb,
lib/steep/drivers/validate.rb,
lib/steep/interface/method.rb,
lib/steep/signature/errors.rb,
lib/steep/subtyping/result.rb,
lib/steep/annotation_parser.rb,
lib/steep/ast/types/boolean.rb,
lib/steep/ast/types/factory.rb,
lib/steep/ast/types/literal.rb,
lib/steep/type_construction.rb,
lib/steep/ast/types/instance.rb,
lib/steep/drivers/langserver.rb,
lib/steep/subtyping/relation.rb,
lib/steep/type_assignability.rb,
lib/steep/drivers/annotations.rb,
lib/steep/interface/interface.rb,
lib/steep/project/file_loader.rb,
lib/steep/signature/validator.rb,
lib/steep/drivers/print_project.rb,
lib/steep/drivers/trace_printer.rb,
lib/steep/interface/method_type.rb,
lib/steep/project/hover_content.rb,
lib/steep/subtyping/constraints.rb,
lib/steep/ast/types/intersection.rb,
lib/steep/interface/substitution.rb,
lib/steep/type_inference/context.rb,
lib/steep/type_inference/type_env.rb,
lib/steep/type_inference/send_args.rb,
lib/steep/ast/annotation/collection.rb,
lib/steep/drivers/utils/driver_helper.rb,
lib/steep/project/completion_provider.rb,
lib/steep/subtyping/variable_variance.rb,
lib/steep/type_inference/block_params.rb,
lib/steep/type_inference/constant_env.rb,
lib/steep/subtyping/variable_occurrence.rb,
lib/steep/drivers/signature_error_printer.rb
Defined Under Namespace
Modules: AST, Drivers, Errors, Interface, Names, Signature, Subtyping, TypeInference
Classes: AnnotationParser, CLI, Project, Source, TypeAssignability, TypeConstruction, Typing
Constant Summary
collapse
- VERSION =
"0.14.0"
Class Method Summary
collapse
Class Method Details
.log_error(exn, message: "Unexpected error: #{exn.inspect}") ⇒ Object
127
128
129
130
131
132
|
# File 'lib/steep.rb', line 127
def self.log_error(exn, message: "Unexpected error: #{exn.inspect}")
Steep.logger.error message
exn.backtrace.each do |loc|
Steep.logger.warn " #{loc}"
end
end
|
.log_output ⇒ Object
106
107
108
|
# File 'lib/steep.rb', line 106
def self.log_output
@log_output
end
|
.log_output=(output) ⇒ Object
110
111
112
113
114
|
# File 'lib/steep.rb', line 110
def self.log_output=(output)
@log_output = output
prev_level = @logger&.level
@logger = new_logger(output, prev_level)
end
|
.logger ⇒ Object
95
96
97
|
# File 'lib/steep.rb', line 95
def self.logger
@logger
end
|
.measure(message) ⇒ Object
119
120
121
122
123
124
125
|
# File 'lib/steep.rb', line 119
def self.measure(message)
start = Time.now
yield.tap do
time = Time.now - start
self.logger.info "#{message} took #{time} seconds"
end
end
|
.new_logger(output, prev_level) ⇒ Object
99
100
101
102
103
104
|
# File 'lib/steep.rb', line 99
def self.new_logger(output, prev_level)
ActiveSupport::TaggedLogging.new(Logger.new(output)).tap do |logger|
logger.push_tags "Steep #{VERSION}"
logger.level = prev_level || Logger::WARN
end
end
|