()
| 156 | } |
| 157 | |
| 158 | func createTopLevelItems() []protocol.CompletionItem { |
| 159 | items := []protocol.CompletionItem{} |
| 160 | for attributeName, schema := range schemaProperties() { |
| 161 | item := protocol.CompletionItem{Label: attributeName} |
| 162 | if schema.Description != "" { |
| 163 | item.Documentation = schema.Description |
| 164 | } |
| 165 | items = append(items, item) |
| 166 | } |
| 167 | slices.SortFunc(items, func(a, b protocol.CompletionItem) int { |
| 168 | return strings.Compare(a.Label, b.Label) |
| 169 | }) |
| 170 | return items |
| 171 | } |
| 172 | |
| 173 | func calculateTopLevelNodeOffset(file *ast.File) int { |
| 174 | if len(file.Docs) == 1 { |
no test coverage detected