diff --git a/scripts/processDiagnosticMessages.ts b/scripts/processDiagnosticMessages.ts index 9cfde5b296..0a81b99361 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 d411b840dc..ab391639d0 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 c0c11bce5a..407651c684 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 a3065bd7a4..07bccf4a5e 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 dde1e3d6b5..0c0414f3b1 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 5c705f1819..a2edc632de 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 9f6190ead1..43330935f4 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 df40d10ddf..8081668f98 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 627893d59e..f964febaf5 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 c09b70a0c6..aa8a413aaa 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 d7e65dff81..fd8883045f 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 75e8af357b..a47d6959ba 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 15cc665e35..2903c3a31f 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 70962ea13c..cf7a6dff2d 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 6c0943f22f..1aad9d5b06 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 f1c5e424d4..3546f8339e 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 bc9e685825..9e235e2cc7 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 ef9ad7984f..336bc11c9f 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 828deca2b2..b4b35edd3f 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 a4cb3e59b4..f9cfb4f9f7 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 41079c0820..4d3d7d331a 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 ef25d23a5c..011f7d7fa5 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 84c09b86bb..c9b9952a49 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 4bdc83ffd4..d0397e4a8d 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 0d4dd8eacd..7e77878051 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 f1bb39e69c..543295f364 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 e5734b1a03..13e9043e1c 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 f3492715f3..96506adc3d 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 4e6e002c18..7619f232ad 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 1cca437e49..e897513bd2 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 69ed3453a7..515250d726 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 3352253a86..c10e3ee69e 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 5aae6f40fc..4f231bd842 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 0867bcf31c..bd8f4fc3a5 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 9cd28a40a5..a82e57f050 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 59a376f15f..27a43280f2 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 aec3bdf765..a4cc7ec2ad 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 8acdbac20c..ead9bc519c 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 d413f61120..08b089cd75 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 88cd9fdbb0..d56c7fac97 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 5e8392fa9d..105859f7cc 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 004393fb3b..c158b041e9 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 77aba4c85c..fce4e2c302 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 da0a0aa96c..73b88a3df2 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; }