Skip to content

Commit 85e5453

Browse files
committed
More PR feedback
1 parent 86ba694 commit 85e5453

File tree

5 files changed

+19
-22
lines changed

5 files changed

+19
-22
lines changed

src/compiler/types.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,11 +1013,6 @@ export type ForEachChildNodes =
10131013
| JSDocOverloadTag
10141014
;
10151015

1016-
/** @internal */
1017-
export type VisitEachChildNodes =
1018-
| HasChildren
1019-
;
1020-
10211016
/** @internal */
10221017
export type HasChildren =
10231018
| QualifiedName

src/compiler/utilitiesPublic.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ import {
190190
JsxExpression,
191191
JsxOpeningLikeElement,
192192
JsxTagNameExpression,
193+
KeywordSyntaxKind,
193194
LabeledStatement,
194195
lastOrUndefined,
195196
LeftHandSideExpression,
@@ -769,7 +770,7 @@ export function idText(identifierOrPrivateName: Identifier | PrivateIdentifier):
769770
* If the text of an Identifier matches a keyword (including contextual and TypeScript-specific keywords), returns the
770771
* SyntaxKind for the matching keyword.
771772
*/
772-
export function identifierToKeywordKind(node: Identifier) {
773+
export function identifierToKeywordKind(node: Identifier): KeywordSyntaxKind | undefined {
773774
const token = stringToToken(node.escapedText as string);
774775
return token ? tryCast(token, isKeyword) : undefined;
775776
}

src/harness/harnessUtils.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import * as ts from "./_namespaces/ts";
22
import * as Harness from "./_namespaces/Harness";
3-
import { isIdentifier } from "./_namespaces/ts";
43

54
export function encodeString(s: string): string {
65
return ts.sys.bufferFrom!(s).toString("utf8");
@@ -221,7 +220,7 @@ export function sourceFileToJSON(file: ts.Node): string {
221220
// data we don't care about in the dump. We only care what the parser set directly
222221
// on the AST.
223222
let flags = n.flags & ~(ts.NodeFlags.JavaScriptFile | ts.NodeFlags.HasAggregatedChildData);
224-
if (isIdentifier(n)) {
223+
if (ts.isIdentifier(n)) {
225224
if (flags & ts.NodeFlags.IdentifierHasExtendedUnicodeEscape) {
226225
o.hasExtendedUnicodeEscape = true;
227226
flags &= ~ts.NodeFlags.IdentifierHasExtendedUnicodeEscape;

tests/baselines/reference/api/tsserverlibrary.d.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4414,8 +4414,7 @@ declare namespace ts {
44144414
ReachabilityCheckFlags = 768,
44154415
ReachabilityAndEmitFlags = 2816,
44164416
ContextFlags = 50720768,
4417-
TypeExcludesFlags = 40960,
4418-
IdentifierIsInJSDocNamespace = 2048
4417+
TypeExcludesFlags = 40960
44194418
}
44204419
enum ModifierFlags {
44214420
None = 0,
@@ -4585,14 +4584,16 @@ declare namespace ts {
45854584
* Text of identifier, but if the identifier begins with two underscores, this will begin with three.
45864585
*/
45874586
readonly escapedText: __String;
4588-
/** @deprecated Use `idKeyword(identifier)` instead. */
4589-
readonly originalKeywordKind?: SyntaxKind;
4590-
/** @deprecated Use `identifier.flags & NodeFlags.IdentifierIsInJSDocNamespace` instead. */
4591-
readonly isInJSDocNamespace?: boolean;
45924587
}
45934588
interface Identifier {
45944589
readonly text: string;
45954590
}
4591+
interface Identifier {
4592+
/** @deprecated Use `idKeyword(identifier)` instead. */
4593+
readonly originalKeywordKind?: SyntaxKind;
4594+
/** @deprecated Use `.parent` or the surrounding context to determine this instead. */
4595+
readonly isInJSDocNamespace?: boolean;
4596+
}
45964597
interface TransientIdentifier extends Identifier {
45974598
resolvedSymbol: Symbol;
45984599
}
@@ -8605,7 +8606,7 @@ declare namespace ts {
86058606
* If the text of an Identifier matches a keyword (including contextual and TypeScript-specific keywords), returns the
86068607
* SyntaxKind for the matching keyword.
86078608
*/
8608-
function idKeyword(node: Identifier): SyntaxKind | undefined;
8609+
function identifierToKeywordKind(node: Identifier): KeywordSyntaxKind | undefined;
86098610
function symbolName(symbol: Symbol): string;
86108611
function getNameOfJSDocTypedef(declaration: JSDocTypedefTag): Identifier | PrivateIdentifier | undefined;
86118612
function getNameOfDeclaration(declaration: Declaration | Expression | undefined): DeclarationName | undefined;

tests/baselines/reference/api/typescript.d.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -479,8 +479,7 @@ declare namespace ts {
479479
ReachabilityCheckFlags = 768,
480480
ReachabilityAndEmitFlags = 2816,
481481
ContextFlags = 50720768,
482-
TypeExcludesFlags = 40960,
483-
IdentifierIsInJSDocNamespace = 2048
482+
TypeExcludesFlags = 40960
484483
}
485484
enum ModifierFlags {
486485
None = 0,
@@ -650,14 +649,16 @@ declare namespace ts {
650649
* Text of identifier, but if the identifier begins with two underscores, this will begin with three.
651650
*/
652651
readonly escapedText: __String;
653-
/** @deprecated Use `idKeyword(identifier)` instead. */
654-
readonly originalKeywordKind?: SyntaxKind;
655-
/** @deprecated Use `identifier.flags & NodeFlags.IdentifierIsInJSDocNamespace` instead. */
656-
readonly isInJSDocNamespace?: boolean;
657652
}
658653
interface Identifier {
659654
readonly text: string;
660655
}
656+
interface Identifier {
657+
/** @deprecated Use `idKeyword(identifier)` instead. */
658+
readonly originalKeywordKind?: SyntaxKind;
659+
/** @deprecated Use `.parent` or the surrounding context to determine this instead. */
660+
readonly isInJSDocNamespace?: boolean;
661+
}
661662
interface TransientIdentifier extends Identifier {
662663
resolvedSymbol: Symbol;
663664
}
@@ -4670,7 +4671,7 @@ declare namespace ts {
46704671
* If the text of an Identifier matches a keyword (including contextual and TypeScript-specific keywords), returns the
46714672
* SyntaxKind for the matching keyword.
46724673
*/
4673-
function idKeyword(node: Identifier): SyntaxKind | undefined;
4674+
function identifierToKeywordKind(node: Identifier): KeywordSyntaxKind | undefined;
46744675
function symbolName(symbol: Symbol): string;
46754676
function getNameOfJSDocTypedef(declaration: JSDocTypedefTag): Identifier | PrivateIdentifier | undefined;
46764677
function getNameOfDeclaration(declaration: Declaration | Expression | undefined): DeclarationName | undefined;

0 commit comments

Comments
 (0)