mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-22 22:55:36 -05:00
Cleaning up a few things
This commit is contained in:
@@ -4880,11 +4880,13 @@ module ts {
|
||||
var symbol = getResolvedSymbol(node);
|
||||
|
||||
if (symbol.flags & SymbolFlags.Import) {
|
||||
|
||||
var symbolLinks = getSymbolLinks(symbol);
|
||||
symbolLinks.referenced = !isInTypeQuery(node) && !isConstEnumOrConstEnumOnlyModule(resolveImport(symbol));
|
||||
|
||||
// TODO(andersh): Figure out what this does
|
||||
// TODO: AndersH: This needs to be simplified. In an import of the form "import x = a.b.c;" we only need
|
||||
// to resolve "a" and mark it as referenced. If "b" and/or "c" are aliases, we would be able to access them
|
||||
// unless they're exported, and in that case they're already implicitly referenced.
|
||||
|
||||
//var symbolLinks = getSymbolLinks(symbol);
|
||||
//if (!symbolLinks.referenced) {
|
||||
// var importOrExportAssignment = getLeftSideOfImportEqualsOrExportAssignment(node);
|
||||
|
||||
@@ -753,36 +753,12 @@ module ts {
|
||||
}
|
||||
|
||||
export function getAncestor(node: Node, kind: SyntaxKind): Node {
|
||||
switch (kind) {
|
||||
// special-cases that can be come first
|
||||
case SyntaxKind.ClassDeclaration:
|
||||
while (node) {
|
||||
switch (node.kind) {
|
||||
case SyntaxKind.ClassDeclaration:
|
||||
return <ClassDeclaration>node;
|
||||
case SyntaxKind.EnumDeclaration:
|
||||
case SyntaxKind.InterfaceDeclaration:
|
||||
case SyntaxKind.TypeAliasDeclaration:
|
||||
case SyntaxKind.ModuleDeclaration:
|
||||
case SyntaxKind.ImportEqualsDeclaration:
|
||||
// early exit cases - declarations cannot be nested in classes
|
||||
return undefined;
|
||||
default:
|
||||
node = node.parent;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
while (node) {
|
||||
if (node.kind === kind) {
|
||||
return node;
|
||||
}
|
||||
node = node.parent;
|
||||
}
|
||||
break;
|
||||
while (node) {
|
||||
if (node.kind === kind) {
|
||||
return node;
|
||||
}
|
||||
node = node.parent;
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user