( program: StructuredEditorProgram, fieldMap: Map<string, PyrightSymbol>, seen: Set<string>, parentName?: string )
| 191 | } |
| 192 | |
| 193 | const suggestionsForEntries = ( |
| 194 | program: StructuredEditorProgram, |
| 195 | fieldMap: Map<string, PyrightSymbol>, |
| 196 | seen: Set<string>, |
| 197 | parentName?: string |
| 198 | ): AutocompleteInfo[] => { |
| 199 | const evaluator = program.evaluator |
| 200 | if (!evaluator) { |
| 201 | return [] |
| 202 | } |
| 203 | |
| 204 | const fields = Array.from(fieldMap.entries()) |
| 205 | |
| 206 | return fields |
| 207 | .map(([fieldName, symbol]): AutocompleteInfo[] => { |
| 208 | if (seen.has(fieldName) || symbol.isExternallyHidden()) { |
| 209 | return [] |
| 210 | } |
| 211 | |
| 212 | seen.add(fieldName) |
| 213 | |
| 214 | const declarations = symbol.getDeclarations() |
| 215 | return declarations |
| 216 | .map((dec, i) => suggestionsForDeclaration(fieldName, symbol, program, parentName, dec, i)) |
| 217 | .flat() |
| 218 | }) |
| 219 | .flat() |
| 220 | .filter((suggestion) => suggestion !== null) |
| 221 | } |
| 222 | |
| 223 | export function getAutocompleteInfo( |
| 224 | program: StructuredEditorProgram, |
no test coverage detected