mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-11-18 20:11:14 +00:00
Merge pull request #5719 from Microsoft/typesCleanup2
Additional Types cleanup.
This commit is contained in:
commit
7d6100bbe8
13 files changed
+72
-27
No files matched your search
@@ -2320,7 +2320,7 @@ namespace ts {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -2339,7 +2339,7 @@ namespace ts {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
function tryConsumeDefine(): boolean {
|
||||
let token = scanner.getToken();
|
||||
if (token === SyntaxKind.Identifier && scanner.getTokenValue() === "define") {
|
||||
@@ -2365,7 +2365,7 @@ namespace ts {
|
||||
if (token !== SyntaxKind.OpenBracketToken) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// skip open bracket
|
||||
token = scanner.scan();
|
||||
let i = 0;
|
||||
@@ -2380,7 +2380,7 @@ namespace ts {
|
||||
token = scanner.scan();
|
||||
}
|
||||
return true;
|
||||
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -3985,7 +3985,7 @@ namespace ts {
|
||||
let sourceFile = getValidSourceFile(fileName);
|
||||
|
||||
let entries: CompletionEntry[] = [];
|
||||
|
||||
|
||||
if (isRightOfDot && isSourceFileJavaScript(sourceFile)) {
|
||||
const uniqueNames = getCompletionEntriesFromSymbols(symbols, entries);
|
||||
addRange(entries, getJavaScriptCompletionEntries(sourceFile, uniqueNames));
|
||||
@@ -4604,6 +4604,7 @@ namespace ts {
|
||||
case SyntaxKind.PropertyAccessExpression:
|
||||
case SyntaxKind.QualifiedName:
|
||||
case SyntaxKind.ThisKeyword:
|
||||
case SyntaxKind.ThisType:
|
||||
case SyntaxKind.SuperKeyword:
|
||||
// For the identifiers/this/super etc get the type at position
|
||||
let type = typeChecker.getTypeAtLocation(node);
|
||||
@@ -4875,6 +4876,7 @@ namespace ts {
|
||||
function getSemanticDocumentHighlights(node: Node): DocumentHighlights[] {
|
||||
if (node.kind === SyntaxKind.Identifier ||
|
||||
node.kind === SyntaxKind.ThisKeyword ||
|
||||
node.kind === SyntaxKind.ThisType ||
|
||||
node.kind === SyntaxKind.SuperKeyword ||
|
||||
isLiteralNameOfPropertyDeclarationOrIndexAccess(node) ||
|
||||
isNameOfExternalModuleImportOrDeclaration(node)) {
|
||||
@@ -5570,7 +5572,7 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
if (node.kind === SyntaxKind.ThisKeyword) {
|
||||
if (node.kind === SyntaxKind.ThisKeyword || node.kind === SyntaxKind.ThisType) {
|
||||
return getReferencesForThisKeyword(node, sourceFiles);
|
||||
}
|
||||
|
||||
@@ -6052,7 +6054,7 @@ namespace ts {
|
||||
cancellationToken.throwIfCancellationRequested();
|
||||
|
||||
let node = getTouchingWord(sourceFile, position);
|
||||
if (!node || node.kind !== SyntaxKind.ThisKeyword) {
|
||||
if (!node || (node.kind !== SyntaxKind.ThisKeyword && node.kind !== SyntaxKind.ThisType)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -6414,7 +6416,8 @@ namespace ts {
|
||||
|
||||
return node.parent.kind === SyntaxKind.TypeReference ||
|
||||
(node.parent.kind === SyntaxKind.ExpressionWithTypeArguments && !isExpressionWithTypeArgumentsInClassExtendsClause(<ExpressionWithTypeArguments>node.parent)) ||
|
||||
node.kind === SyntaxKind.ThisKeyword && !isExpression(node);
|
||||
(node.kind === SyntaxKind.ThisKeyword && !isExpression(node)) ||
|
||||
node.kind === SyntaxKind.ThisType;
|
||||
}
|
||||
|
||||
function isNamespaceReference(node: Node): boolean {
|
||||
@@ -6534,6 +6537,7 @@ namespace ts {
|
||||
case SyntaxKind.NullKeyword:
|
||||
case SyntaxKind.SuperKeyword:
|
||||
case SyntaxKind.ThisKeyword:
|
||||
case SyntaxKind.ThisType:
|
||||
case SyntaxKind.Identifier:
|
||||
break;
|
||||
|
||||
|
||||
Reference in new issue
Block a user