diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 25841884f19..14e2b889ede 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -12680,10 +12680,6 @@ namespace ts { break; case SyntaxKind.FunctionExpression: case SyntaxKind.ClassExpression: - // The reason we are not using copySymbol for function expression and class expression - // is that copySymbol will not copy a symbol into SymbolTable if the symbol has name prefix - // with "__". Therefore, if class expression or function expression have declared name, - // we will add the symbol into the table using its declared name let name = (location).name; if (name) { copySymbol(location.symbol, meaning, name.text); diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index 9a07482e60d..2454ebb26c9 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -705,8 +705,14 @@ module FourSlash { } /** - * Verfiy that the completion list does NOT contain the given symbol. If text, or documentation, or kind are provided, - * the list contains the symbol all given parameters must matched. When any parameter is omitted, the parameters is ignored during comparison. + * Verify that the completion list does NOT contain the given symbol. + * The symbol is considered matched with the symbol in the list if and only if all given parameters must matched. + * When any parameter is omitted, the parameter is ignored during comparison and assumed that the parameter with + * that property of the symbol in the list. + * @param symbol the name of symbol + * @param expectedText the text associated with the symbol + * @param expectedDocumentation the documentation text associated with the symbol + * @param expectedKind the kind of symbol (see ScriptElementKind) */ public verifyCompletionListDoesNotContain(symbol: string, expectedText?: string, expectedDocumentation?: string, expectedKind?: string) { let that = this; diff --git a/src/services/services.ts b/src/services/services.ts index 01500b23812..cfbe8f4ee29 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -2847,13 +2847,14 @@ namespace ts { name = stripQuotes(name); - // We can simply return name with strip quotes because the name could be an invalid identifier name - // e.g "b a" is valid quoted name but when we strip off the quotes, it is invalid. - // We, thus, need to check if whatever was inside the quotes is actually a valid identifier name. if (!name) { return undefined; } + // If the user entered name for the symbol was quoted, removing the quotes is not enough, as the name could be an + // invalid identifier name. We need to check if whatever was inside the quotes is actually a valid identifier name. + // e.g "b a" is valid quoted name but when we strip off the quotes, it is invalid. + // We, thus, need to check if whatever was inside the quotes is actually a valid identifier name. if (performCharacterChecks) { if (!isIdentifierStart(name.charCodeAt(0), target)) { return undefined; @@ -3829,10 +3830,10 @@ namespace ts { } } if (symbolFlags & SymbolFlags.Class && !hasAddedSymbolInfo) { - // Special case for class expressions because we would like to indicate that - // the class name is local to the class body (similar to function expression) - // (local class) class if (getDeclarationOfKind(symbol, SyntaxKind.ClassExpression)) { + // Special case for class expressions because we would like to indicate that + // the class name is local to the class body (similar to function expression) + // (local class) class pushTypePart(ScriptElementKind.localClassElement); } else {