Skip to content

Commit 1d94a47

Browse files
Add label when completing a nested index (#119)
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
1 parent fd733b2 commit 1d94a47

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pkg/server/completion.go

+2
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,8 @@ func typeToString(t ast.Node) string {
205205
return "string"
206206
case *ast.Import, *ast.ImportStr:
207207
return "import"
208+
case *ast.Index:
209+
return "object field"
208210
}
209211
return reflect.TypeOf(t).String()
210212
}

0 commit comments

Comments
 (0)