steep 0.29.0 → 0.33.0
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/CHANGELOG.md +25 -0
- data/bin/steep-prof +1 -2
- data/lib/steep.rb +2 -3
- data/lib/steep/ast/types/factory.rb +43 -28
- data/lib/steep/project.rb +25 -0
- data/lib/steep/project/completion_provider.rb +9 -7
- data/lib/steep/project/file_loader.rb +7 -2
- data/lib/steep/project/hover_content.rb +91 -80
- data/lib/steep/project/signature_file.rb +33 -0
- data/lib/steep/project/{file.rb → source_file.rb} +21 -51
- data/lib/steep/project/target.rb +31 -12
- data/lib/steep/server/code_worker.rb +30 -46
- data/lib/steep/server/interaction_worker.rb +42 -38
- data/lib/steep/server/master.rb +13 -30
- data/lib/steep/server/utils.rb +46 -13
- data/lib/steep/server/worker_process.rb +4 -2
- data/lib/steep/source.rb +60 -3
- data/lib/steep/type_inference/context_array.rb +1 -1
- data/lib/steep/type_inference/logic_type_interpreter.rb +6 -0
- data/lib/steep/version.rb +1 -1
- data/smoke/regression/fun.rb +8 -0
- data/smoke/regression/fun.rbs +4 -0
- data/smoke/toplevel/Steepfile +5 -0
- data/smoke/toplevel/a.rb +4 -0
- data/smoke/toplevel/a.rbs +3 -0
- data/steep.gemspec +1 -1
- metadata +11 -7
- data/lib/steep/ast/buffer.rb +0 -51
- data/lib/steep/ast/location.rb +0 -86
data/lib/steep/ast/location.rb
DELETED
@@ -1,86 +0,0 @@
|
|
1
|
-
module Steep
|
2
|
-
module AST
|
3
|
-
class Location
|
4
|
-
attr_reader :buffer
|
5
|
-
attr_reader :start_pos
|
6
|
-
attr_reader :end_pos
|
7
|
-
|
8
|
-
def initialize(buffer:, start_pos:, end_pos:)
|
9
|
-
@buffer = buffer
|
10
|
-
@start_pos = start_pos
|
11
|
-
@end_pos = end_pos
|
12
|
-
end
|
13
|
-
|
14
|
-
def inspect
|
15
|
-
"#<#{self.class}:#{self.__id__} @buffer=#{buffer.name}, @start_pos=#{start_pos}, @end_pos=#{end_pos}, source='#{source.lines.first}', start_line=#{start_line}, start_column=#{start_column}>"
|
16
|
-
end
|
17
|
-
|
18
|
-
def name
|
19
|
-
buffer.name
|
20
|
-
end
|
21
|
-
|
22
|
-
def start_line
|
23
|
-
start_loc[0]
|
24
|
-
end
|
25
|
-
|
26
|
-
def start_column
|
27
|
-
start_loc[1]
|
28
|
-
end
|
29
|
-
|
30
|
-
def end_line
|
31
|
-
end_loc[0]
|
32
|
-
end
|
33
|
-
|
34
|
-
def end_column
|
35
|
-
end_loc[1]
|
36
|
-
end
|
37
|
-
|
38
|
-
def start_loc
|
39
|
-
@start_loc ||= buffer.pos_to_loc(start_pos)
|
40
|
-
end
|
41
|
-
|
42
|
-
def end_loc
|
43
|
-
@end_loc ||= buffer.pos_to_loc(end_pos)
|
44
|
-
end
|
45
|
-
|
46
|
-
def source
|
47
|
-
@source ||= buffer.source(start_pos...end_pos)
|
48
|
-
end
|
49
|
-
|
50
|
-
def to_s
|
51
|
-
"#{start_line}:#{start_column}...#{end_line}:#{end_column}"
|
52
|
-
end
|
53
|
-
|
54
|
-
def ==(other)
|
55
|
-
other.is_a?(Location) &&
|
56
|
-
other.buffer == buffer &&
|
57
|
-
other.start_pos == start_pos &&
|
58
|
-
other.end_pos == end_pos
|
59
|
-
end
|
60
|
-
|
61
|
-
def +(other)
|
62
|
-
if other
|
63
|
-
raise "Invalid concat: buffer=#{buffer.name}, other.buffer=#{other.buffer.name}" unless other.buffer == buffer
|
64
|
-
|
65
|
-
self.class.new(buffer: buffer,
|
66
|
-
start_pos: start_pos,
|
67
|
-
end_pos: other.end_pos)
|
68
|
-
else
|
69
|
-
self
|
70
|
-
end
|
71
|
-
end
|
72
|
-
|
73
|
-
def self.concat(*locations)
|
74
|
-
locations.inject {|l1, l2|
|
75
|
-
l1 + l2
|
76
|
-
}
|
77
|
-
end
|
78
|
-
|
79
|
-
def pred?(loc)
|
80
|
-
loc.is_a?(Location) &&
|
81
|
-
loc.name == name &&
|
82
|
-
loc.start_pos == end_pos
|
83
|
-
end
|
84
|
-
end
|
85
|
-
end
|
86
|
-
end
|