Skip to content

Commit 4a7aa6d

Browse files
authored
feat(completion): take into account type of field inside default value completion (#100)
1 parent 9c8ba23 commit 4a7aa6d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

server/src/completion/CompletionContext.ts

+7
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,13 @@ export class CompletionContext {
104104
}
105105
}
106106

107+
if (parent.type === "storage_variable" || parent.type === "field") {
108+
const type = parent.childForFieldName("type")
109+
if (type) {
110+
this.contextTy = TypeInferer.inferType(new Expression(type, this.element.file))
111+
}
112+
}
113+
107114
if (element.node.type === "type_identifier") {
108115
this.isType = true
109116
}

0 commit comments

Comments
 (0)