Skip to content

Commit

Permalink
Add label when completing a nested index (#119)
Browse files Browse the repository at this point in the history
When doing auto-complete, it currently shows `*ast.Index` when it's nested Indexing because we don't follow up to the final ref
Instead of `ast.Index`, we can say `object attribute` which makes a bit more sense for users
  • Loading branch information
julienduchesne authored Aug 24, 2023
1 parent fd733b2 commit 1d94a47
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/server/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@ func typeToString(t ast.Node) string {
return "string"
case *ast.Import, *ast.ImportStr:
return "import"
case *ast.Index:
return "object field"
}
return reflect.TypeOf(t).String()
}

0 comments on commit 1d94a47

Please sign in to comment.