mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Remove the implementation of TypeScriptLS
This commit is contained in:
@@ -279,7 +279,7 @@ module FourSlash {
|
||||
// Create a new Services Adaptor
|
||||
this.cancellationToken = new TestCancellationToken();
|
||||
var compilationOptions = convertGlobalOptionsToCompilerOptions(this.testData.globalOptions);
|
||||
var languageServiceAdaptor = new Harness.LanguageService.ShimLanugageServiceAdaptor(this.cancellationToken, compilationOptions);
|
||||
var languageServiceAdaptor = new Harness.LanguageService.NativeLanugageServiceAdaptor(this.cancellationToken, compilationOptions);
|
||||
this.languageServiceAdaptorHost = languageServiceAdaptor.getHost();
|
||||
this.languageService = languageServiceAdaptor.getLanguageService();
|
||||
|
||||
@@ -1787,67 +1787,6 @@ module FourSlash {
|
||||
}
|
||||
}
|
||||
|
||||
public verifyTypesAgainstFullCheckAtPositions(positions: number[]) {
|
||||
this.taoInvalidReason = 'verifyTypesAgainstFullCheckAtPositions impossible';
|
||||
|
||||
// Create a from-scratch LS to check against
|
||||
var referenceLanguageServiceShimHost = new Harness.LanguageService.TypeScriptLS();
|
||||
var referenceLanguageServiceShim = referenceLanguageServiceShimHost.getLanguageService();
|
||||
var referenceLanguageService = referenceLanguageServiceShim.languageService;
|
||||
|
||||
// Add lib.d.ts to the reference language service
|
||||
referenceLanguageServiceShimHost.addDefaultLibrary();
|
||||
|
||||
for (var i = 0; i < this.testData.files.length; i++) {
|
||||
var file = this.testData.files[i];
|
||||
|
||||
var content = this.getFileContent(file.fileName);
|
||||
referenceLanguageServiceShimHost.addScript(this.testData.files[i].fileName, content);
|
||||
}
|
||||
|
||||
for (i = 0; i < positions.length; i++) {
|
||||
var nameOf = (type: ts.QuickInfo) => type ? ts.displayPartsToString(type.displayParts) : '(none)';
|
||||
|
||||
var pullName: string, refName: string;
|
||||
var anyFailed = false;
|
||||
|
||||
var errMsg = '';
|
||||
|
||||
try {
|
||||
var pullType = this.languageService.getQuickInfoAtPosition(this.activeFile.fileName, positions[i]);
|
||||
pullName = nameOf(pullType);
|
||||
} catch (err1) {
|
||||
errMsg = 'Failed to get pull type check. Exception: ' + err1 + '\r\n';
|
||||
if (err1.stack) errMsg = errMsg + err1.stack;
|
||||
pullName = '(failed)';
|
||||
anyFailed = true;
|
||||
}
|
||||
|
||||
try {
|
||||
var referenceType = referenceLanguageService.getQuickInfoAtPosition(this.activeFile.fileName, positions[i]);
|
||||
refName = nameOf(referenceType);
|
||||
} catch (err2) {
|
||||
errMsg = 'Failed to get full type check. Exception: ' + err2 + '\r\n';
|
||||
if (err2.stack) errMsg = errMsg + err2.stack;
|
||||
refName = '(failed)';
|
||||
anyFailed = true;
|
||||
}
|
||||
|
||||
var failure = anyFailed || (refName !== pullName);
|
||||
if (failure) {
|
||||
content = this.getFileContent(this.activeFile.fileName);
|
||||
var textAtPosition = content.substr(positions[i], 10);
|
||||
var positionDescription = 'Position ' + positions[i] + ' ("' + textAtPosition + '"...)';
|
||||
|
||||
if (anyFailed) {
|
||||
throw new Error('Exception thrown in language service for ' + positionDescription + '\r\n' + errMsg);
|
||||
} else if (refName !== pullName) {
|
||||
throw new Error('Pull/Full disagreement failed at ' + positionDescription + ' - expected full typecheck type "' + refName + '" to equal pull type "' + pullName + '".');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Check number of navigationItems which match both searchValue and matchKind.
|
||||
Report an error if expected value and actual value do not match.
|
||||
|
||||
@@ -436,283 +436,5 @@ module Harness.LanguageService {
|
||||
return convertResult;
|
||||
}
|
||||
}
|
||||
|
||||
export class TypeScriptLS implements ts.LanguageServiceShimHost {
|
||||
private ls: ts.LanguageServiceShim = null;
|
||||
|
||||
private fileNameToScript: ts.Map<ScriptInfo> = {};
|
||||
private settings: ts.CompilerOptions = {};
|
||||
|
||||
constructor(private cancellationToken: ts.CancellationToken = CancellationToken.None) {
|
||||
}
|
||||
|
||||
public trace(s: string) {
|
||||
}
|
||||
|
||||
public addDefaultLibrary() {
|
||||
this.addScript(Harness.Compiler.defaultLibFileName, Harness.Compiler.defaultLibSourceFile.text);
|
||||
}
|
||||
|
||||
public getHostIdentifier(): string {
|
||||
return "TypeScriptLS";
|
||||
}
|
||||
|
||||
private getScriptInfo(fileName: string): ScriptInfo {
|
||||
return ts.lookUp(this.fileNameToScript, fileName);
|
||||
}
|
||||
|
||||
public addScript(fileName: string, content: string) {
|
||||
this.fileNameToScript[fileName] = new ScriptInfo(fileName, content);
|
||||
}
|
||||
|
||||
private contains(fileName: string): boolean {
|
||||
return ts.hasProperty(this.fileNameToScript, fileName);
|
||||
}
|
||||
|
||||
public updateScript(fileName: string, content: string) {
|
||||
var script = this.getScriptInfo(fileName);
|
||||
if (script !== null) {
|
||||
script.updateContent(content);
|
||||
return;
|
||||
}
|
||||
|
||||
this.addScript(fileName, content);
|
||||
}
|
||||
|
||||
public editScript(fileName: string, minChar: number, limChar: number, newText: string) {
|
||||
var script = this.getScriptInfo(fileName);
|
||||
if (script !== null) {
|
||||
script.editContent(minChar, limChar, newText);
|
||||
return;
|
||||
}
|
||||
|
||||
throw new Error("No script with name '" + fileName + "'");
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// ILogger implementation
|
||||
//
|
||||
public information(): boolean { return false; }
|
||||
public debug(): boolean { return true; }
|
||||
public warning(): boolean { return true; }
|
||||
public error(): boolean { return true; }
|
||||
public fatal(): boolean { return true; }
|
||||
|
||||
public log(s: string): void {
|
||||
// For debugging...
|
||||
//TypeScript.Environment.standardOut.WriteLine("TypeScriptLS:" + s);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// LanguageServiceShimHost implementation
|
||||
//
|
||||
|
||||
/// Returns json for Tools.CompilationSettings
|
||||
public getCompilationSettings(): string {
|
||||
return JSON.stringify(this.settings);
|
||||
}
|
||||
|
||||
public getCancellationToken(): ts.CancellationToken {
|
||||
return this.cancellationToken;
|
||||
}
|
||||
|
||||
public getCurrentDirectory(): string {
|
||||
return "";
|
||||
}
|
||||
|
||||
public getDefaultLibFilename(): string {
|
||||
return "";
|
||||
}
|
||||
|
||||
public getScriptFileNames(): string {
|
||||
var fileNames: string[] = [];
|
||||
ts.forEachKey(this.fileNameToScript,(fileName) => { fileNames.push(fileName); });
|
||||
return JSON.stringify(fileNames);
|
||||
}
|
||||
|
||||
public getScriptSnapshot(fileName: string): ts.ScriptSnapshotShim {
|
||||
if (this.contains(fileName)) {
|
||||
return new ScriptSnapshotShim(new ScriptSnapshot(this.getScriptInfo(fileName)));
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
public getScriptVersion(fileName: string): string {
|
||||
if (this.contains(fileName)) {
|
||||
return this.getScriptInfo(fileName).version.toString();
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
public getLocalizedDiagnosticMessages(): string {
|
||||
return JSON.stringify({});
|
||||
}
|
||||
|
||||
/** Return a new instance of the language service shim, up-to-date wrt to typecheck.
|
||||
* To access the non-shim (i.e. actual) language service, use the "ls.languageService" property.
|
||||
*/
|
||||
public getLanguageService(): ts.LanguageServiceShim {
|
||||
this.ls = new TypeScript.Services.TypeScriptServicesFactory().createLanguageServiceShim(this);
|
||||
return this.ls;
|
||||
}
|
||||
|
||||
public setCompilationSettings(settings: ts.CompilerOptions) {
|
||||
for (var key in settings) {
|
||||
if (settings.hasOwnProperty(key)) {
|
||||
this.settings[key] = settings[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** Return a new instance of the classifier service shim */
|
||||
public getClassifier(): ts.ClassifierShim {
|
||||
return new TypeScript.Services.TypeScriptServicesFactory().createClassifierShim(this);
|
||||
}
|
||||
|
||||
public getCoreService(): ts.CoreServicesShim {
|
||||
return new TypeScript.Services.TypeScriptServicesFactory().createCoreServicesShim(this);
|
||||
}
|
||||
|
||||
/** Parse file given its source text */
|
||||
public parseSourceText(fileName: string, sourceText: ts.IScriptSnapshot): ts.SourceFile {
|
||||
var result = ts.createSourceFile(fileName, sourceText.getText(0, sourceText.getLength()), ts.ScriptTarget.Latest);
|
||||
result.version = "1";
|
||||
return result;
|
||||
}
|
||||
|
||||
/** Parse a file on disk given its fileName */
|
||||
public parseFile(fileName: string) {
|
||||
var sourceText = ts.ScriptSnapshot.fromString(Harness.IO.readFile(fileName));
|
||||
return this.parseSourceText(fileName, sourceText);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param line 1 based index
|
||||
* @param col 1 based index
|
||||
*/
|
||||
public lineColToPosition(fileName: string, line: number, col: number): number {
|
||||
var script: ScriptInfo = this.fileNameToScript[fileName];
|
||||
assert.isNotNull(script);
|
||||
assert.isTrue(line >= 1);
|
||||
assert.isTrue(col >= 1);
|
||||
|
||||
return ts.getPositionFromLineAndCharacter(script.lineMap, line, col);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param line 0 based index
|
||||
* @param col 0 based index
|
||||
*/
|
||||
public positionToZeroBasedLineCol(fileName: string, position: number): ts.LineAndCharacter {
|
||||
var script: ScriptInfo = this.fileNameToScript[fileName];
|
||||
assert.isNotNull(script);
|
||||
|
||||
var result = ts.getLineAndCharacterOfPosition(script.lineMap, position);
|
||||
|
||||
assert.isTrue(result.line >= 1);
|
||||
assert.isTrue(result.character >= 1);
|
||||
return { line: result.line - 1, character: result.character - 1 };
|
||||
}
|
||||
|
||||
/** Verify that applying edits to sourceFileName result in the content of the file baselineFileName */
|
||||
public checkEdits(sourceFileName: string, baselineFileName: string, edits: ts.TextChange[]) {
|
||||
var script = Harness.IO.readFile(sourceFileName);
|
||||
var formattedScript = this.applyEdits(script, edits);
|
||||
var baseline = Harness.IO.readFile(baselineFileName);
|
||||
|
||||
function noDiff(text1: string, text2: string) {
|
||||
text1 = text1.replace(/^\s+|\s+$/g, "").replace(/\r\n?/g, "\n");
|
||||
text2 = text2.replace(/^\s+|\s+$/g, "").replace(/\r\n?/g, "\n");
|
||||
|
||||
if (text1 !== text2) {
|
||||
var errorString = "";
|
||||
var text1Lines = text1.split(/\n/);
|
||||
var text2Lines = text2.split(/\n/);
|
||||
for (var i = 0; i < text1Lines.length; i++) {
|
||||
if (text1Lines[i] !== text2Lines[i]) {
|
||||
errorString += "Difference at line " + (i + 1) + ":\n";
|
||||
errorString += " Left File: " + text1Lines[i] + "\n";
|
||||
errorString += " Right File: " + text2Lines[i] + "\n\n";
|
||||
}
|
||||
}
|
||||
throw (new Error(errorString));
|
||||
}
|
||||
}
|
||||
assert.isTrue(noDiff(formattedScript, baseline));
|
||||
assert.equal(formattedScript, baseline);
|
||||
}
|
||||
|
||||
|
||||
/** Apply an array of text edits to a string, and return the resulting string. */
|
||||
public applyEdits(content: string, edits: ts.TextChange[]): string {
|
||||
var result = content;
|
||||
edits = this.normalizeEdits(edits);
|
||||
|
||||
for (var i = edits.length - 1; i >= 0; i--) {
|
||||
var edit = edits[i];
|
||||
var prefix = result.substring(0, edit.span.start);
|
||||
var middle = edit.newText;
|
||||
var suffix = result.substring(ts.textSpanEnd(edit.span));
|
||||
result = prefix + middle + suffix;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/** Normalize an array of edits by removing overlapping entries and sorting entries on the minChar position. */
|
||||
private normalizeEdits(edits: ts.TextChange[]): ts.TextChange[] {
|
||||
var result: ts.TextChange[] = [];
|
||||
|
||||
function mapEdits(edits: ts.TextChange[]): { edit: ts.TextChange; index: number; }[] {
|
||||
var result: { edit: ts.TextChange; index: number; }[] = [];
|
||||
for (var i = 0; i < edits.length; i++) {
|
||||
result.push({ edit: edits[i], index: i });
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
var temp = mapEdits(edits).sort(function (a, b) {
|
||||
var result = a.edit.span.start - b.edit.span.start;
|
||||
if (result === 0)
|
||||
result = a.index - b.index;
|
||||
return result;
|
||||
});
|
||||
|
||||
var current = 0;
|
||||
var next = 1;
|
||||
while (current < temp.length) {
|
||||
var currentEdit = temp[current].edit;
|
||||
|
||||
// Last edit
|
||||
if (next >= temp.length) {
|
||||
result.push(currentEdit);
|
||||
current++;
|
||||
continue;
|
||||
}
|
||||
var nextEdit = temp[next].edit;
|
||||
|
||||
var gap = nextEdit.span.start - ts.textSpanEnd(currentEdit.span);
|
||||
|
||||
// non-overlapping edits
|
||||
if (gap >= 0) {
|
||||
result.push(currentEdit);
|
||||
current = next;
|
||||
next++;
|
||||
continue;
|
||||
}
|
||||
|
||||
// overlapping edits: for now, we only support ignoring an next edit
|
||||
// entirely contained in the current edit.
|
||||
if (ts.textSpanEnd(currentEdit.span) >= ts.textSpanEnd(nextEdit.span)) {
|
||||
next++;
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
throw new Error("Trying to apply overlapping edits");
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,4 +12,3 @@ edit.disableFormatting();
|
||||
goTo.marker('1');
|
||||
|
||||
edit.insert(" compareTo(): number;\n");
|
||||
diagnostics.validateTypesAtPositions(168,84,53,118,22);
|
||||
|
||||
@@ -14,4 +14,3 @@ edit.disableFormatting();
|
||||
goTo.marker('1');
|
||||
|
||||
edit.insert(", 'world'");
|
||||
diagnostics.validateTypesAtPositions(78);
|
||||
|
||||
@@ -23,5 +23,4 @@ goTo.marker('2');
|
||||
edit.deleteAtCaret(7);
|
||||
|
||||
goTo.marker('4');
|
||||
diagnostics.validateTypesAtPositions(43);
|
||||
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
/// <reference path="../fourslash.ts" />
|
||||
|
||||
//// interface Iterator<T> {
|
||||
//// (value: T, index: any): U;
|
||||
//// }
|
||||
////
|
||||
//// interface WrappedArray<T> {
|
||||
//// map<U>(iterator: Iterator<T, U>): U[];
|
||||
//// }
|
||||
////
|
||||
//// interface Underscore {
|
||||
//// <T>(list: T[]): WrappedArray<T>;
|
||||
//// map<T, U>(list: T[], iterator: Iterator<T, U>, context?: any): U[];
|
||||
//// }
|
||||
////
|
||||
//// declare var _: Underscore;
|
||||
////
|
||||
//// var a: string[];
|
||||
//// var b = _.map(a, x => x.length); // Type any[], should be number[]
|
||||
//// var c = _(a).map();
|
||||
//// var d = a.map(x => x.length);
|
||||
//// var bb = _.map(aa, x => x.length);
|
||||
//// var cc = _(aa).map(x => x.length); // Error, could not select overload
|
||||
//// var dd = aa.map(x => x.length); // Error, could not select overload
|
||||
////
|
||||
////
|
||||
////
|
||||
////
|
||||
|
||||
edit.disableFormatting();
|
||||
diagnostics.validateTypesAtPositions(364);
|
||||
@@ -1,7 +0,0 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
|
||||
//// function foo2<T>(test);
|
||||
//// function foo2<T>() { }
|
||||
//// /**/foo2<>("");
|
||||
goTo.marker();
|
||||
diagnostics.validateTypeAtCurrentPosition();
|
||||
@@ -80,16 +80,6 @@ module FourSlashInterface {
|
||||
}
|
||||
}
|
||||
|
||||
export class diagnostics {
|
||||
public validateTypeAtCurrentPosition() {
|
||||
return this.validateTypesAtPositions(FourSlash.currentTestState.currentCaretPosition);
|
||||
}
|
||||
|
||||
public validateTypesAtPositions(...positions: number[]) {
|
||||
return FourSlash.currentTestState.verifyTypesAgainstFullCheckAtPositions(positions);
|
||||
}
|
||||
}
|
||||
|
||||
export class goTo {
|
||||
// Moves the caret to the specified marker,
|
||||
// or the anonymous marker ('/**/') if no name
|
||||
@@ -647,7 +637,6 @@ module fs {
|
||||
export var edit = new FourSlashInterface.edit();
|
||||
export var debug = new FourSlashInterface.debug();
|
||||
export var format = new FourSlashInterface.format();
|
||||
export var diagnostics = new FourSlashInterface.diagnostics();
|
||||
export var cancellation = new FourSlashInterface.cancellation();
|
||||
}
|
||||
module ts {
|
||||
@@ -666,6 +655,5 @@ var verify = new FourSlashInterface.verify();
|
||||
var edit = new FourSlashInterface.edit();
|
||||
var debug = new FourSlashInterface.debug();
|
||||
var format = new FourSlashInterface.format();
|
||||
var diagnostics = new FourSlashInterface.diagnostics();
|
||||
var cancellation = new FourSlashInterface.cancellation();
|
||||
var classification = FourSlashInterface.classification;
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
|
||||
////declare module A.B {
|
||||
//// export class C { }
|
||||
////}
|
||||
////
|
||||
////import ab = A.B;
|
||||
////
|
||||
////class D extends ab.C/**/{ }
|
||||
|
||||
goTo.marker();
|
||||
diagnostics.validateTypesAtPositions(FourSlash.currentTestState.currentCaretPosition);
|
||||
@@ -1,8 +0,0 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
|
||||
//// var x: Number;
|
||||
//// var y: Number;
|
||||
//// var z = x ;
|
||||
|
||||
edit.disableFormatting();
|
||||
diagnostics.validateTypesAtPositions(28);
|
||||
@@ -1,29 +0,0 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
|
||||
//// class A<T, U extends T> { }
|
||||
//// class B<T extends Object, U extends T> {
|
||||
//// data: A<Object, Object>;
|
||||
//// }
|
||||
////
|
||||
//// // Below 2 should compile without error
|
||||
//// var x: A< { }, { b: number }>;
|
||||
//// var y: B< { a: string }, { }>;
|
||||
////
|
||||
////
|
||||
//// // Below should be in error
|
||||
//// var x1: A<{ a: string;}>;
|
||||
//// var x2: A<{ a: number }>;
|
||||
//// var x3: B<{ a: string;}, { b: string }>;
|
||||
//// var x4: B<{ a: string;}>;
|
||||
//// var x5: A<{ a: string; b: number }, { a: string }>;
|
||||
//// var x6: B<>;
|
||||
////
|
||||
//// interface I1 {
|
||||
//// a: string;
|
||||
//// }
|
||||
//// var x8: B<I2, I1>;
|
||||
////
|
||||
|
||||
edit.disableFormatting();
|
||||
diagnostics.validateTypesAtPositions(34);
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
|
||||
//// function f18(a?:string, ...b){}
|
||||
////
|
||||
//// function f19(a?:string, b?){}
|
||||
////
|
||||
//// function f20(a:string, b?:string, ...c:number[]){}
|
||||
////
|
||||
//// function f21(a:string, b?:string, ...d:number[]){}
|
||||
|
||||
edit.disableFormatting();
|
||||
diagnostics.validateTypesAtPositions(133);
|
||||
@@ -20,5 +20,3 @@ edit.insert(", X");
|
||||
goTo.marker('addTypeParam');
|
||||
|
||||
edit.insert(", X");
|
||||
|
||||
diagnostics.validateTypesAtPositions(91, 163);
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
|
||||
//// class Point {
|
||||
////
|
||||
//// constructor(public x: number) {
|
||||
////
|
||||
//// }
|
||||
//// getDist() {
|
||||
//// }
|
||||
//// static origin = new Point(0);
|
||||
//// }
|
||||
////
|
||||
//// class Point3D {
|
||||
////
|
||||
//// constructor(x: number, y: number, private z) {
|
||||
//// super(x, y);
|
||||
//// }
|
||||
////
|
||||
//// getDist() {
|
||||
//// return Math.sqrt(this.x*this.x + this.z*this.m);
|
||||
//// }
|
||||
//// }
|
||||
////
|
||||
////
|
||||
|
||||
edit.disableFormatting();
|
||||
diagnostics.validateTypesAtPositions(258);
|
||||
@@ -1,12 +0,0 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
|
||||
//// interface Sequence<T> {
|
||||
//// each(iterator: (value: T) => void): void;
|
||||
//// filter(): Sequence<T>;
|
||||
//// groupBy<K>(keySelector: () => K): Sequence<{ items: T/**/[]; }>;
|
||||
//// }
|
||||
|
||||
goTo.file(0);
|
||||
|
||||
// Marker in above file is placed at position 154
|
||||
diagnostics.validateTypesAtPositions(154);
|
||||
@@ -1,11 +0,0 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
|
||||
//// function method() {
|
||||
//// var dictionary = <{ [index: string]: string; }>{};
|
||||
//// }
|
||||
////
|
||||
|
||||
edit.disableFormatting(); // Disregard, just here to keep Fourslash happy
|
||||
|
||||
diagnostics.validateTypesAtPositions(44);
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
|
||||
//// // @sourcemap: true
|
||||
//// module Foo.Bar {
|
||||
//// "use strict";
|
||||
////
|
||||
//// class Greeter {
|
||||
//// constructor(public greeting: string) {
|
||||
//// }
|
||||
////
|
||||
//// greet() {
|
||||
//// }
|
||||
//// }
|
||||
////
|
||||
////
|
||||
//// function foo(greeting: string): Foo.Bar.Greeter {
|
||||
//// return new Greeter(greeting);
|
||||
//// }
|
||||
////
|
||||
//// var greeter = new Greeter("Hello, world!");
|
||||
//// var str = greeter.greet();
|
||||
////
|
||||
//// function foo2(greeting: string, ...restGreetings) {
|
||||
//// var greeters: Greeter[] = [];
|
||||
//// new Greeter(greeting);
|
||||
//// for (var i = 0; restGreetings.length; i++) {
|
||||
//// greeters.push(new Greeter(restGreetings[i]));
|
||||
//// }
|
||||
////
|
||||
//// return greeters;
|
||||
//// }
|
||||
////
|
||||
//// var b = foo2("Hello", "World");
|
||||
//// for (var j = 0; j < b.length; j++) {
|
||||
//// b[j].greet();
|
||||
//// }
|
||||
//// }
|
||||
|
||||
edit.disableFormatting();
|
||||
diagnostics.validateTypesAtPositions(705);
|
||||
Reference in New Issue
Block a user