(symbol, meaningAtPosition, checker)
| 130422 | } |
| 130423 | ts.getEncodedSemanticClassifications = getEncodedSemanticClassifications; |
| 130424 | function classifySymbol(symbol, meaningAtPosition, checker) { |
| 130425 | var flags = symbol.getFlags(); |
| 130426 | if ((flags & 2885600 /* SymbolFlags.Classifiable */) === 0 /* SymbolFlags.None */) { |
| 130427 | return undefined; |
| 130428 | } |
| 130429 | else if (flags & 32 /* SymbolFlags.Class */) { |
| 130430 | return 11 /* ClassificationType.className */; |
| 130431 | } |
| 130432 | else if (flags & 384 /* SymbolFlags.Enum */) { |
| 130433 | return 12 /* ClassificationType.enumName */; |
| 130434 | } |
| 130435 | else if (flags & 524288 /* SymbolFlags.TypeAlias */) { |
| 130436 | return 16 /* ClassificationType.typeAliasName */; |
| 130437 | } |
| 130438 | else if (flags & 1536 /* SymbolFlags.Module */) { |
| 130439 | // Only classify a module as such if |
| 130440 | // - It appears in a namespace context. |
| 130441 | // - There exists a module declaration which actually impacts the value side. |
| 130442 | return meaningAtPosition & 4 /* SemanticMeaning.Namespace */ || meaningAtPosition & 1 /* SemanticMeaning.Value */ && hasValueSideModule(symbol) ? 14 /* ClassificationType.moduleName */ : undefined; |
| 130443 | } |
| 130444 | else if (flags & 2097152 /* SymbolFlags.Alias */) { |
| 130445 | return classifySymbol(checker.getAliasedSymbol(symbol), meaningAtPosition, checker); |
| 130446 | } |
| 130447 | else if (meaningAtPosition & 2 /* SemanticMeaning.Type */) { |
| 130448 | return flags & 64 /* SymbolFlags.Interface */ ? 13 /* ClassificationType.interfaceName */ : flags & 262144 /* SymbolFlags.TypeParameter */ ? 15 /* ClassificationType.typeParameterName */ : undefined; |
| 130449 | } |
| 130450 | else { |
| 130451 | return undefined; |
| 130452 | } |
| 130453 | } |
| 130454 | /** Returns true if there exists a module that introduces entities on the value side. */ |
| 130455 | function hasValueSideModule(symbol) { |
| 130456 | return ts.some(symbol.declarations, function (declaration) { |
no test coverage detected
searching dependent graphs…