Update LKG

This commit is contained in:
Mohamed Hegazy
2017-02-14 14:15:12 -08:00
parent fbab67f397
commit 733dbd9a42
10 changed files with 544 additions and 173 deletions

View File

@@ -69700,13 +69700,27 @@ var ts;
}
}
else if (sourceFile.languageVariant === 1 /* JSX */) {
if (kind === 26 /* LessThanToken */) {
isRightOfOpenTag = true;
location = contextToken;
}
else if (kind === 40 /* SlashToken */ && contextToken.parent.kind === 251 /* JsxClosingElement */) {
isStartingCloseTag = true;
location = contextToken;
switch (contextToken.parent.kind) {
case 251 /* JsxClosingElement */:
if (kind === 40 /* SlashToken */) {
isStartingCloseTag = true;
location = contextToken;
}
break;
case 193 /* BinaryExpression */:
if (!(contextToken.parent.left.flags & 32768 /* ThisNodeHasError */)) {
// It has a left-hand side, so we're not in an opening JSX tag.
break;
}
// fall through
case 249 /* JsxSelfClosingElement */:
case 248 /* JsxElement */:
case 250 /* JsxOpeningElement */:
if (kind === 26 /* LessThanToken */) {
isRightOfOpenTag = true;
location = contextToken;
}
break;
}
}
}
@@ -71441,21 +71455,23 @@ var ts;
}
function getAllReferencesForKeyword(sourceFiles, keywordKind, cancellationToken) {
var name = ts.tokenToString(keywordKind);
var definition = {
containerKind: "",
containerName: "",
fileName: "",
kind: ts.ScriptElementKind.keyword,
name: name,
textSpan: ts.createTextSpan(0, 1),
displayParts: [{ text: name, kind: ts.ScriptElementKind.keyword }]
};
var references = [];
for (var _i = 0, sourceFiles_6 = sourceFiles; _i < sourceFiles_6.length; _i++) {
var sourceFile = sourceFiles_6[_i];
cancellationToken.throwIfCancellationRequested();
addReferencesForKeywordInFile(sourceFile, keywordKind, name, cancellationToken, references);
}
if (!references.length)
return undefined;
var definition = {
containerKind: "",
containerName: "",
fileName: references[0].fileName,
kind: ts.ScriptElementKind.keyword,
name: name,
textSpan: references[0].textSpan,
displayParts: [{ text: name, kind: ts.ScriptElementKind.keyword }]
};
return [{ definition: definition, references: references }];
}
function addReferencesForKeywordInFile(sourceFile, kind, searchText, cancellationToken, references) {
@@ -79471,7 +79487,19 @@ var ts;
return importDecl;
}
function createCodeFixToRemoveNode(node) {
return createCodeFix("", node.getStart(), node.getWidth());
var end = node.getEnd();
var endCharCode = sourceFile.text.charCodeAt(end);
var afterEndCharCode = sourceFile.text.charCodeAt(end + 1);
if (ts.isLineBreak(endCharCode)) {
end += 1;
}
// in the case of CR LF, you could have two consecutive new line characters for one new line.
// this needs to be differenciated from two LF LF chars that actually mean two new lines.
if (ts.isLineBreak(afterEndCharCode) && endCharCode !== afterEndCharCode) {
end += 1;
}
var start = node.getStart();
return createCodeFix("", start, end - start);
}
function findFirstNonSpaceCharPosStarting(start) {
while (ts.isWhiteSpace(sourceFile.text.charCodeAt(start))) {