(location, outerName, meaning)
| 74993 | return suggestion && ts.symbolName(suggestion); |
| 74994 | } |
| 74995 | function getSuggestedSymbolForNonexistentSymbol(location, outerName, meaning) { |
| 74996 | ts.Debug.assert(outerName !== undefined, "outername should always be defined"); |
| 74997 | var result = resolveNameHelper(location, outerName, meaning, /*nameNotFoundMessage*/ undefined, outerName, /*isUse*/ false, /*excludeGlobals*/ false, /*getSpellingSuggestions*/ true, function (symbols, name, meaning) { |
| 74998 | ts.Debug.assertEqual(outerName, name, "name should equal outerName"); |
| 74999 | var symbol = getSymbol(symbols, name, meaning); |
| 75000 | // Sometimes the symbol is found when location is a return type of a function: `typeof x` and `x` is declared in the body of the function |
| 75001 | // So the table *contains* `x` but `x` isn't actually in scope. |
| 75002 | // However, resolveNameHelper will continue and call this callback again, so we'll eventually get a correct suggestion. |
| 75003 | if (symbol) |
| 75004 | return symbol; |
| 75005 | var candidates; |
| 75006 | if (symbols === globals) { |
| 75007 | var primitives = ts.mapDefined(["string", "number", "boolean", "object", "bigint", "symbol"], function (s) { return symbols.has((s.charAt(0).toUpperCase() + s.slice(1))) |
| 75008 | ? createSymbol(524288 /* SymbolFlags.TypeAlias */, s) |
| 75009 | : undefined; }); |
| 75010 | candidates = primitives.concat(ts.arrayFrom(symbols.values())); |
| 75011 | } |
| 75012 | else { |
| 75013 | candidates = ts.arrayFrom(symbols.values()); |
| 75014 | } |
| 75015 | return getSpellingSuggestionForName(ts.unescapeLeadingUnderscores(name), candidates, meaning); |
| 75016 | }); |
| 75017 | return result; |
| 75018 | } |
| 75019 | function getSuggestionForNonexistentSymbol(location, outerName, meaning) { |
| 75020 | var symbolResult = getSuggestedSymbolForNonexistentSymbol(location, outerName, meaning); |
| 75021 | return symbolResult && ts.symbolName(symbolResult); |
no test coverage detected
searching dependent graphs…