steep 1.8.3 → 1.9.0.dev.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +0 -22
- data/Steepfile +35 -26
- data/bin/rbs-inline +19 -0
- data/lib/steep/cli.rb +38 -5
- data/lib/steep/diagnostic/ruby.rb +11 -58
- data/lib/steep/drivers/annotations.rb +1 -1
- data/lib/steep/drivers/check.rb +103 -1
- data/lib/steep/drivers/checkfile.rb +10 -8
- data/lib/steep/drivers/print_project.rb +83 -40
- data/lib/steep/drivers/utils/driver_helper.rb +39 -6
- data/lib/steep/drivers/watch.rb +24 -2
- data/lib/steep/index/signature_symbol_provider.rb +8 -8
- data/lib/steep/interface/builder.rb +14 -1
- data/lib/steep/interface/function.rb +2 -2
- data/lib/steep/path_helper.rb +4 -2
- data/lib/steep/project/dsl.rb +176 -151
- data/lib/steep/project/group.rb +31 -0
- data/lib/steep/project/pattern.rb +4 -0
- data/lib/steep/project/target.rb +32 -6
- data/lib/steep/project.rb +38 -10
- data/lib/steep/server/custom_methods.rb +16 -0
- data/lib/steep/server/delay_queue.rb +0 -3
- data/lib/steep/server/interaction_worker.rb +2 -11
- data/lib/steep/server/master.rb +129 -279
- data/lib/steep/server/target_group_files.rb +205 -0
- data/lib/steep/server/type_check_controller.rb +366 -0
- data/lib/steep/server/type_check_worker.rb +60 -86
- data/lib/steep/services/file_loader.rb +23 -0
- data/lib/steep/services/goto_service.rb +40 -31
- data/lib/steep/services/hover_provider/singleton_methods.rb +4 -4
- data/lib/steep/services/path_assignment.rb +23 -4
- data/lib/steep/services/type_check_service.rb +76 -159
- data/lib/steep/signature/validator.rb +4 -4
- data/lib/steep/subtyping/check.rb +2 -2
- data/lib/steep/thread_waiter.rb +24 -16
- data/lib/steep/type_construction.rb +12 -3
- data/lib/steep/type_inference/block_params.rb +1 -2
- data/lib/steep/type_inference/context.rb +1 -1
- data/lib/steep/type_inference/type_env.rb +4 -4
- data/lib/steep/type_inference/type_env_builder.rb +1 -1
- data/lib/steep/version.rb +1 -1
- data/lib/steep.rb +6 -4
- data/sample/Steepfile +6 -0
- data/sample/lib/conference.rb +1 -5
- data/steep.gemspec +7 -1
- metadata +9 -6
- data/lib/steep/drivers/validate.rb +0 -65
data/lib/steep/project/dsl.rb
CHANGED
@@ -1,137 +1,154 @@
|
|
1
1
|
module Steep
|
2
2
|
class Project
|
3
3
|
class DSL
|
4
|
-
|
5
|
-
attr_reader :name
|
6
|
-
attr_reader :sources
|
7
|
-
attr_reader :libraries
|
8
|
-
attr_reader :signatures
|
9
|
-
attr_reader :ignored_sources
|
4
|
+
module LibraryOptions
|
10
5
|
attr_reader :stdlib_root
|
11
6
|
attr_reader :core_root
|
12
|
-
attr_reader :repo_paths
|
13
|
-
attr_reader :code_diagnostics_config
|
14
|
-
attr_reader :project
|
15
7
|
attr_reader :collection_config_path
|
16
8
|
|
17
|
-
def
|
18
|
-
@
|
19
|
-
@
|
20
|
-
@libraries = libraries
|
21
|
-
@signatures = signatures
|
22
|
-
@ignored_sources = ignored_sources
|
23
|
-
@core_root = nil
|
24
|
-
@stdlib_root = nil
|
25
|
-
@repo_paths = []
|
26
|
-
@code_diagnostics_config = code_diagnostics_config
|
27
|
-
@project = project
|
28
|
-
@collection_config_path = collection_config_path
|
9
|
+
def stdlib_path(core_root:, stdlib_root:)
|
10
|
+
@core_root = Pathname(core_root)
|
11
|
+
@stdlib_root = Pathname(stdlib_root)
|
29
12
|
end
|
30
13
|
|
31
|
-
def
|
32
|
-
@
|
33
|
-
|
34
|
-
@libraries = other.libraries.dup
|
35
|
-
@signatures = other.signatures.dup
|
36
|
-
@ignored_sources = other.ignored_sources.dup
|
37
|
-
@repo_paths = other.repo_paths.dup
|
38
|
-
@core_root = other.core_root
|
39
|
-
@stdlib_root = other.stdlib_root
|
40
|
-
@code_diagnostics_config = other.code_diagnostics_config.dup
|
41
|
-
@project = other.project
|
42
|
-
@collection_config_path = other.collection_config_path
|
14
|
+
def repo_path(*paths)
|
15
|
+
@library_configured = true
|
16
|
+
repo_paths.push(*paths.map {|s| Pathname(s) })
|
43
17
|
end
|
44
18
|
|
45
|
-
def
|
46
|
-
|
19
|
+
def collection_config(path)
|
20
|
+
@library_configured = true
|
21
|
+
@collection_config_path = project.absolute_path(path)
|
47
22
|
end
|
48
23
|
|
49
|
-
def
|
50
|
-
|
24
|
+
def disable_collection
|
25
|
+
@library_configured = true
|
26
|
+
@collection_config_path = false
|
51
27
|
end
|
52
28
|
|
53
29
|
def library(*args)
|
30
|
+
@library_configured = true
|
54
31
|
libraries.push(*args)
|
55
32
|
end
|
56
33
|
|
57
|
-
def
|
58
|
-
|
34
|
+
def repo_paths
|
35
|
+
@repo_paths ||= []
|
36
|
+
end
|
59
37
|
|
60
|
-
|
38
|
+
def libraries
|
39
|
+
@libraries ||= []
|
40
|
+
end
|
61
41
|
|
62
|
-
|
42
|
+
def library_configured?
|
43
|
+
@library_configured
|
44
|
+
end
|
63
45
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
46
|
+
def to_library_options
|
47
|
+
config_path =
|
48
|
+
case collection_config_path
|
49
|
+
when Pathname
|
50
|
+
collection_config_path
|
51
|
+
when nil
|
52
|
+
default = project.absolute_path(RBS::Collection::Config::PATH)
|
53
|
+
if default.file?
|
54
|
+
default
|
55
|
+
end
|
56
|
+
when false
|
57
|
+
nil
|
58
|
+
end
|
72
59
|
|
73
|
-
|
74
|
-
|
60
|
+
Options.new.tap do |options|
|
61
|
+
options.libraries.push(*libraries)
|
62
|
+
options.paths = Options::PathOptions.new(
|
63
|
+
core_root: core_root,
|
64
|
+
stdlib_root: stdlib_root,
|
65
|
+
repo_paths: repo_paths
|
66
|
+
)
|
67
|
+
options.collection_config_path = config_path
|
75
68
|
end
|
69
|
+
end
|
70
|
+
end
|
76
71
|
|
77
|
-
|
72
|
+
module WithPattern
|
73
|
+
def check(*args)
|
74
|
+
sources.concat(args)
|
75
|
+
end
|
78
76
|
|
79
|
-
|
80
|
-
|
81
|
-
|
77
|
+
def ignore(*args)
|
78
|
+
ignored_sources.concat(args)
|
79
|
+
end
|
82
80
|
|
83
|
-
|
84
|
-
|
85
|
-
|
81
|
+
def signature(*args)
|
82
|
+
signatures.concat(args)
|
83
|
+
end
|
86
84
|
|
87
|
-
|
88
|
-
|
89
|
-
|
85
|
+
def ignore_signature(*args)
|
86
|
+
ignored_signatures.concat(args)
|
87
|
+
end
|
90
88
|
|
91
|
-
|
92
|
-
|
93
|
-
|
89
|
+
def sources
|
90
|
+
@sources ||= []
|
91
|
+
end
|
94
92
|
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
Steep.logger.error " #{c}"
|
99
|
-
end
|
100
|
-
Steep.logger.error " end"
|
101
|
-
end
|
93
|
+
def ignored_sources
|
94
|
+
@ignored_sources ||= []
|
95
|
+
end
|
102
96
|
|
97
|
+
def signatures
|
98
|
+
@signatures ||= []
|
103
99
|
end
|
104
100
|
|
105
|
-
def
|
106
|
-
|
101
|
+
def ignored_signatures
|
102
|
+
@ignored_signatures ||= []
|
107
103
|
end
|
108
104
|
|
109
|
-
def
|
110
|
-
|
111
|
-
name,
|
112
|
-
sources: sources,
|
113
|
-
libraries: libraries,
|
114
|
-
signatures: signatures,
|
115
|
-
ignored_sources: ignored_sources,
|
116
|
-
project: project,
|
117
|
-
)
|
105
|
+
def source_pattern
|
106
|
+
Pattern.new(patterns: sources, ignores: ignored_sources, ext: ".rb")
|
118
107
|
end
|
119
108
|
|
120
|
-
def
|
121
|
-
|
109
|
+
def signature_pattern
|
110
|
+
Pattern.new(patterns: signatures, ignores: ignored_signatures, ext: ".rbs")
|
122
111
|
end
|
112
|
+
end
|
113
|
+
|
114
|
+
class TargetDSL
|
115
|
+
include LibraryOptions
|
116
|
+
include WithPattern
|
117
|
+
|
118
|
+
attr_reader :name
|
119
|
+
attr_reader :project
|
120
|
+
attr_reader :unreferenced
|
121
|
+
attr_reader :groups
|
123
122
|
|
124
|
-
def
|
125
|
-
|
123
|
+
def initialize(name, project:)
|
124
|
+
@name = name
|
125
|
+
@core_root = nil
|
126
|
+
@stdlib_root = nil
|
127
|
+
@project = project
|
128
|
+
@collection_config_path = collection_config_path
|
129
|
+
@unreferenced = false
|
130
|
+
@groups = []
|
126
131
|
end
|
127
132
|
|
128
|
-
def
|
129
|
-
@
|
130
|
-
@
|
133
|
+
def initialize_copy(other)
|
134
|
+
@name = other.name
|
135
|
+
@libraries = other.libraries.dup
|
136
|
+
@sources = other.sources.dup
|
137
|
+
@signatures = other.signatures.dup
|
138
|
+
@ignored_sources = other.ignored_sources.dup
|
139
|
+
@ignored_signatures = other.ignored_signatures.dup
|
140
|
+
@repo_paths = other.repo_paths.dup
|
141
|
+
@core_root = other.core_root
|
142
|
+
@stdlib_root = other.stdlib_root
|
143
|
+
@code_diagnostics_config = other.code_diagnostics_config.dup
|
144
|
+
@project = other.project
|
145
|
+
@collection_config_path = other.collection_config_path
|
146
|
+
@unreferenced = other.unreferenced
|
147
|
+
@groups = other.groups.dup
|
131
148
|
end
|
132
149
|
|
133
|
-
def
|
134
|
-
@
|
150
|
+
def unreferenced!(value = true)
|
151
|
+
@unreferenced = value
|
135
152
|
end
|
136
153
|
|
137
154
|
def configure_code_diagnostics(hash = nil)
|
@@ -142,91 +159,99 @@ module Steep
|
|
142
159
|
yield code_diagnostics_config if block_given?
|
143
160
|
end
|
144
161
|
|
145
|
-
def
|
146
|
-
|
162
|
+
def code_diagnostics_config
|
163
|
+
@code_diagnostics_config ||= Diagnostic::Ruby.default.dup
|
147
164
|
end
|
148
165
|
|
149
|
-
def
|
150
|
-
|
151
|
-
end
|
166
|
+
def group(name, &block)
|
167
|
+
group = GroupDSL.new(name, self)
|
152
168
|
|
153
|
-
|
154
|
-
|
169
|
+
Steep.logger.tagged "group=#{name}" do
|
170
|
+
group.instance_exec(&block) if block
|
171
|
+
end
|
172
|
+
|
173
|
+
groups << group
|
155
174
|
end
|
156
175
|
end
|
157
176
|
|
158
|
-
|
177
|
+
class GroupDSL
|
178
|
+
include WithPattern
|
179
|
+
|
180
|
+
attr_reader :name
|
181
|
+
|
182
|
+
attr_reader :target
|
183
|
+
|
184
|
+
attr_reader :code_diagnostics_config
|
159
185
|
|
160
|
-
|
161
|
-
|
162
|
-
target
|
163
|
-
target.library "gemfile"
|
186
|
+
def initialize(name, target)
|
187
|
+
@name = name
|
188
|
+
@target = target
|
164
189
|
end
|
165
|
-
}
|
166
190
|
|
167
|
-
|
168
|
-
|
191
|
+
def configure_code_diagnostics(config = nil)
|
192
|
+
if block_given?
|
193
|
+
if code_diagnostics_config
|
194
|
+
if config
|
195
|
+
code_diagnostics_config.merge!(config)
|
196
|
+
end
|
197
|
+
else
|
198
|
+
@code_diagnostics_config = (config || target.code_diagnostics_config).dup
|
199
|
+
end
|
200
|
+
|
201
|
+
yield (code_diagnostics_config || raise)
|
202
|
+
else
|
203
|
+
@code_diagnostics_config = config&.dup
|
204
|
+
end
|
205
|
+
end
|
169
206
|
end
|
170
207
|
|
208
|
+
include LibraryOptions
|
209
|
+
|
210
|
+
attr_reader :project
|
211
|
+
|
171
212
|
def initialize(project:)
|
172
213
|
@project = project
|
173
214
|
end
|
174
215
|
|
175
|
-
def self.register_template(name, target)
|
176
|
-
templates[name] = target
|
177
|
-
end
|
178
|
-
|
179
216
|
def self.parse(project, code, filename: "Steepfile")
|
180
217
|
Steep.logger.tagged filename do
|
181
|
-
self.new(project: project)
|
218
|
+
dsl = self.new(project: project)
|
219
|
+
dsl.instance_eval(code, filename)
|
220
|
+
project.global_options = dsl.to_library_options
|
182
221
|
end
|
183
222
|
end
|
184
223
|
|
185
|
-
def
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
TargetDSL.new(name, code_diagnostics_config: Diagnostic::Ruby.default.dup, project: project)
|
191
|
-
end
|
192
|
-
|
193
|
-
Steep.logger.tagged "target=#{name}" do
|
194
|
-
target.instance_eval(&block) if block
|
224
|
+
def self.eval(project, &block)
|
225
|
+
Steep.logger.tagged "DSL.eval" do
|
226
|
+
dsl = self.new(project: project)
|
227
|
+
dsl.instance_exec(&block)
|
228
|
+
project.global_options = dsl.to_library_options
|
195
229
|
end
|
230
|
+
end
|
196
231
|
|
197
|
-
|
198
|
-
|
232
|
+
def target(name, &block)
|
233
|
+
dsl = TargetDSL.new(name, project: project)
|
199
234
|
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
target.collection_config_path
|
204
|
-
when nil
|
205
|
-
default = project.absolute_path(RBS::Collection::Config::PATH)
|
206
|
-
if default.file?
|
207
|
-
default
|
208
|
-
end
|
209
|
-
when false
|
210
|
-
nil
|
211
|
-
end
|
235
|
+
Steep.logger.tagged "target=#{name}" do
|
236
|
+
dsl.instance_eval(&block) if block
|
237
|
+
end
|
212
238
|
|
213
|
-
Project::Target.new(
|
214
|
-
name:
|
215
|
-
source_pattern: source_pattern,
|
216
|
-
signature_pattern: signature_pattern,
|
217
|
-
options:
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
code_diagnostics_config: target.code_diagnostics_config
|
227
|
-
).tap do |target|
|
228
|
-
project.targets << target
|
239
|
+
target = Project::Target.new(
|
240
|
+
name: dsl.name,
|
241
|
+
source_pattern: dsl.source_pattern,
|
242
|
+
signature_pattern: dsl.signature_pattern,
|
243
|
+
options: dsl.library_configured? ? dsl.to_library_options : nil,
|
244
|
+
code_diagnostics_config: dsl.code_diagnostics_config,
|
245
|
+
project: project,
|
246
|
+
unreferenced: dsl.unreferenced
|
247
|
+
)
|
248
|
+
|
249
|
+
dsl.groups.each do
|
250
|
+
group = Group.new(target, _1.name, _1.source_pattern, _1.signature_pattern, _1.code_diagnostics_config || target.code_diagnostics_config)
|
251
|
+
target.groups << group
|
229
252
|
end
|
253
|
+
|
254
|
+
project.targets << target
|
230
255
|
end
|
231
256
|
end
|
232
257
|
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module Steep
|
2
|
+
class Project
|
3
|
+
class Group
|
4
|
+
attr_reader :name
|
5
|
+
attr_reader :source_pattern
|
6
|
+
attr_reader :signature_pattern
|
7
|
+
attr_reader :target
|
8
|
+
attr_reader :code_diagnostics_config
|
9
|
+
|
10
|
+
def initialize(target, name, source_pattern, signature_pattern, code_diagnostics_config)
|
11
|
+
@target = target
|
12
|
+
@name = name
|
13
|
+
@source_pattern = source_pattern
|
14
|
+
@signature_pattern = signature_pattern
|
15
|
+
@code_diagnostics_config = code_diagnostics_config
|
16
|
+
end
|
17
|
+
|
18
|
+
def project
|
19
|
+
target.project
|
20
|
+
end
|
21
|
+
|
22
|
+
def possible_source_file?(path)
|
23
|
+
source_pattern =~ path
|
24
|
+
end
|
25
|
+
|
26
|
+
def possible_signature_file?(path)
|
27
|
+
signature_pattern =~ path
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
data/lib/steep/project/target.rb
CHANGED
@@ -2,29 +2,55 @@ module Steep
|
|
2
2
|
class Project
|
3
3
|
class Target
|
4
4
|
attr_reader :name
|
5
|
-
attr_reader :
|
5
|
+
attr_reader :target_options
|
6
6
|
|
7
7
|
attr_reader :source_pattern
|
8
8
|
attr_reader :signature_pattern
|
9
9
|
attr_reader :code_diagnostics_config
|
10
|
+
attr_reader :project
|
11
|
+
attr_reader :unreferenced
|
12
|
+
attr_reader :groups
|
10
13
|
|
11
|
-
def initialize(name:, options:, source_pattern:, signature_pattern:, code_diagnostics_config:)
|
14
|
+
def initialize(name:, options:, source_pattern:, signature_pattern:, code_diagnostics_config:, project:, unreferenced:)
|
12
15
|
@name = name
|
13
|
-
@
|
16
|
+
@target_options = options
|
14
17
|
@source_pattern = source_pattern
|
15
18
|
@signature_pattern = signature_pattern
|
16
19
|
@code_diagnostics_config = code_diagnostics_config
|
20
|
+
@project = project
|
21
|
+
@unreferenced = unreferenced
|
22
|
+
@groups = []
|
23
|
+
end
|
24
|
+
|
25
|
+
def options
|
26
|
+
target_options || project.global_options
|
17
27
|
end
|
18
28
|
|
19
29
|
def possible_source_file?(path)
|
20
|
-
|
30
|
+
if target = groups.find { _1.possible_source_file?(path) }
|
31
|
+
return target
|
32
|
+
end
|
33
|
+
|
34
|
+
if source_pattern =~ path
|
35
|
+
return self
|
36
|
+
end
|
37
|
+
|
38
|
+
nil
|
21
39
|
end
|
22
40
|
|
23
41
|
def possible_signature_file?(path)
|
24
|
-
|
42
|
+
if target = groups.find { _1.possible_signature_file?(path) }
|
43
|
+
return target
|
44
|
+
end
|
45
|
+
|
46
|
+
if signature_pattern =~ path
|
47
|
+
return self
|
48
|
+
end
|
49
|
+
|
50
|
+
nil
|
25
51
|
end
|
26
52
|
|
27
|
-
def new_env_loader(
|
53
|
+
def new_env_loader()
|
28
54
|
Target.construct_env_loader(options: options, project: project)
|
29
55
|
end
|
30
56
|
|
data/lib/steep/project.rb
CHANGED
@@ -3,6 +3,7 @@ module Steep
|
|
3
3
|
attr_reader :targets
|
4
4
|
attr_reader :steepfile_path
|
5
5
|
attr_reader :base_dir
|
6
|
+
attr_accessor :global_options
|
6
7
|
|
7
8
|
def initialize(steepfile_path:, base_dir: nil)
|
8
9
|
@targets = []
|
@@ -30,21 +31,48 @@ module Steep
|
|
30
31
|
(base_dir + path).cleanpath
|
31
32
|
end
|
32
33
|
|
34
|
+
def group_for_source_path(path)
|
35
|
+
path = relative_path(path)
|
36
|
+
targets.each do |target|
|
37
|
+
ret = target.possible_source_file?(path)
|
38
|
+
return ret if ret
|
39
|
+
end
|
40
|
+
nil
|
41
|
+
end
|
42
|
+
|
43
|
+
def group_for_path(path)
|
44
|
+
group_for_source_path(path) || group_for_signature_path(path)
|
45
|
+
end
|
46
|
+
|
47
|
+
def group_for_signature_path(path)
|
48
|
+
relative = relative_path(path)
|
49
|
+
targets.each do
|
50
|
+
ret = _1.possible_signature_file?(relative)
|
51
|
+
return ret if ret
|
52
|
+
end
|
53
|
+
nil
|
54
|
+
end
|
55
|
+
|
33
56
|
def target_for_source_path(path)
|
34
|
-
|
35
|
-
|
57
|
+
case group = group_for_source_path(path)
|
58
|
+
when Target
|
59
|
+
group
|
60
|
+
when Group
|
61
|
+
group.target
|
36
62
|
end
|
37
63
|
end
|
38
64
|
|
39
|
-
def
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
ts
|
46
|
-
end
|
65
|
+
def target_for_signature_path(path)
|
66
|
+
case group = group_for_signature_path(path)
|
67
|
+
when Target
|
68
|
+
group
|
69
|
+
when Group
|
70
|
+
group.target
|
47
71
|
end
|
48
72
|
end
|
73
|
+
|
74
|
+
def target_for_path(path)
|
75
|
+
target_for_source_path(path) || target_for_signature_path(path)
|
76
|
+
end
|
49
77
|
end
|
50
78
|
end
|
@@ -29,6 +29,14 @@ module Steep
|
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
32
|
+
module TypeCheckGroups
|
33
|
+
METHOD = "$/steep/typecheck/groups"
|
34
|
+
|
35
|
+
def self.notification(params)
|
36
|
+
{ method: METHOD, params: params }
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
32
40
|
module TypeCheck__Start
|
33
41
|
METHOD = "$/steep/typecheck/start"
|
34
42
|
|
@@ -56,6 +64,14 @@ module Steep
|
|
56
64
|
{ id: id, result: result }
|
57
65
|
end
|
58
66
|
end
|
67
|
+
|
68
|
+
module Groups
|
69
|
+
METHOD = "$/steep/groups"
|
70
|
+
|
71
|
+
def self.response(id, result)
|
72
|
+
{ id: id, result: result }
|
73
|
+
end
|
74
|
+
end
|
59
75
|
end
|
60
76
|
end
|
61
77
|
end
|
@@ -3,7 +3,6 @@ module Steep
|
|
3
3
|
class InteractionWorker < BaseWorker
|
4
4
|
include ChangeBuffer
|
5
5
|
|
6
|
-
ApplyChangeJob = _ = Class.new()
|
7
6
|
HoverJob = _ = Struct.new(:id, :path, :line, :column, keyword_init: true)
|
8
7
|
CompletionJob = _ = Struct.new(:id, :path, :line, :column, :trigger, keyword_init: true)
|
9
8
|
SignatureHelpJob = _ = Struct.new(:id, :path, :line, :column, keyword_init: true)
|
@@ -31,8 +30,6 @@ module Steep
|
|
31
30
|
end
|
32
31
|
|
33
32
|
case job
|
34
|
-
when ApplyChangeJob
|
35
|
-
# nop
|
36
33
|
when HoverJob
|
37
34
|
writer.write(
|
38
35
|
{
|
@@ -72,9 +69,7 @@ module Steep
|
|
72
69
|
|
73
70
|
def queue_job(job)
|
74
71
|
@last_job_mutex.synchronize do
|
75
|
-
|
76
|
-
@last_job = job
|
77
|
-
end
|
72
|
+
@last_job = job
|
78
73
|
end
|
79
74
|
queue << job
|
80
75
|
end
|
@@ -86,20 +81,17 @@ module Steep
|
|
86
81
|
|
87
82
|
when "textDocument/didChange"
|
88
83
|
collect_changes(request)
|
89
|
-
queue_job ApplyChangeJob.new
|
90
84
|
|
91
85
|
when CustomMethods::FileLoad::METHOD
|
92
86
|
params = request[:params] #: CustomMethods::FileLoad::params
|
93
87
|
input = params[:content]
|
94
88
|
load_files(input)
|
95
|
-
queue_job ApplyChangeJob.new
|
96
89
|
|
97
90
|
when CustomMethods::FileReset::METHOD
|
98
91
|
params = request[:params] #: CustomMethods::FileReset::params
|
99
92
|
uri = params[:uri]
|
100
93
|
text = params[:content]
|
101
94
|
reset_change(uri: uri, text: text)
|
102
|
-
queue_job ApplyChangeJob.new
|
103
95
|
|
104
96
|
when "textDocument/hover"
|
105
97
|
id = request[:id]
|
@@ -183,8 +175,7 @@ module Steep
|
|
183
175
|
is_incomplete: false,
|
184
176
|
items: completion_items
|
185
177
|
)
|
186
|
-
when
|
187
|
-
target = targets[0] or raise
|
178
|
+
when target = project.target_for_signature_path(job.path)
|
188
179
|
sig_service = service.signature_services[target.name] or raise
|
189
180
|
relative_path = job.path
|
190
181
|
|