@@ -14,7 +14,6 @@ import {
1414 canHaveModifiers ,
1515 canProduceDiagnostics ,
1616 ClassDeclaration ,
17- CommentRange ,
1817 compact ,
1918 concatenate ,
2019 ConditionalTypeNode ,
@@ -63,8 +62,6 @@ import {
6362 getExternalModuleImportEqualsDeclarationExpression ,
6463 getExternalModuleNameFromDeclaration ,
6564 getFirstConstructorWithBody ,
66- getLeadingCommentRanges ,
67- getLeadingCommentRangesOfNode ,
6865 getLineAndCharacterOfPosition ,
6966 getNameOfDeclaration ,
7067 getNormalizedAbsolutePath ,
@@ -80,7 +77,6 @@ import {
8077 GetSymbolAccessibilityDiagnostic ,
8178 getTextOfNode ,
8279 getThisParameter ,
83- getTrailingCommentRanges ,
8480 hasDynamicName ,
8581 hasEffectiveModifier ,
8682 hasExtension ,
@@ -126,6 +122,7 @@ import {
126122 isImportEqualsDeclaration ,
127123 isIndexSignatureDeclaration ,
128124 isInterfaceDeclaration ,
125+ isInternalDeclaration ,
129126 isJsonSourceFile ,
130127 isLateVisibilityPaintedStatement ,
131128 isLiteralImportTypeNode ,
@@ -158,7 +155,6 @@ import {
158155 isVariableDeclaration ,
159156 isVarUsing ,
160157 JSDocFunctionType ,
161- last ,
162158 LateBoundDeclaration ,
163159 LateVisibilityPaintedStatement ,
164160 length ,
@@ -202,7 +198,6 @@ import {
202198 setParent ,
203199 setTextRange ,
204200 SignatureDeclaration ,
205- skipTrivia ,
206201 some ,
207202 SourceFile ,
208203 startsWith ,
@@ -243,35 +238,6 @@ export function getDeclarationDiagnostics(host: EmitHost, resolver: EmitResolver
243238 return result . diagnostics ;
244239}
245240
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-
275241const declarationEmitNodeBuilderFlags = NodeBuilderFlags . MultilineObjectLiterals |
276242 NodeBuilderFlags . WriteClassExpressionAsTypeLiteral |
277243 NodeBuilderFlags . UseTypeOfFunction |
0 commit comments