Skip to content

Commit

Permalink
Wip-fix incremental parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
Yui T committed Jun 19, 2017
1 parent 2721fd4 commit 11b9f6e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/compiler/parser.ts
Expand Up @@ -3700,7 +3700,7 @@ namespace ts {
// 3)we have a MemberExpression which either completes the LeftHandSideExpression,
// or starts the beginning of the first four CallExpression productions.
let expression: MemberExpression;
if (token() === SyntaxKind.ImportKeyword) {
if (token() === SyntaxKind.ImportKeyword && lookAhead(nextTokenIsOpenParenOrLessThan)) {
// We don't want to eagerly consume all import keyword as import call expression so we look a head to find "("
// For example:
// var foo3 = require("subfolder
Expand Down
4 changes: 4 additions & 0 deletions src/compiler/program.ts
Expand Up @@ -802,6 +802,10 @@ namespace ts {
// moduleAugmentations has changed
oldProgram.structureIsReused = StructureIsReused.SafeModules;
}
if ((oldSourceFile.flags & NodeFlags.PossiblyContainsDynamicImport) !== (newSourceFile.flags & NodeFlags.PossiblyContainsDynamicImport)) {
// dynamicImport has changed
oldProgram.structureIsReused = StructureIsReused.Not;
}

if (!arrayIsEqualTo(oldSourceFile.typeReferenceDirectives, newSourceFile.typeReferenceDirectives, fileReferenceIsEqualTo)) {
// 'types' references has changed
Expand Down

0 comments on commit 11b9f6e

Please sign in to comment.