Skip to content

Commit 6da98ce

Browse files
author
Yui T
committed
Fix comments
1 parent 06c9876 commit 6da98ce

File tree

3 files changed

+15
-12
lines changed

3 files changed

+15
-12
lines changed

src/compiler/checker.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12680,10 +12680,6 @@ namespace ts {
1268012680
break;
1268112681
case SyntaxKind.FunctionExpression:
1268212682
case SyntaxKind.ClassExpression:
12683-
// The reason we are not using copySymbol for function expression and class expression
12684-
// is that copySymbol will not copy a symbol into SymbolTable if the symbol has name prefix
12685-
// with "__". Therefore, if class expression or function expression have declared name,
12686-
// we will add the symbol into the table using its declared name
1268712683
let name = (<FunctionExpression|ClassExpression>location).name;
1268812684
if (name) {
1268912685
copySymbol(location.symbol, meaning, name.text);

src/harness/fourslash.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -705,8 +705,14 @@ module FourSlash {
705705
}
706706

707707
/**
708-
* Verfiy that the completion list does NOT contain the given symbol. If text, or documentation, or kind are provided,
709-
* the list contains the symbol all given parameters must matched. When any parameter is omitted, the parameters is ignored during comparison.
708+
* Verify that the completion list does NOT contain the given symbol.
709+
* The symbol is considered matched with the symbol in the list if and only if all given parameters must matched.
710+
* When any parameter is omitted, the parameter is ignored during comparison and assumed that the parameter with
711+
* that property of the symbol in the list.
712+
* @param symbol the name of symbol
713+
* @param expectedText the text associated with the symbol
714+
* @param expectedDocumentation the documentation text associated with the symbol
715+
* @param expectedKind the kind of symbol (see ScriptElementKind)
710716
*/
711717
public verifyCompletionListDoesNotContain(symbol: string, expectedText?: string, expectedDocumentation?: string, expectedKind?: string) {
712718
let that = this;

src/services/services.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2847,13 +2847,14 @@ namespace ts {
28472847

28482848
name = stripQuotes(name);
28492849

2850-
// We can simply return name with strip quotes because the name could be an invalid identifier name
2851-
// e.g "b a" is valid quoted name but when we strip off the quotes, it is invalid.
2852-
// We, thus, need to check if whatever was inside the quotes is actually a valid identifier name.
28532850
if (!name) {
28542851
return undefined;
28552852
}
28562853

2854+
// If the user entered name for the symbol was quoted, removing the quotes is not enough, as the name could be an
2855+
// invalid identifier name. We need to check if whatever was inside the quotes is actually a valid identifier name.
2856+
// e.g "b a" is valid quoted name but when we strip off the quotes, it is invalid.
2857+
// We, thus, need to check if whatever was inside the quotes is actually a valid identifier name.
28572858
if (performCharacterChecks) {
28582859
if (!isIdentifierStart(name.charCodeAt(0), target)) {
28592860
return undefined;
@@ -3829,10 +3830,10 @@ namespace ts {
38293830
}
38303831
}
38313832
if (symbolFlags & SymbolFlags.Class && !hasAddedSymbolInfo) {
3832-
// Special case for class expressions because we would like to indicate that
3833-
// the class name is local to the class body (similar to function expression)
3834-
// (local class) class <className>
38353833
if (getDeclarationOfKind(symbol, SyntaxKind.ClassExpression)) {
3834+
// Special case for class expressions because we would like to indicate that
3835+
// the class name is local to the class body (similar to function expression)
3836+
// (local class) class <className>
38363837
pushTypePart(ScriptElementKind.localClassElement);
38373838
}
38383839
else {

0 commit comments

Comments
 (0)