File tree Expand file tree Collapse file tree 3 files changed +31
-0
lines changed
Expand file tree Collapse file tree 3 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,12 @@ type Job struct {
5252
5353 Type string
5454 TypeRange protocol.Range
55+
56+ PlanName string
57+ PlanNameRange protocol.Range
58+
59+ Key string
60+ KeyRange protocol.Range
5561}
5662
5763func (job * Job ) AddCompletionItem (label string , commitCharacters []string ) {
Original file line number Diff line number Diff line change @@ -125,6 +125,15 @@ func (doc *YamlDocument) parseSingleJob(jobNode *sitter.Node) ast.Job {
125125 case "type" :
126126 res .Type = doc .GetNodeText (valueNode )
127127 res .TypeRange = doc .NodeToRange (child )
128+
129+ case "plan_name" :
130+ res .PlanName = doc .GetNodeText (valueNode )
131+ res .PlanNameRange = doc .NodeToRange (child )
132+
133+ case "key" :
134+ res .Key = doc .GetNodeText (valueNode )
135+ res .KeyRange = doc .NodeToRange (child )
136+
128137 }
129138 }
130139 })
@@ -165,4 +174,10 @@ func (doc *YamlDocument) jobCompletionItem(job ast.Job) {
165174 if job .Type == "" {
166175 job .AddCompletionItem ("type" , []string {":" , " " })
167176 }
177+ if job .PlanName == "" {
178+ job .AddCompletionItem ("plan_name" , []string {":" , " " })
179+ }
180+ if job .Key == "" {
181+ job .AddCompletionItem ("key" , []string {":" , " " })
182+ }
168183}
Original file line number Diff line number Diff line change @@ -127,6 +127,16 @@ func TestComplete(t *testing.T) {
127127 InsertText : "type: " ,
128128 Kind : protocol .CompletionItemKindProperty ,
129129 },
130+ {
131+ Label : "plan_name" ,
132+ InsertText : "plan_name: " ,
133+ Kind : protocol .CompletionItemKindProperty ,
134+ },
135+ {
136+ Label : "key" ,
137+ InsertText : "key: " ,
138+ Kind : protocol .CompletionItemKindProperty ,
139+ },
130140 },
131141 },
132142 {
You can’t perform that action at this time.
0 commit comments