(pattern)
| 142408 | }; |
| 142409 | } |
| 142410 | function createPatternMatcher(pattern) { |
| 142411 | // We'll often see the same candidate string many times when searching (For example, when |
| 142412 | // we see the name of a module that is used everywhere, or the name of an overload). As |
| 142413 | // such, we cache the information we compute about the candidate for the life of this |
| 142414 | // pattern matcher so we don't have to compute it multiple times. |
| 142415 | var stringToWordSpans = new ts.Map(); |
| 142416 | var dotSeparatedSegments = pattern.trim().split(".").map(function (p) { return createSegment(p.trim()); }); |
| 142417 | // A segment is considered invalid if we couldn't find any words in it. |
| 142418 | if (dotSeparatedSegments.some(function (segment) { return !segment.subWordTextChunks.length; })) |
| 142419 | return undefined; |
| 142420 | return { |
| 142421 | getFullMatch: function (containers, candidate) { return getFullMatch(containers, candidate, dotSeparatedSegments, stringToWordSpans); }, |
| 142422 | getMatchForLastSegmentOfPattern: function (candidate) { return matchSegment(candidate, ts.last(dotSeparatedSegments), stringToWordSpans); }, |
| 142423 | patternContainsDots: dotSeparatedSegments.length > 1 |
| 142424 | }; |
| 142425 | } |
| 142426 | ts.createPatternMatcher = createPatternMatcher; |
| 142427 | function getFullMatch(candidateContainers, candidate, dotSeparatedSegments, stringToWordSpans) { |
| 142428 | // First, check that the last part of the dot separated pattern matches the name of the |
nothing calls this directly
no test coverage detected
searching dependent graphs…