Skip to content

Commit

Permalink
Direct import Debug in critical areas
Browse files Browse the repository at this point in the history
  • Loading branch information
jakebailey committed Jan 17, 2023
1 parent edd16a7 commit 59d1a30
Show file tree
Hide file tree
Showing 130 changed files with 142 additions and 144 deletions.
2 changes: 1 addition & 1 deletion src/compiler/binder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ import {
createFileDiagnostic,
createQueue,
createSymbolTable,
Debug,
Declaration,
declarationNameToString,
DeleteExpression,
Expand Down Expand Up @@ -312,6 +311,7 @@ import {
WithStatement,
} from "./_namespaces/ts";
import * as performance from "./_namespaces/ts.performance";
import * as Debug from "./debug";

/** @internal */
export const enum ModuleInstanceState {
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import {
createGetCanonicalFileName,
createProgram,
CustomTransformers,
Debug,
Diagnostic,
DiagnosticCategory,
DiagnosticMessageChain,
Expand Down Expand Up @@ -80,6 +79,7 @@ import {
WriteFileCallback,
WriteFileCallbackData,
} from "./_namespaces/ts";
import * as Debug from "./debug";

/** @internal */
export interface ReusableDiagnostic extends ReusableDiagnosticRelatedInformation {
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/builderState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
CancellationToken,
computeSignatureWithDiagnostics,
CustomTransformers,
Debug,
EmitOutput,
emptyArray,
ExportedModulesFromDeclarationEmit,
Expand Down Expand Up @@ -33,6 +32,7 @@ import {
toPath,
TypeChecker,
} from "./_namespaces/ts";
import * as Debug from "./debug";

/** @internal */
export function getFileEmitOutput(program: Program, sourceFile: SourceFile, emitOnlyDtsFiles: boolean,
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ import {
createSymbolTable,
createTextWriter,
createUnderscoreEscapedMultiMap,
Debug,
Declaration,
DeclarationName,
declarationNameToString,
Expand Down Expand Up @@ -1040,6 +1039,7 @@ import {
} from "./_namespaces/ts";
import * as performance from "./_namespaces/ts.performance";
import * as moduleSpecifiers from "./_namespaces/ts.moduleSpecifiers";
import * as Debug from "./debug";

const ambientModuleSymbolRegex = /^".+"$/;
const anon = "(anonymous)" as __String & string;
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/commandLineParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import {
createCompilerDiagnostic,
createDiagnosticForNodeInSourceFile,
createGetCanonicalFileName,
Debug,
Diagnostic,
DiagnosticMessage,
Diagnostics,
Expand Down Expand Up @@ -120,6 +119,7 @@ import {
WatchFileKind,
WatchOptions,
} from "./_namespaces/ts";
import * as Debug from "./debug";

/** @internal */
export const compileOnSaveCommandLineOption: CommandLineOption = {
Expand Down
3 changes: 1 addition & 2 deletions src/compiler/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
CharacterCodes,
Comparer,
Comparison,
Debug,
EqualityComparer,
isWhiteSpaceLike,
MapLike,
Expand All @@ -14,7 +13,7 @@ import {
TextSpan,
UnderscoreEscapedMap,
} from "./_namespaces/ts";

import * as Debug from "./debug";

/** @internal */
export const emptyArray: never[] = [] as never[];
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/emitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ import {
createSourceMapGenerator,
createTextWriter,
CustomTransformers,
Debug,
DebuggerStatement,
DeclarationName,
Decorator,
Expand Down Expand Up @@ -449,6 +448,7 @@ import {
YieldExpression,
} from "./_namespaces/ts";
import * as performance from "./_namespaces/ts.performance";
import * as Debug from "./debug";

const brackets = createBracketsMap();

Expand Down
2 changes: 1 addition & 1 deletion src/compiler/factory/emitHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
compareValues,
Comparison,
createExpressionFromEntityName,
Debug,
EmitFlags,
EmitHelper,
EmitHelperUniqueNameCallback,
Expand All @@ -33,6 +32,7 @@ import {
TransformationContext,
UnscopedEmitHelper,
} from "../_namespaces/ts";
import * as Debug from "../debug";

/** @internal */
export interface EmitHelperFactory {
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/factory/emitNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
append,
appendIfUnique,
AutoGenerateInfo,
Debug,
EmitFlags,
EmitHelper,
EmitNode,
Expand All @@ -26,6 +25,7 @@ import {
TypeNode,
TypeParameterDeclaration,
} from "../_namespaces/ts";
import * as Debug from "../debug";

/**
* Associates a node with the current transformation, initializing
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/factory/nodeConverters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
Block,
cast,
ConciseBody,
Debug,
Expression,
FunctionDeclaration,
getStartsOnNewLine,
Expand All @@ -32,6 +31,7 @@ import {
setTextRange,
SyntaxKind,
} from "../_namespaces/ts";
import * as Debug from "../debug";

/** @internal */
export function createNodeConverters(factory: NodeFactory): NodeConverters {
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/factory/nodeFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ import {
createNodeConverters,
createParenthesizerRules,
createScanner,
Debug,
DebuggerStatement,
Declaration,
DeclarationName,
Expand Down Expand Up @@ -471,6 +470,7 @@ import {
WithStatement,
YieldExpression,
} from "../_namespaces/ts";
import * as Debug from "../debug";

let nextAutoGenerateId = 0;

Expand Down
2 changes: 1 addition & 1 deletion src/compiler/factory/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import {
CommaListExpression,
compareStringsCaseSensitive,
CompilerOptions,
Debug,
Declaration,
EmitFlags,
EmitHelperFactory,
Expand Down Expand Up @@ -167,6 +166,7 @@ import {
TypeNode,
TypeParameterDeclaration,
} from "../_namespaces/ts";
import * as Debug from "../debug";

// Compound nodes

Expand Down
2 changes: 1 addition & 1 deletion src/compiler/moduleNameResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
contains,
containsPath,
createCompilerDiagnostic,
Debug,
deduplicate,
Diagnostic,
DiagnosticMessage,
Expand Down Expand Up @@ -108,6 +107,7 @@ import {
versionMajorMinor,
VersionRange,
} from "./_namespaces/ts";
import * as Debug from "./debug";

/** @internal */
export function trace(host: ModuleResolutionHost, message: DiagnosticMessage, ...args: any[]): void;
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/moduleSpecifiers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
containsIgnoredPath,
containsPath,
createGetCanonicalFileName,
Debug,
directorySeparator,
emptyArray,
endsWith,
Expand Down Expand Up @@ -107,6 +106,7 @@ import {
TypeChecker,
UserPreferences,
} from "./_namespaces/ts";
import * as Debug from "./debug";

// Used by importFixes, getEditsForFileRename, and declaration emit to synthesize import module specifiers.

Expand Down
2 changes: 1 addition & 1 deletion src/compiler/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ import {
createScanner,
createTextChangeRange,
createTextSpanFromBounds,
Debug,
Decorator,
DefaultClause,
DeleteExpression,
Expand Down Expand Up @@ -389,6 +388,7 @@ import {
YieldExpression,
} from "./_namespaces/ts";
import * as performance from "./_namespaces/ts.performance";
import * as Debug from "./debug";

const enum SignatureFlags {
None = 0,
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
compareStringsCaseSensitive,
compareValues,
Comparison,
Debug,
endsWith,
equateStringsCaseInsensitive,
equateStringsCaseSensitive,
Expand All @@ -17,6 +16,7 @@ import {
startsWith,
stringContains,
} from "./_namespaces/ts";
import * as Debug from "./debug";

/**
* Internally, we represent paths as strings with '/' as the directory separator.
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/performance.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {
Debug,
noop,
Performance,
PerformanceHooks,
Expand All @@ -8,6 +7,7 @@ import {
timestamp,
tryGetNativePerformanceHooks,
} from "./_namespaces/ts";
import * as Debug from "./debug";

/** Performance measurements for the compiler. */

Expand Down
2 changes: 1 addition & 1 deletion src/compiler/program.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ import {
createTypeChecker,
createTypeReferenceDirectiveResolutionCache,
CustomTransformers,
Debug,
DeclarationWithTypeParameterChildren,
DeprecationVersion,
Diagnostic,
Expand Down Expand Up @@ -316,6 +315,7 @@ import {
zipToModeAwareCache,
} from "./_namespaces/ts";
import * as performance from "./_namespaces/ts.performance";
import * as Debug from "./debug";

export function findConfigFile(searchPath: string, fileExists: (fileName: string) => boolean, configName = "tsconfig.json"): string | undefined {
return forEachAncestorDirectory(searchPath, ancestor => {
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/resolutionCache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
createMultiMap,
createTypeReferenceDirectiveResolutionCache,
createTypeReferenceResolutionLoader,
Debug,
Diagnostics,
directorySeparator,
DirectoryWatcherCallback,
Expand Down Expand Up @@ -73,6 +72,7 @@ import {
updateResolutionField,
WatchDirectoryFlags,
} from "./_namespaces/ts";
import * as Debug from "./debug";

/**
* This is the cache of module/typedirectives resolution that can be retained across program
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/scanner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
CommentKind,
CommentRange,
compareValues,
Debug,
DiagnosticMessage,
Diagnostics,
identity,
Expand All @@ -26,6 +25,7 @@ import {
TokenFlags,
trimStringStart,
} from "./_namespaces/ts";
import * as Debug from "./debug";

export type ErrorCallback = (message: DiagnosticMessage, length: number) => void;

Expand Down
4 changes: 2 additions & 2 deletions src/compiler/semver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import {
compareStringsCaseSensitive,
compareValues,
Comparison,
Debug,
emptyArray,
every,
isArray,
map,
some,
trimString,
} from "./_namespaces/ts";
import * as Debug from "./debug";

// https://semver.org/#spec-item-2
// > A normal version number MUST take the form X.Y.Z where X, Y, and Z are non-negative
Expand Down Expand Up @@ -427,4 +427,4 @@ function formatAlternative(comparators: readonly Comparator[]) {

function formatComparator(comparator: Comparator) {
return `${comparator.operator}${comparator.operand}`;
}
}
2 changes: 1 addition & 1 deletion src/compiler/sourcemap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
CharacterCodes,
combinePaths,
compareValues,
Debug,
DocumentPosition,
DocumentPositionMapper,
DocumentPositionMapperHost,
Expand All @@ -27,6 +26,7 @@ import {
trimStringEnd,
} from "./_namespaces/ts";
import * as performance from "./_namespaces/ts.performance";
import * as Debug from "./debug";

/** @internal */
export interface SourceMapGeneratorOptions {
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/sys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
containsPath,
createGetCanonicalFileName,
createMultiMap,
Debug,
directorySeparator,
emptyArray,
emptyFileSystemEntries,
Expand Down Expand Up @@ -47,6 +46,7 @@ import {
WatchOptions,
writeFileEnsuringDirectories,
} from "./_namespaces/ts";
import * as Debug from "./debug";

declare function setTimeout(handler: (...args: any[]) => void, timeout: number): any;
declare function clearTimeout(handle: any): void;
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/tracing.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {
combinePaths,
ConditionalType,
Debug,
EvolvingArrayType,
getLineAndCharacterOfPosition,
getSourceFileOfNode,
Expand All @@ -22,6 +21,7 @@ import {
UnionType,
} from "./_namespaces/ts";
import * as performance from "./_namespaces/ts.performance";
import * as Debug from "./debug";

/* Tracing events for the compiler. */

Expand Down
Loading

0 comments on commit 59d1a30

Please sign in to comment.