Merge pull request #3491 from Microsoft/useNamespaces
use namespaces instead of modules in the codebase
This commit is contained in:
commit
e6753834ad
44 changed files with 46 additions and 46 deletions
|
@ -55,7 +55,7 @@ function buildInfoFileOutput(messageTable: InputDiagnosticMessageTable, nameMap:
|
|||
'// <auto-generated />\r\n' +
|
||||
'/// <reference path="types.ts" />\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++) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/// <reference path="parser.ts"/>
|
||||
|
||||
/* @internal */
|
||||
module ts {
|
||||
namespace ts {
|
||||
export let bindTime = 0;
|
||||
|
||||
export const enum ModuleInstanceState {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/// <reference path="binder.ts"/>
|
||||
|
||||
/* @internal */
|
||||
module ts {
|
||||
namespace ts {
|
||||
let nextSymbolId = 1;
|
||||
let nextNodeId = 1;
|
||||
let nextMergeId = 1;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
/// <reference path="core.ts"/>
|
||||
/// <reference path="scanner.ts"/>
|
||||
|
||||
module ts {
|
||||
namespace ts {
|
||||
/* @internal */
|
||||
export var optionDeclarations: CommandLineOption[] = [
|
||||
{
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/// <reference path="types.ts"/>
|
||||
|
||||
/* @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.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/// <reference path="checker.ts"/>
|
||||
|
||||
/* @internal */
|
||||
module ts {
|
||||
namespace ts {
|
||||
interface ModuleElementDeclarationEmitInfo {
|
||||
node: Node;
|
||||
outputPos: number;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// <auto-generated />
|
||||
/// <reference path="types.ts" />
|
||||
/* @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." },
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
/// <reference path="declarationEmitter.ts"/>
|
||||
|
||||
/* @internal */
|
||||
module ts {
|
||||
namespace ts {
|
||||
export function isExternalModuleOrDeclarationFile(sourceFile: SourceFile) {
|
||||
return isExternalModule(sourceFile) || isDeclarationFile(sourceFile);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/// <reference path="scanner.ts"/>
|
||||
/// <reference path="utilities.ts"/>
|
||||
|
||||
module ts {
|
||||
namespace ts {
|
||||
let nodeConstructors = new Array<new () => Node>(SyntaxKind.Count);
|
||||
/* @internal */ export let parseTime = 0;
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/// <reference path="sys.ts" />
|
||||
/// <reference path="emitter.ts" />
|
||||
|
||||
module ts {
|
||||
namespace ts {
|
||||
/* @internal */ export let programTime = 0;
|
||||
/* @internal */ export let emitTime = 0;
|
||||
/* @internal */ export let ioReadTime = 0;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/// <reference path="core.ts"/>
|
||||
/// <reference path="diagnosticInformationMap.generated.ts"/>
|
||||
|
||||
module ts {
|
||||
namespace ts {
|
||||
export interface ErrorCallback {
|
||||
(message: DiagnosticMessage, length: number): void;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/// <reference path="core.ts"/>
|
||||
|
||||
module ts {
|
||||
namespace ts {
|
||||
export interface System {
|
||||
args: string[];
|
||||
newLine: string;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/// <reference path="program.ts"/>
|
||||
/// <reference path="commandLineParser.ts"/>
|
||||
|
||||
module ts {
|
||||
namespace ts {
|
||||
export interface SourceFile {
|
||||
fileWatcher: FileWatcher;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module ts {
|
||||
namespace ts {
|
||||
export interface Map<T> {
|
||||
[index: string]: T;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/// <reference path="binder.ts" />
|
||||
|
||||
/* @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";
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/// <reference path="session.ts" />
|
||||
|
||||
module ts.server {
|
||||
namespace ts.server {
|
||||
|
||||
export interface SessionClientHost extends LanguageServiceHost {
|
||||
writeMessage(message: string): void;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/// <reference path="session.ts" />
|
||||
/// <reference path="node.d.ts" />
|
||||
|
||||
module ts.server {
|
||||
namespace ts.server {
|
||||
export interface Logger {
|
||||
close(): void;
|
||||
isVerbose(): boolean;
|
||||
|
|
2
src/server/protocol.d.ts
vendored
2
src/server/protocol.d.ts
vendored
|
@ -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
|
||||
*/
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/// <reference path="node.d.ts" />
|
||||
/// <reference path="session.ts" />
|
||||
|
||||
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');
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/// <reference path="protocol.d.ts" />
|
||||
/// <reference path="editorServices.ts" />
|
||||
|
||||
module ts.server {
|
||||
namespace ts.server {
|
||||
var spaceCache:string[] = [];
|
||||
|
||||
interface StackTraceError extends Error {
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/// <reference path='services.ts' />
|
||||
|
||||
/* @internal */
|
||||
module ts.BreakpointResolver {
|
||||
namespace ts.BreakpointResolver {
|
||||
/**
|
||||
* Get the breakpoint span in given sourceFile
|
||||
*/
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
///<reference path='references.ts' />
|
||||
|
||||
/* @internal */
|
||||
module ts.formatting {
|
||||
namespace ts.formatting {
|
||||
|
||||
export interface TextRangeWithKind extends TextRange {
|
||||
kind: SyntaxKind;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/// <reference path="references.ts"/>
|
||||
|
||||
/* @internal */
|
||||
module ts.formatting {
|
||||
namespace ts.formatting {
|
||||
export class FormattingContext {
|
||||
public currentTokenSpan: TextRangeWithKind;
|
||||
public nextTokenSpan: TextRangeWithKind;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/// <reference path="references.ts"/>
|
||||
|
||||
/* @internal */
|
||||
module ts.formatting {
|
||||
namespace ts.formatting {
|
||||
export const enum FormattingRequestKind {
|
||||
FormatDocument,
|
||||
FormatSelection,
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
/// <reference path="..\..\compiler\scanner.ts"/>
|
||||
|
||||
/* @internal */
|
||||
module ts.formatting {
|
||||
namespace ts.formatting {
|
||||
let scanner = createScanner(ScriptTarget.Latest, /*skipTrivia*/ false);
|
||||
|
||||
export interface FormattingScanner {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
///<reference path='references.ts' />
|
||||
|
||||
/* @internal */
|
||||
module ts.formatting {
|
||||
namespace ts.formatting {
|
||||
export class Rule {
|
||||
constructor(
|
||||
public Descriptor: RuleDescriptor,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
///<reference path='references.ts' />
|
||||
|
||||
/* @internal */
|
||||
module ts.formatting {
|
||||
namespace ts.formatting {
|
||||
export const enum RuleAction {
|
||||
Ignore = 0x00000001,
|
||||
Space = 0x00000002,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
///<reference path='references.ts' />
|
||||
|
||||
/* @internal */
|
||||
module ts.formatting {
|
||||
namespace ts.formatting {
|
||||
export class RuleDescriptor {
|
||||
constructor(public LeftTokenRange: Shared.TokenRange, public RightTokenRange: Shared.TokenRange) {
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
|
||||
/* @internal */
|
||||
module ts.formatting {
|
||||
namespace ts.formatting {
|
||||
export const enum RuleFlags {
|
||||
None,
|
||||
CanDeleteNewLines
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
///<reference path='references.ts' />
|
||||
|
||||
/* @internal */
|
||||
module ts.formatting {
|
||||
namespace ts.formatting {
|
||||
export class RuleOperation {
|
||||
public Context: RuleOperationContext;
|
||||
public Action: RuleAction;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
///<reference path='references.ts' />
|
||||
|
||||
/* @internal */
|
||||
module ts.formatting {
|
||||
namespace ts.formatting {
|
||||
|
||||
export class RuleOperationContext {
|
||||
private customContextChecks: { (context: FormattingContext): boolean; }[];
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
///<reference path='references.ts' />
|
||||
|
||||
/* @internal */
|
||||
module ts.formatting {
|
||||
namespace ts.formatting {
|
||||
export class Rules {
|
||||
public getRuleName(rule: Rule) {
|
||||
let o: ts.Map<any> = <any>this;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
///<reference path='references.ts' />
|
||||
|
||||
/* @internal */
|
||||
module ts.formatting {
|
||||
namespace ts.formatting {
|
||||
export class RulesMap {
|
||||
public map: RulesBucket[];
|
||||
public mapRowLength: number;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/// <reference path="references.ts"/>
|
||||
|
||||
/* @internal */
|
||||
module ts.formatting {
|
||||
namespace ts.formatting {
|
||||
export class RulesProvider {
|
||||
private globalRules: Rules;
|
||||
private options: ts.FormatCodeOptions;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
///<reference path='..\services.ts' />
|
||||
|
||||
/* @internal */
|
||||
module ts.formatting {
|
||||
namespace ts.formatting {
|
||||
export module SmartIndenter {
|
||||
|
||||
const enum Value {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
///<reference path='references.ts' />
|
||||
|
||||
/* @internal */
|
||||
module ts.formatting {
|
||||
namespace ts.formatting {
|
||||
export module Shared {
|
||||
export interface ITokenAccess {
|
||||
GetTokens(): SyntaxKind[];
|
||||
|
|
|
@ -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[] {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/// <reference path='services.ts' />
|
||||
|
||||
/* @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.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* @internal */
|
||||
module ts {
|
||||
namespace ts {
|
||||
export module OutliningElementsCollector {
|
||||
export function collectElements(sourceFile: SourceFile): OutliningSpan[] {
|
||||
let elements: OutliningSpan[] = [];
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
/// <reference path='formatting\formatting.ts' />
|
||||
/// <reference path='formatting\smartIndenter.ts' />
|
||||
|
||||
module ts {
|
||||
namespace ts {
|
||||
/** The version of the language service API */
|
||||
export let servicesVersion = "0.4"
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
var debugObjectHost = (<any>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;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
///<reference path='services.ts' />
|
||||
/* @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.
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue