diff --git a/scripts/processDiagnosticMessages.ts b/scripts/processDiagnosticMessages.ts index 9cfde5b2964..0a81b993616 100644 --- a/scripts/processDiagnosticMessages.ts +++ b/scripts/processDiagnosticMessages.ts @@ -55,7 +55,7 @@ function buildInfoFileOutput(messageTable: InputDiagnosticMessageTable, nameMap: '// \r\n' + '/// \r\n' + '/* @internal */\r\n' + - 'module ts {\r\n' + + 'namespace ts {\r\n' + ' export var Diagnostics = {\r\n'; var names = Utilities.getObjectKeys(messageTable); for (var i = 0; i < names.length; i++) { diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index d411b840dce..ab391639d0c 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -1,7 +1,7 @@ /// /* @internal */ -module ts { +namespace ts { export let bindTime = 0; export const enum ModuleInstanceState { diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index c0c11bce5a8..407651c6846 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -1,7 +1,7 @@ /// /* @internal */ -module ts { +namespace ts { let nextSymbolId = 1; let nextNodeId = 1; let nextMergeId = 1; diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index a3065bd7a4b..07bccf4a5ef 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -3,7 +3,7 @@ /// /// -module ts { +namespace ts { /* @internal */ export var optionDeclarations: CommandLineOption[] = [ { diff --git a/src/compiler/core.ts b/src/compiler/core.ts index dde1e3d6b57..0c0414f3b12 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -1,7 +1,7 @@ /// /* @internal */ -module ts { +namespace ts { // Ternary values are defined such that // x & y is False if either x or y is False. // x & y is Maybe if either x or y is Maybe, but neither x or y is False. diff --git a/src/compiler/declarationEmitter.ts b/src/compiler/declarationEmitter.ts index 5c705f18190..a2edc632de3 100644 --- a/src/compiler/declarationEmitter.ts +++ b/src/compiler/declarationEmitter.ts @@ -1,7 +1,7 @@ /// /* @internal */ -module ts { +namespace ts { interface ModuleElementDeclarationEmitInfo { node: Node; outputPos: number; diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts index 9f6190ead11..43330935f4f 100644 --- a/src/compiler/diagnosticInformationMap.generated.ts +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -1,7 +1,7 @@ // /// /* @internal */ -module ts { +namespace ts { export var Diagnostics = { Unterminated_string_literal: { code: 1002, category: DiagnosticCategory.Error, key: "Unterminated string literal." }, Identifier_expected: { code: 1003, category: DiagnosticCategory.Error, key: "Identifier expected." }, diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index df40d10ddf1..8081668f98c 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -2,7 +2,7 @@ /// /* @internal */ -module ts { +namespace ts { export function isExternalModuleOrDeclarationFile(sourceFile: SourceFile) { return isExternalModule(sourceFile) || isDeclarationFile(sourceFile); } diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 627893d59eb..f964febaf5d 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -1,7 +1,7 @@ /// /// -module ts { +namespace ts { let nodeConstructors = new Array Node>(SyntaxKind.Count); /* @internal */ export let parseTime = 0; diff --git a/src/compiler/program.ts b/src/compiler/program.ts index c09b70a0c6d..aa8a413aaa9 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -1,7 +1,7 @@ /// /// -module ts { +namespace ts { /* @internal */ export let programTime = 0; /* @internal */ export let emitTime = 0; /* @internal */ export let ioReadTime = 0; diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts index d7e65dff81c..fd8883045fe 100644 --- a/src/compiler/scanner.ts +++ b/src/compiler/scanner.ts @@ -1,7 +1,7 @@ /// /// -module ts { +namespace ts { export interface ErrorCallback { (message: DiagnosticMessage, length: number): void; } diff --git a/src/compiler/sys.ts b/src/compiler/sys.ts index 75e8af357bb..a47d6959ba8 100644 --- a/src/compiler/sys.ts +++ b/src/compiler/sys.ts @@ -1,6 +1,6 @@ /// -module ts { +namespace ts { export interface System { args: string[]; newLine: string; diff --git a/src/compiler/tsc.ts b/src/compiler/tsc.ts index 15cc665e351..2903c3a31f4 100644 --- a/src/compiler/tsc.ts +++ b/src/compiler/tsc.ts @@ -1,7 +1,7 @@ /// /// -module ts { +namespace ts { export interface SourceFile { fileWatcher: FileWatcher; } diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 70962ea13c8..cf7a6dff2d1 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -1,4 +1,4 @@ -module ts { +namespace ts { export interface Map { [index: string]: T; } diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 6c0943f22fd..1aad9d5b06b 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -1,7 +1,7 @@ /// /* @internal */ -module ts { +namespace ts { export interface ReferencePathMatchResult { fileReference?: FileReference diagnosticMessage?: DiagnosticMessage @@ -2002,7 +2002,7 @@ module ts { } } -module ts { +namespace ts { export function getDefaultLibFileName(options: CompilerOptions): string { return options.target === ScriptTarget.ES6 ? "lib.es6.d.ts" : "lib.d.ts"; } diff --git a/src/server/client.ts b/src/server/client.ts index f1c5e424d47..3546f8339ee 100644 --- a/src/server/client.ts +++ b/src/server/client.ts @@ -1,6 +1,6 @@ /// -module ts.server { +namespace ts.server { export interface SessionClientHost extends LanguageServiceHost { writeMessage(message: string): void; diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index bc9e685825c..9e235e2cc7d 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -4,7 +4,7 @@ /// /// -module ts.server { +namespace ts.server { export interface Logger { close(): void; isVerbose(): boolean; diff --git a/src/server/protocol.d.ts b/src/server/protocol.d.ts index ef9ad7984f6..336bc11c9f3 100644 --- a/src/server/protocol.d.ts +++ b/src/server/protocol.d.ts @@ -1,7 +1,7 @@ /** * Declaration module describing the TypeScript Server protocol */ -declare module ts.server.protocol { +declare namespace ts.server.protocol { /** * A TypeScript Server message */ diff --git a/src/server/server.ts b/src/server/server.ts index 828deca2b2d..b4b35edd3f3 100644 --- a/src/server/server.ts +++ b/src/server/server.ts @@ -1,7 +1,7 @@ /// /// -module ts.server { +namespace ts.server { var nodeproto: typeof NodeJS._debugger = require('_debugger'); var readline: NodeJS.ReadLine = require('readline'); var path: NodeJS.Path = require('path'); diff --git a/src/server/session.ts b/src/server/session.ts index a4cb3e59b4e..f9cfb4f9f7d 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -4,7 +4,7 @@ /// /// -module ts.server { +namespace ts.server { var spaceCache:string[] = []; interface StackTraceError extends Error { diff --git a/src/services/breakpoints.ts b/src/services/breakpoints.ts index 41079c08201..4d3d7d331a5 100644 --- a/src/services/breakpoints.ts +++ b/src/services/breakpoints.ts @@ -4,7 +4,7 @@ /// /* @internal */ -module ts.BreakpointResolver { +namespace ts.BreakpointResolver { /** * Get the breakpoint span in given sourceFile */ diff --git a/src/services/formatting/formatting.ts b/src/services/formatting/formatting.ts index ef25d23a5c9..011f7d7fa5e 100644 --- a/src/services/formatting/formatting.ts +++ b/src/services/formatting/formatting.ts @@ -4,7 +4,7 @@ /// /* @internal */ -module ts.formatting { +namespace ts.formatting { export interface TextRangeWithKind extends TextRange { kind: SyntaxKind; diff --git a/src/services/formatting/formattingContext.ts b/src/services/formatting/formattingContext.ts index 84c09b86bb9..c9b9952a49e 100644 --- a/src/services/formatting/formattingContext.ts +++ b/src/services/formatting/formattingContext.ts @@ -1,7 +1,7 @@ /// /* @internal */ -module ts.formatting { +namespace ts.formatting { export class FormattingContext { public currentTokenSpan: TextRangeWithKind; public nextTokenSpan: TextRangeWithKind; diff --git a/src/services/formatting/formattingRequestKind.ts b/src/services/formatting/formattingRequestKind.ts index 4bdc83ffd45..d0397e4a8d9 100644 --- a/src/services/formatting/formattingRequestKind.ts +++ b/src/services/formatting/formattingRequestKind.ts @@ -1,7 +1,7 @@ /// /* @internal */ -module ts.formatting { +namespace ts.formatting { export const enum FormattingRequestKind { FormatDocument, FormatSelection, diff --git a/src/services/formatting/formattingScanner.ts b/src/services/formatting/formattingScanner.ts index 0d4dd8eacde..7e77878051c 100644 --- a/src/services/formatting/formattingScanner.ts +++ b/src/services/formatting/formattingScanner.ts @@ -2,7 +2,7 @@ /// /* @internal */ -module ts.formatting { +namespace ts.formatting { let scanner = createScanner(ScriptTarget.Latest, /*skipTrivia*/ false); export interface FormattingScanner { diff --git a/src/services/formatting/rule.ts b/src/services/formatting/rule.ts index f1bb39e69c2..543295f364f 100644 --- a/src/services/formatting/rule.ts +++ b/src/services/formatting/rule.ts @@ -1,7 +1,7 @@ /// /* @internal */ -module ts.formatting { +namespace ts.formatting { export class Rule { constructor( public Descriptor: RuleDescriptor, diff --git a/src/services/formatting/ruleAction.ts b/src/services/formatting/ruleAction.ts index e5734b1a03c..13e9043e1c6 100644 --- a/src/services/formatting/ruleAction.ts +++ b/src/services/formatting/ruleAction.ts @@ -1,7 +1,7 @@ /// /* @internal */ -module ts.formatting { +namespace ts.formatting { export const enum RuleAction { Ignore = 0x00000001, Space = 0x00000002, diff --git a/src/services/formatting/ruleDescriptor.ts b/src/services/formatting/ruleDescriptor.ts index f3492715f3a..96506adc3dc 100644 --- a/src/services/formatting/ruleDescriptor.ts +++ b/src/services/formatting/ruleDescriptor.ts @@ -1,7 +1,7 @@ /// /* @internal */ -module ts.formatting { +namespace ts.formatting { export class RuleDescriptor { constructor(public LeftTokenRange: Shared.TokenRange, public RightTokenRange: Shared.TokenRange) { } diff --git a/src/services/formatting/ruleFlag.ts b/src/services/formatting/ruleFlag.ts index 4e6e002c184..7619f232ad4 100644 --- a/src/services/formatting/ruleFlag.ts +++ b/src/services/formatting/ruleFlag.ts @@ -2,7 +2,7 @@ /* @internal */ -module ts.formatting { +namespace ts.formatting { export const enum RuleFlags { None, CanDeleteNewLines diff --git a/src/services/formatting/ruleOperation.ts b/src/services/formatting/ruleOperation.ts index 1cca437e491..e897513bd27 100644 --- a/src/services/formatting/ruleOperation.ts +++ b/src/services/formatting/ruleOperation.ts @@ -1,7 +1,7 @@ /// /* @internal */ -module ts.formatting { +namespace ts.formatting { export class RuleOperation { public Context: RuleOperationContext; public Action: RuleAction; diff --git a/src/services/formatting/ruleOperationContext.ts b/src/services/formatting/ruleOperationContext.ts index 69ed3453a75..515250d7264 100644 --- a/src/services/formatting/ruleOperationContext.ts +++ b/src/services/formatting/ruleOperationContext.ts @@ -1,7 +1,7 @@ /// /* @internal */ -module ts.formatting { +namespace ts.formatting { export class RuleOperationContext { private customContextChecks: { (context: FormattingContext): boolean; }[]; diff --git a/src/services/formatting/rules.ts b/src/services/formatting/rules.ts index 3352253a86c..c10e3ee69ea 100644 --- a/src/services/formatting/rules.ts +++ b/src/services/formatting/rules.ts @@ -1,7 +1,7 @@ /// /* @internal */ -module ts.formatting { +namespace ts.formatting { export class Rules { public getRuleName(rule: Rule) { let o: ts.Map = this; diff --git a/src/services/formatting/rulesMap.ts b/src/services/formatting/rulesMap.ts index 5aae6f40fcd..4f231bd842e 100644 --- a/src/services/formatting/rulesMap.ts +++ b/src/services/formatting/rulesMap.ts @@ -1,7 +1,7 @@ /// /* @internal */ -module ts.formatting { +namespace ts.formatting { export class RulesMap { public map: RulesBucket[]; public mapRowLength: number; diff --git a/src/services/formatting/rulesProvider.ts b/src/services/formatting/rulesProvider.ts index 0867bcf31c0..bd8f4fc3a5e 100644 --- a/src/services/formatting/rulesProvider.ts +++ b/src/services/formatting/rulesProvider.ts @@ -1,7 +1,7 @@ /// /* @internal */ -module ts.formatting { +namespace ts.formatting { export class RulesProvider { private globalRules: Rules; private options: ts.FormatCodeOptions; diff --git a/src/services/formatting/smartIndenter.ts b/src/services/formatting/smartIndenter.ts index 9cd28a40a54..a82e57f050f 100644 --- a/src/services/formatting/smartIndenter.ts +++ b/src/services/formatting/smartIndenter.ts @@ -1,7 +1,7 @@ /// /* @internal */ -module ts.formatting { +namespace ts.formatting { export module SmartIndenter { const enum Value { diff --git a/src/services/formatting/tokenRange.ts b/src/services/formatting/tokenRange.ts index 59a376f15f9..27a43280f2c 100644 --- a/src/services/formatting/tokenRange.ts +++ b/src/services/formatting/tokenRange.ts @@ -1,7 +1,7 @@ /// /* @internal */ -module ts.formatting { +namespace ts.formatting { export module Shared { export interface ITokenAccess { GetTokens(): SyntaxKind[]; diff --git a/src/services/navigateTo.ts b/src/services/navigateTo.ts index aec3bdf765f..a4cc7ec2ad5 100644 --- a/src/services/navigateTo.ts +++ b/src/services/navigateTo.ts @@ -1,5 +1,5 @@ /* @internal */ -module ts.NavigateTo { +namespace ts.NavigateTo { type RawNavigateToItem = { name: string; fileName: string; matchKind: PatternMatchKind; isCaseSensitive: boolean; declaration: Declaration }; export function getNavigateToItems(program: Program, cancellationToken: CancellationTokenObject, searchValue: string, maxResultCount: number): NavigateToItem[] { diff --git a/src/services/navigationBar.ts b/src/services/navigationBar.ts index 8acdbac20c5..ead9bc519ce 100644 --- a/src/services/navigationBar.ts +++ b/src/services/navigationBar.ts @@ -1,7 +1,7 @@ /// /* @internal */ -module ts.NavigationBar { +namespace ts.NavigationBar { export function getNavigationBarItems(sourceFile: SourceFile): ts.NavigationBarItem[] { // If the source file has any child items, then it included in the tree // and takes lexical ownership of all other top-level items. diff --git a/src/services/outliningElementsCollector.ts b/src/services/outliningElementsCollector.ts index d413f611209..08b089cd75e 100644 --- a/src/services/outliningElementsCollector.ts +++ b/src/services/outliningElementsCollector.ts @@ -1,5 +1,5 @@ /* @internal */ -module ts { +namespace ts { export module OutliningElementsCollector { export function collectElements(sourceFile: SourceFile): OutliningSpan[] { let elements: OutliningSpan[] = []; diff --git a/src/services/patternMatcher.ts b/src/services/patternMatcher.ts index 88cd9fdbb0f..d56c7fac975 100644 --- a/src/services/patternMatcher.ts +++ b/src/services/patternMatcher.ts @@ -1,5 +1,5 @@ /* @internal */ -module ts { +namespace ts { // Note(cyrusn): this enum is ordered from strongest match type to weakest match type. export enum PatternMatchKind { exact, diff --git a/src/services/services.ts b/src/services/services.ts index 5e8392fa9de..105859f7ccf 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -10,7 +10,7 @@ /// /// -module ts { +namespace ts { /** The version of the language service API */ export let servicesVersion = "0.4" diff --git a/src/services/shims.ts b/src/services/shims.ts index 004393fb3b5..c158b041e97 100644 --- a/src/services/shims.ts +++ b/src/services/shims.ts @@ -19,7 +19,7 @@ var debugObjectHost = (this); /* @internal */ -module ts { +namespace ts { export interface ScriptSnapshotShim { /** Gets a portion of the script snapshot specified by [start, end). */ getText(start: number, end: number): string; diff --git a/src/services/signatureHelp.ts b/src/services/signatureHelp.ts index 77aba4c85c1..fce4e2c3025 100644 --- a/src/services/signatureHelp.ts +++ b/src/services/signatureHelp.ts @@ -1,6 +1,6 @@ /// /* @internal */ -module ts.SignatureHelp { +namespace ts.SignatureHelp { // A partially written generic type expression is not guaranteed to have the correct syntax tree. the expression could be parsed as less than/greater than expression or a comma expression // or some other combination depending on what the user has typed so far. For the purposes of signature help we need to consider any location after "<" as a possible generic type reference. diff --git a/src/services/utilities.ts b/src/services/utilities.ts index da0a0aa96c1..73b88a3df26 100644 --- a/src/services/utilities.ts +++ b/src/services/utilities.ts @@ -1,6 +1,6 @@ // These utilities are common to multiple language service features. /* @internal */ -module ts { +namespace ts { export interface ListItemInfo { listItemIndex: number; list: Node; @@ -502,7 +502,7 @@ module ts { // Display-part writer helpers /* @internal */ -module ts { +namespace ts { export function isFirstDeclarationOfSymbolParameter(symbol: Symbol) { return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === SyntaxKind.Parameter; }