Skip to content

Commit

Permalink
feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
jpogran committed Aug 5, 2024
1 parent dbb3ce4 commit 625c109
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
5 changes: 2 additions & 3 deletions internal/features/stacks/decoder/path_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,10 @@ func (pr *PathReader) PathContext(path lang.Path) (*decoder.PathContext, error)

switch path.LanguageID {
case ilsp.Stacks.String():
x := CombinedReader{
return stackPathContext(record, CombinedReader{
StateReader: pr.StateReader,
ModuleReader: pr.ModuleReader,
}
return stackPathContext(record, x)
})
case ilsp.Deploy.String():
return deployPathContext(record)
}
Expand Down
4 changes: 1 addition & 3 deletions internal/features/stacks/decoder/validations/valid_name.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func (sb StackBlockValidName) Visit(ctx context.Context, node hclsyntax.Node, no
// but I'm not sure if it's worth it at the moment. The names of these blocks are used as identifiers
// in the stack and are used in the UI, so they have to be valid Terraform identifiers or else the stack
// will not be able to be created. This is a very basic check to ensure that the names are valid until we can
// do more advanced checks or use the cloud api.
// do more advanced checks or use the cloud api.
// I tried adding this to the earlydecoder, but we do not seem to report the diagnostics there at all currently,
// so nothing was being reported. I'm not sure if that's a bug or intended.

Expand All @@ -44,8 +44,6 @@ func (sb StackBlockValidName) Visit(ctx context.Context, node hclsyntax.Node, no
// case "required_providers":
case "variable":
diags = hasValidNameLabel(block, diags)
case "input":
diags = hasValidNameLabel(block, diags)
case "output":
diags = hasValidNameLabel(block, diags)
// deployment
Expand Down
4 changes: 2 additions & 2 deletions internal/features/stacks/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ func (f *StacksFeature) decodeStack(ctx context.Context, dir document.DirHandle,
deferIds = append(deferIds, eSchemaId)

if validationOptions.EnableEnhancedValidation {
validationIds, err := f.stateStore.JobStore.EnqueueJob(ctx, job.Job{
validationId, err := f.stateStore.JobStore.EnqueueJob(ctx, job.Job{
Dir: dir,
Func: func(ctx context.Context) error {
return jobs.SchemaStackValidation(ctx, f.store, f.moduleFeature, dir.Path())
Expand All @@ -251,7 +251,7 @@ func (f *StacksFeature) decodeStack(ctx context.Context, dir document.DirHandle,
if err != nil {
return deferIds, err
}
deferIds = append(deferIds, validationIds)
deferIds = append(deferIds, validationId)
}

return deferIds, nil
Expand Down

0 comments on commit 625c109

Please sign in to comment.