Merge pull request #16684 from amcasey/Vsts434619

Watch for the creation of missing files
This commit is contained in:
Andrew Casey
2017-06-29 13:41:18 -07:00
committed by GitHub
18 changed files with 287 additions and 47 deletions

View File

@@ -2,7 +2,10 @@
namespace ts.DocumentHighlights {
export function getDocumentHighlights(program: Program, cancellationToken: CancellationToken, sourceFile: SourceFile, position: number, sourceFilesToSearch: SourceFile[]): DocumentHighlights[] | undefined {
const node = getTouchingWord(sourceFile, position, /*includeJsDocComment*/ true);
if (!node) return undefined;
// Note that getTouchingWord indicates failure by returning the sourceFile node.
if (node === sourceFile) return undefined;
Debug.assert(node.parent !== undefined);
if (isJsxOpeningElement(node.parent) && node.parent.tagName === node || isJsxClosingElement(node.parent)) {
// For a JSX element, just highlight the matching tag, not all references.