Skip to content

Commit

Permalink
Fixed completion missing issue
Browse files Browse the repository at this point in the history
  • Loading branch information
juliosueiras committed Jul 15, 2019
1 parent b5c09e3 commit e83a6b1
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions tfstructs/parser_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ func GetAttributeCompletion(result []lsp.CompletionItem, configType string, orig
schema, _ := res.GetRawProviderSchema()

for k, v := range schema.Block.Attributes {
if (v.Optional || v.Required) && !v.Computed {
if v.Optional || v.Required {
result = append(result, lsp.CompletionItem{
Label: k,
Detail: fmt.Sprintf(" (%s) %s", checkRequire(v), v.Type.FriendlyName()),
Expand Down Expand Up @@ -264,8 +264,10 @@ func GetAttributeCompletion(result []lsp.CompletionItem, configType string, orig
}, true, nil
}

helper.DumpLog(res)

for k, v := range res.Schema.Block.Attributes {
if (v.Optional || v.Required) && !v.Computed {
if v.Optional || v.Required {
result = append(result, lsp.CompletionItem{
Label: k,
Detail: fmt.Sprintf(" (%s) %s", checkRequire(v), v.Type.FriendlyName()),
Expand Down Expand Up @@ -301,7 +303,7 @@ func GetAttributeCompletion(result []lsp.CompletionItem, configType string, orig
}

for k, v := range res.Schema.Block.Attributes {
if (v.Optional || v.Required) && !v.Computed {
if v.Optional || v.Required {
result = append(result, lsp.CompletionItem{
Label: k,
Detail: fmt.Sprintf(" (%s) %s", checkRequire(v), v.Type.FriendlyName()),
Expand Down Expand Up @@ -380,7 +382,7 @@ func GetNestingCompletion(blocks []*hcl.Block, result []lsp.CompletionItem, conf

if resultBlock != nil {
for k, v := range resultBlock.Attributes {
if (v.Optional || v.Required) && !v.Computed {
if v.Optional || v.Required {
result = append(result, lsp.CompletionItem{
Label: k,
Detail: fmt.Sprintf(" (%s) %s", checkRequire(v), v.Type.FriendlyName()),
Expand Down Expand Up @@ -453,7 +455,7 @@ func GetNestingCompletion(blocks []*hcl.Block, result []lsp.CompletionItem, conf
if resultBlock != nil {

for k, v := range resultBlock.Attributes {
if (v.Optional || v.Required) && !v.Computed {
if v.Optional || v.Required {
result = append(result, lsp.CompletionItem{
Label: k,
Detail: fmt.Sprintf(" (%s) %s", checkRequire(v), v.Type.FriendlyName()),
Expand Down Expand Up @@ -526,7 +528,7 @@ func GetNestingCompletion(blocks []*hcl.Block, result []lsp.CompletionItem, conf
if resultBlock != nil {

for k, v := range resultBlock.Attributes {
if (v.Optional || v.Required) && !v.Computed {
if v.Optional || v.Required {
result = append(result, lsp.CompletionItem{
Label: k,
Detail: fmt.Sprintf(" (%s) %s", checkRequire(v), v.Type.FriendlyName()),
Expand Down

0 comments on commit e83a6b1

Please sign in to comment.