mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-30 01:04:49 -05:00
Merge branch 'master' into gotoDefShorthand
This commit is contained in:
@@ -8,4 +8,4 @@ test.markers().forEach(marker => {
|
||||
goTo.position(marker.position);
|
||||
|
||||
verify.completionListItemsCountIsGreaterThan(0)
|
||||
}}
|
||||
});
|
||||
@@ -8,4 +8,4 @@ test.markers().forEach(marker => {
|
||||
goTo.position(marker.position);
|
||||
|
||||
verify.completionListIsEmpty()
|
||||
}
|
||||
});
|
||||
@@ -8,5 +8,5 @@ test.ranges().forEach(targetRange => {
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
verify.referencesAtPositionContains(range);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -8,5 +8,5 @@ test.ranges().forEach(targetRange => {
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
verify.referencesAtPositionContains(range);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
14
tests/cases/fourslash/formattingInMultilineComments.ts
Normal file
14
tests/cases/fourslash/formattingInMultilineComments.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
////var x = function() {
|
||||
//// if (true) {
|
||||
//// /*1*/} else {/*2*/
|
||||
////}
|
||||
////
|
||||
////// newline at the end of the file
|
||||
|
||||
goTo.marker("2");
|
||||
edit.insertLine("");
|
||||
goTo.marker("1");
|
||||
// else formating should not be affected
|
||||
verify.currentLineContentIs(' } else {');
|
||||
@@ -51,4 +51,4 @@ for (var i = 1; i <= test.markers().length; i++) {
|
||||
verify.occurrencesAtPositionCount(1); // 'return' is an instance member
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -5,8 +5,8 @@ describe("DocumentRegistry", () => {
|
||||
var documentRegistry = ts.createDocumentRegistry();
|
||||
var defaultCompilerOptions = ts.getDefaultCompilerOptions();
|
||||
|
||||
var f1 = documentRegistry.acquireDocument("file1.ts", defaultCompilerOptions, TypeScript.ScriptSnapshot.fromString("var x = 1;"), "1", false);
|
||||
var f2 = documentRegistry.acquireDocument("file1.ts", defaultCompilerOptions, TypeScript.ScriptSnapshot.fromString("var x = 1;"), "1", false);
|
||||
var f1 = documentRegistry.acquireDocument("file1.ts", defaultCompilerOptions, ts.ScriptSnapshot.fromString("var x = 1;"), "1", false);
|
||||
var f2 = documentRegistry.acquireDocument("file1.ts", defaultCompilerOptions, ts.ScriptSnapshot.fromString("var x = 1;"), "1", false);
|
||||
|
||||
assert(f1 === f2, "DocumentRegistry should return the same document for the same name");
|
||||
});
|
||||
@@ -17,21 +17,21 @@ describe("DocumentRegistry", () => {
|
||||
|
||||
// change compilation setting that doesn't affect parsing - should have the same document
|
||||
compilerOptions.declaration = true;
|
||||
var f1 = documentRegistry.acquireDocument("file1.ts", compilerOptions, TypeScript.ScriptSnapshot.fromString("var x = 1;"), "1", false);
|
||||
var f1 = documentRegistry.acquireDocument("file1.ts", compilerOptions, ts.ScriptSnapshot.fromString("var x = 1;"), "1", false);
|
||||
compilerOptions.declaration = false;
|
||||
var f2 = documentRegistry.acquireDocument("file1.ts", compilerOptions, TypeScript.ScriptSnapshot.fromString("var x = 1;"), "1", false);
|
||||
var f2 = documentRegistry.acquireDocument("file1.ts", compilerOptions, ts.ScriptSnapshot.fromString("var x = 1;"), "1", false);
|
||||
|
||||
assert(f1 === f2, "Expected to have the same document instance");
|
||||
|
||||
|
||||
// change value of compilation setting that is used during production of AST - new document is required
|
||||
compilerOptions.target = ts.ScriptTarget.ES3;
|
||||
var f3 = documentRegistry.acquireDocument("file1.ts", compilerOptions, TypeScript.ScriptSnapshot.fromString("var x = 1;"), "1", false);
|
||||
var f3 = documentRegistry.acquireDocument("file1.ts", compilerOptions, ts.ScriptSnapshot.fromString("var x = 1;"), "1", false);
|
||||
|
||||
assert(f1 !== f3, "Changed target: Expected to have different instances of document");
|
||||
|
||||
compilerOptions.module = ts.ModuleKind.CommonJS;
|
||||
var f4 = documentRegistry.acquireDocument("file1.ts", compilerOptions, TypeScript.ScriptSnapshot.fromString("var x = 1;"), "1", false);
|
||||
var f4 = documentRegistry.acquireDocument("file1.ts", compilerOptions, ts.ScriptSnapshot.fromString("var x = 1;"), "1", false);
|
||||
|
||||
assert(f1 !== f4, "Changed module: Expected to have different instances of document");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user