initial revision of reachability checks in binder

This commit is contained in:
Vladimir Matveev
2015-09-03 10:49:39 -07:00
parent 690b87c209
commit b62ef0d452
75 changed files with 1570 additions and 204 deletions

View File

@@ -446,7 +446,7 @@ namespace ts.BreakpointResolver {
// fall through.
case SyntaxKind.CatchClause:
return spanInNode(lastOrUndefined((<Block>node.parent).statements));;
return spanInNode(lastOrUndefined((<Block>node.parent).statements));
case SyntaxKind.CaseBlock:
// breakpoint in last statement of the last clause
@@ -493,9 +493,6 @@ namespace ts.BreakpointResolver {
default:
return spanInNode(node.parent);
}
// Default to parent node
return spanInNode(node.parent);
}
function spanInColonToken(node: Node): TextSpan {

View File

@@ -340,7 +340,6 @@ namespace ts.formatting {
return node;
}
}
return node;
}
}

View File

@@ -6,6 +6,9 @@ namespace ts.NavigateTo {
let patternMatcher = createPatternMatcher(searchValue);
let rawItems: RawNavigateToItem[] = [];
// This means "compare in a case insensitive manner."
let baseSensitivity: Intl.CollatorOptions = { sensitivity: "base" };
// Search the declarations in all files and output matched NavigateToItem into array of NavigateToItem[]
forEach(program.getSourceFiles(), sourceFile => {
cancellationToken.throwIfCancellationRequested();
@@ -162,8 +165,6 @@ namespace ts.NavigateTo {
return bestMatchKind;
}
// This means "compare in a case insensitive manner."
let baseSensitivity: Intl.CollatorOptions = { sensitivity: "base" };
function compareNavigateToItems(i1: RawNavigateToItem, i2: RawNavigateToItem) {
// TODO(cyrusn): get the gamut of comparisons that VS already uses here.
// Right now we just sort by kind first, and then by name of the item.

View File

@@ -4863,7 +4863,7 @@ namespace ts {
else if (!isFunctionLike(node)) {
forEachChild(node, aggregate);
}
};
}
}
/**
@@ -4910,7 +4910,7 @@ namespace ts {
else if (!isFunctionLike(node)) {
forEachChild(node, aggregate);
}
};
}
}
function ownsBreakOrContinueStatement(owner: Node, statement: BreakOrContinueStatement): boolean {
@@ -6219,8 +6219,6 @@ namespace ts {
}
return SemanticMeaning.Value | SemanticMeaning.Type | SemanticMeaning.Namespace;
Debug.fail("Unknown declaration type");
}
function isTypeReference(node: Node): boolean {

View File

@@ -320,7 +320,6 @@ namespace ts {
// TODO: should this be '==='?
if (settingsJson == null || settingsJson == "") {
throw Error("LanguageServiceShimHostAdapter.getCompilationSettings: empty compilationSettings");
return null;
}
return <CompilerOptions>JSON.parse(settingsJson);
}