@@ -55,7 +55,25 @@ func (f *StacksFeature) didOpen(ctx context.Context, dir document.DirHandle, lan
55
55
return ids , err
56
56
}
57
57
58
- return f .decodeStack (ctx , dir , false , true )
58
+ tfVersion , err := f .stateStore .JobStore .EnqueueJob (ctx , job.Job {
59
+ Dir : dir ,
60
+ Func : func (ctx context.Context ) error {
61
+ return jobs .LoadTerraformVersion (ctx , f .fs , f .store , path )
62
+ },
63
+ Type : operation .OpTypeLoadTerraformVersion .String (),
64
+ })
65
+ if err != nil {
66
+ return ids , err
67
+ }
68
+ ids = append (ids , tfVersion )
69
+
70
+ decodeIds , err := f .decodeStack (ctx , dir , false , true )
71
+ if err != nil {
72
+ return ids , err
73
+ }
74
+ ids = append (ids , decodeIds ... )
75
+
76
+ return ids , err
59
77
}
60
78
61
79
func (f * StacksFeature ) didChange (ctx context.Context , dir document.DirHandle ) (job.IDs , error ) {
@@ -168,20 +186,6 @@ func (f *StacksFeature) decodeStack(ctx context.Context, dir document.DirHandle,
168
186
}
169
187
ids = append (ids , parseId )
170
188
171
- tfVersion , err := f .stateStore .JobStore .EnqueueJob (ctx , job.Job {
172
- Dir : dir ,
173
- Func : func (ctx context.Context ) error {
174
- return jobs .LoadTerraformVersion (ctx , f .fs , f .store , path )
175
- },
176
- Type : operation .OpTypeLoadModuleMetadata .String (),
177
- DependsOn : job.IDs {parseId },
178
- IgnoreState : ignoreState ,
179
- })
180
- if err != nil {
181
- return ids , err
182
- }
183
- ids = append (ids , tfVersion )
184
-
185
189
// TODO: Implement the following functions where appropriate to stacks
186
190
// Future: LoadModuleMetadata(ctx, f.Store, path)
187
191
// Future: decodeDeclaredModuleCalls(ctx, dir, ignoreState)
0 commit comments