@@ -14,7 +14,6 @@ import {
14
14
canHaveModifiers ,
15
15
canProduceDiagnostics ,
16
16
ClassDeclaration ,
17
- CommentRange ,
18
17
compact ,
19
18
concatenate ,
20
19
ConditionalTypeNode ,
@@ -63,8 +62,6 @@ import {
63
62
getExternalModuleImportEqualsDeclarationExpression ,
64
63
getExternalModuleNameFromDeclaration ,
65
64
getFirstConstructorWithBody ,
66
- getLeadingCommentRanges ,
67
- getLeadingCommentRangesOfNode ,
68
65
getLineAndCharacterOfPosition ,
69
66
getNameOfDeclaration ,
70
67
getNormalizedAbsolutePath ,
@@ -80,7 +77,6 @@ import {
80
77
GetSymbolAccessibilityDiagnostic ,
81
78
getTextOfNode ,
82
79
getThisParameter ,
83
- getTrailingCommentRanges ,
84
80
hasDynamicName ,
85
81
hasEffectiveModifier ,
86
82
hasExtension ,
@@ -126,6 +122,7 @@ import {
126
122
isImportEqualsDeclaration ,
127
123
isIndexSignatureDeclaration ,
128
124
isInterfaceDeclaration ,
125
+ isInternalDeclaration ,
129
126
isJsonSourceFile ,
130
127
isLateVisibilityPaintedStatement ,
131
128
isLiteralImportTypeNode ,
@@ -158,7 +155,6 @@ import {
158
155
isVariableDeclaration ,
159
156
isVarUsing ,
160
157
JSDocFunctionType ,
161
- last ,
162
158
LateBoundDeclaration ,
163
159
LateVisibilityPaintedStatement ,
164
160
length ,
@@ -202,7 +198,6 @@ import {
202
198
setParent ,
203
199
setTextRange ,
204
200
SignatureDeclaration ,
205
- skipTrivia ,
206
201
some ,
207
202
SourceFile ,
208
203
startsWith ,
@@ -243,35 +238,6 @@ export function getDeclarationDiagnostics(host: EmitHost, resolver: EmitResolver
243
238
return result . diagnostics ;
244
239
}
245
240
246
- function hasInternalAnnotation ( range : CommentRange , currentSourceFile : SourceFile ) {
247
- const comment = currentSourceFile . text . substring ( range . pos , range . end ) ;
248
- return comment . includes ( "@internal" ) ;
249
- }
250
-
251
- /** @internal */
252
- export function isInternalDeclaration ( node : Node , currentSourceFile : SourceFile ) {
253
- const parseTreeNode = getParseTreeNode ( node ) ;
254
- if ( parseTreeNode && parseTreeNode . kind === SyntaxKind . Parameter ) {
255
- const paramIdx = ( parseTreeNode . parent as SignatureDeclaration ) . parameters . indexOf ( parseTreeNode as ParameterDeclaration ) ;
256
- const previousSibling = paramIdx > 0 ? ( parseTreeNode . parent as SignatureDeclaration ) . parameters [ paramIdx - 1 ] : undefined ;
257
- const text = currentSourceFile . text ;
258
- const commentRanges = previousSibling
259
- ? concatenate (
260
- // to handle
261
- // ... parameters, /** @internal */
262
- // public param: string
263
- getTrailingCommentRanges ( text , skipTrivia ( text , previousSibling . end + 1 , /*stopAfterLineBreak*/ false , /*stopAtComments*/ true ) ) ,
264
- getLeadingCommentRanges ( text , node . pos ) ,
265
- )
266
- : getTrailingCommentRanges ( text , skipTrivia ( text , node . pos , /*stopAfterLineBreak*/ false , /*stopAtComments*/ true ) ) ;
267
- return commentRanges && commentRanges . length && hasInternalAnnotation ( last ( commentRanges ) , currentSourceFile ) ;
268
- }
269
- const leadingCommentRanges = parseTreeNode && getLeadingCommentRangesOfNode ( parseTreeNode , currentSourceFile ) ;
270
- return ! ! forEach ( leadingCommentRanges , range => {
271
- return hasInternalAnnotation ( range , currentSourceFile ) ;
272
- } ) ;
273
- }
274
-
275
241
const declarationEmitNodeBuilderFlags = NodeBuilderFlags . MultilineObjectLiterals |
276
242
NodeBuilderFlags . WriteClassExpressionAsTypeLiteral |
277
243
NodeBuilderFlags . UseTypeOfFunction |
0 commit comments