Handel export default declaration completions

This commit is contained in:
Mohamed Hegazy
2015-03-30 20:28:24 -07:00
parent bea7221174
commit 383f01dbf6
3 changed files with 30 additions and 1 deletions
+6 -1
View File
@@ -2404,6 +2404,11 @@ module ts {
return undefined;
}
// If this is the default export, get the name of the declaration if it exists
if (displayName === "default" && symbol.valueDeclaration && (symbol.valueDeclaration.flags & NodeFlags.Default) && symbol.valueDeclaration.localSymbol && symbol.valueDeclaration.localSymbol.name) {
displayName = symbol.valueDeclaration.localSymbol.name;
}
let firstCharCode = displayName.charCodeAt(0);
// First check of the displayName is not external module; if it is an external module, it is not valid entry
if ((symbol.flags & SymbolFlags.Namespace) && (firstCharCode === CharacterCodes.singleQuote || firstCharCode === CharacterCodes.doubleQuote)) {
@@ -2620,7 +2625,7 @@ module ts {
previousToken.getStart() :
position;
let scopeNode = getScopeNode(contextToken, adjustedPosition, sourceFile);
let scopeNode = getScopeNode(contextToken, adjustedPosition, sourceFile) || sourceFile;
/// TODO filter meaning based on the current context
let symbolMeanings = SymbolFlags.Type | SymbolFlags.Value | SymbolFlags.Namespace | SymbolFlags.Alias;