Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove even more internal comments #28418

Merged
merged 2 commits into from
Nov 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/compiler/binder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2921,7 +2921,6 @@ namespace ts {
}
}

/* @internal */
export function isExportsOrModuleExportsOrAlias(sourceFile: SourceFile, node: Expression): boolean {
return isExportsIdentifier(node) ||
isModuleExportsPropertyAccessExpression(node) ||
Expand Down Expand Up @@ -3898,7 +3897,6 @@ namespace ts {
* For performance reasons, `computeTransformFlagsForNode` uses local constant values rather
* than calling this function.
*/
/* @internal */
export function getTransformFlagsSubtreeExclusions(kind: SyntaxKind) {
if (kind >= SyntaxKind.FirstTypeNode && kind <= SyntaxKind.LastTypeNode) {
return TransformFlags.TypeExcludes;
Expand Down
1 change: 0 additions & 1 deletion src/compiler/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2052,7 +2052,6 @@ namespace ts {
}

/** Represents a "prefix*suffix" pattern. */
/* @internal */
export interface Pattern {
prefix: string;
suffix: string;
Expand Down
2 changes: 0 additions & 2 deletions src/compiler/sourcemapDecoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,12 @@ namespace ts.sourcemaps {
}
}

/*@internal*/
export interface MappingsDecoder extends Iterator<SourceMapSpan> {
readonly decodingIndex: number;
readonly error: string | undefined;
readonly lastSpan: SourceMapSpan;
}

/*@internal*/
export function decodeMappings(map: SourceMapData): MappingsDecoder {
const state: DecoderState = {
encodedText: map.mappings,
Expand Down
1 change: 0 additions & 1 deletion src/compiler/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5225,7 +5225,6 @@ namespace ts {
useCaseSensitiveFileNames(): boolean;
getCurrentDirectory(): string;

/* @internal */
isSourceFileFromExternalLibrary(file: SourceFile): boolean;
getLibFileFromReference(ref: FileReference): SourceFile | undefined;

Expand Down
1 change: 0 additions & 1 deletion src/compiler/watch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ namespace ts {
return false;
}

/** @internal */
export const screenStartingMessageCodes: number[] = [
Diagnostics.Starting_compilation_in_watch_mode.code,
Diagnostics.File_change_detected_Starting_incremental_compilation.code,
Expand Down
3 changes: 0 additions & 3 deletions src/jsTyping/jsTyping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,11 @@ namespace ts.JsTyping {
version: Version;
}

/* @internal */
export function isTypingUpToDate(cachedTyping: CachedTyping, availableTypingVersions: MapLike<string>) {
const availableVersion = new Version(getProperty(availableTypingVersions, `ts${versionMajorMinor}`) || getProperty(availableTypingVersions, "latest")!);
return availableVersion.compareTo(cachedTyping.version) <= 0;
}

/* @internal */
export const nodeCoreModuleList: ReadonlyArray<string> = [
"assert",
"async_hooks",
Expand Down Expand Up @@ -70,7 +68,6 @@ namespace ts.JsTyping {
"zlib"
];

/* @internal */
export const nodeCoreModules = arrayToSet(nodeCoreModuleList);

/**
Expand Down
1 change: 0 additions & 1 deletion src/jsTyping/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ namespace ts.server {
: undefined;
}

/*@internal*/
export function nowString() {
// E.g. "12:34:56.789"
const d = new Date();
Expand Down
2 changes: 1 addition & 1 deletion src/server/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ namespace ts.server {

/*@internal*/
constructor(
/*@internal*/readonly projectName: string,
readonly projectName: string,
readonly projectKind: ProjectKind,
readonly projectService: ProjectService,
private documentRegistry: DocumentRegistry,
Expand Down
1 change: 0 additions & 1 deletion src/server/scriptInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ namespace ts.server {

/* @internal */
export class TextStorage {
/*@internal*/
version: ScriptInfoVersion;

/**
Expand Down
1 change: 0 additions & 1 deletion src/server/scriptVersionCache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,6 @@ namespace ts.server {
}
}

/* @internal */
export class LineIndex {
root: LineNode;
// set this to true to check each edit for accuracy
Expand Down
2 changes: 0 additions & 2 deletions src/server/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,13 +208,11 @@ namespace ts.server {

const indentStr = "\n ";

/* @internal */
export function indent(str: string): string {
return indentStr + str.replace(/\n/g, indentStr);
}

/** Put stringified JSON on the next line, indented. */
/* @internal */
export function stringifyIndented(json: {}): string {
return indentStr + JSON.stringify(json);
}
Expand Down
1 change: 0 additions & 1 deletion src/services/formatting/formatting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,6 @@ namespace ts.formatting {
return 0;
}

/* @internal */
export function formatNodeGivenIndentation(node: Node, sourceFileLike: SourceFileLike, languageVariant: LanguageVariant, initialIndentation: number, delta: number, formatContext: FormatContext): TextChange[] {
const range = { pos: 0, end: sourceFileLike.text.length };
return getFormattingScanner(sourceFileLike.text, languageVariant, range.pos, range.end, scanner => formatSpanWorker(
Expand Down
4 changes: 2 additions & 2 deletions src/services/organizeImports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ namespace ts.OrganizeImports {
: undefined;
}

/* @internal */ // Internal for testing
// Internal for testing
/**
* @param importGroup a list of ImportDeclarations, all with the same module name.
*/
Expand Down Expand Up @@ -266,7 +266,7 @@ namespace ts.OrganizeImports {
}
}

/* @internal */ // Internal for testing
// Internal for testing
/**
* @param exportGroup a list of ExportDeclarations, all with the same module name.
*/
Expand Down
4 changes: 2 additions & 2 deletions src/services/patternMatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -461,11 +461,11 @@ namespace ts {
};
}

/* @internal */ export function breakIntoCharacterSpans(identifier: string): TextSpan[] {
export function breakIntoCharacterSpans(identifier: string): TextSpan[] {
return breakIntoSpans(identifier, /*word:*/ false);
}

/* @internal */ export function breakIntoWordSpans(identifier: string): TextSpan[] {
export function breakIntoWordSpans(identifier: string): TextSpan[] {
return breakIntoSpans(identifier, /*word:*/ true);
}

Expand Down
2 changes: 0 additions & 2 deletions src/services/suggestionDiagnostics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,11 @@ namespace ts {
return !!forEachReturnStatement(body, isReturnStatementWithFixablePromiseHandler);
}

/* @internal */
export function isReturnStatementWithFixablePromiseHandler(node: Node): node is ReturnStatement {
return isReturnStatement(node) && !!node.expression && isFixablePromiseHandler(node.expression);
}

// Should be kept up to date with transformExpression in convertToAsyncFunction.ts
/* @internal */
export function isFixablePromiseHandler(node: Node): boolean {
// ensure outermost call exists and is a promise handler
if (!isPromiseHandler(node) || !node.arguments.every(isFixablePromiseArgument)) {
Expand Down
7 changes: 0 additions & 7 deletions src/services/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1410,7 +1410,6 @@ namespace ts {
return node.modifiers && find(node.modifiers, m => m.kind === kind);
}

/* @internal */
export function insertImport(changes: textChanges.ChangeTracker, sourceFile: SourceFile, importDecl: Statement): void {
const lastImportDeclaration = findLast(sourceFile.statements, isAnyImportSyntax);
if (lastImportDeclaration) {
Expand Down Expand Up @@ -1598,7 +1597,6 @@ namespace ts {
return displayPart("\n", SymbolDisplayPartKind.lineBreak);
}

/* @internal */
export function mapToDisplayParts(writeDisplayParts: (writer: DisplayPartsSymbolWriter) => void): SymbolDisplayPart[] {
try {
writeDisplayParts(displayPartWriter);
Expand Down Expand Up @@ -1751,7 +1749,6 @@ namespace ts {
/**
* Sets EmitFlags to suppress leading and trailing trivia on the node.
*/
/* @internal */
export function suppressLeadingAndTrailingTrivia(node: Node) {
suppressLeadingTrivia(node);
suppressTrailingTrivia(node);
Expand All @@ -1760,15 +1757,13 @@ namespace ts {
/**
* Sets EmitFlags to suppress leading trivia on the node.
*/
/* @internal */
export function suppressLeadingTrivia(node: Node) {
addEmitFlagsRecursively(node, EmitFlags.NoLeadingComments, getFirstChild);
}

/**
* Sets EmitFlags to suppress trailing trivia on the node.
*/
/* @internal */
export function suppressTrailingTrivia(node: Node) {
addEmitFlagsRecursively(node, EmitFlags.NoTrailingComments, getLastChild);
}
Expand All @@ -1783,7 +1778,6 @@ namespace ts {
return node.forEachChild(child => child);
}

/* @internal */
export function getUniqueName(baseName: string, sourceFile: SourceFile): string {
let nameText = baseName;
for (let i = 1; !isFileLevelUniqueName(sourceFile, nameText); i++) {
Expand All @@ -1797,7 +1791,6 @@ namespace ts {
* to be on the reference, rather than the declaration, because it's closer to where the
* user was before extracting it.
*/
/* @internal */
export function getRenameLocation(edits: ReadonlyArray<FileTextChanges>, renameFilename: string, name: string, preferLastLocation: boolean): number {
let delta = 0;
let lastPos = -1;
Expand Down