mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 12:51:30 -05:00
Merge branch 'master' into sourceFileUpdate
Conflicts: src/compiler/diagnosticInformationMap.generated.ts src/compiler/diagnosticMessages.json src/compiler/parser.ts tests/baselines/reference/APISample_node_compile.js tests/baselines/reference/APISample_node_compile.types tests/baselines/reference/APISample_standalone_compile.js tests/baselines/reference/APISample_standalone_compile.types
This commit is contained in:
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
25
tests/baselines/reference/conflictMarkerTrivia1.errors.txt
Normal file
25
tests/baselines/reference/conflictMarkerTrivia1.errors.txt
Normal file
@@ -0,0 +1,25 @@
|
||||
tests/cases/compiler/conflictMarkerTrivia1.ts(2,1): error TS1185: Merge conflict marker encountered.
|
||||
tests/cases/compiler/conflictMarkerTrivia1.ts(4,1): error TS1185: Merge conflict marker encountered.
|
||||
tests/cases/compiler/conflictMarkerTrivia1.ts(6,1): error TS1185: Merge conflict marker encountered.
|
||||
tests/cases/compiler/conflictMarkerTrivia1.ts(3,5): error TS2300: Duplicate identifier 'v'.
|
||||
tests/cases/compiler/conflictMarkerTrivia1.ts(5,5): error TS2300: Duplicate identifier 'v'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/conflictMarkerTrivia1.ts (5 errors) ====
|
||||
class C {
|
||||
<<<<<<< HEAD
|
||||
|
||||
!!! error TS1185: Merge conflict marker encountered.
|
||||
v = 1;
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'v'.
|
||||
=======
|
||||
|
||||
!!! error TS1185: Merge conflict marker encountered.
|
||||
v = 2;
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'v'.
|
||||
>>>>>>> Branch-a
|
||||
|
||||
!!! error TS1185: Merge conflict marker encountered.
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
// @includeBuiltFile: typescript.d.ts
|
||||
// @noImplicitAny: true
|
||||
// @target: ES3
|
||||
// @module: CommonJs
|
||||
// @noresolve: true
|
||||
|
||||
import ts = require("typescript");
|
||||
|
||||
var sourceFile = ts.createSourceFile("file1.ts", "var x = 0;", ts.ScriptTarget.Latest);
|
||||
|
||||
var program = ts.createProgram(["file1.ts"], {}, undefined);
|
||||
@@ -1,7 +0,0 @@
|
||||
// @includeBuiltFile: typescriptServices.d.ts
|
||||
// @noImplicitAny: true
|
||||
// @target: ES3
|
||||
|
||||
var sourceFile = ts.createSourceFile("file1.ts", "var x = 0;", ts.ScriptTarget.Latest);
|
||||
|
||||
var program = ts.createProgram(["file1.ts"], {}, undefined);
|
||||
7
tests/cases/compiler/conflictMarkerTrivia1.ts
Normal file
7
tests/cases/compiler/conflictMarkerTrivia1.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
class C {
|
||||
<<<<<<< HEAD
|
||||
v = 1;
|
||||
=======
|
||||
v = 2;
|
||||
>>>>>>> Branch-a
|
||||
}
|
||||
18
tests/cases/fourslash/formatConflictMarker1.ts
Normal file
18
tests/cases/fourslash/formatConflictMarker1.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
////class C {
|
||||
////<<<<<<< HEAD
|
||||
//// v = 1;
|
||||
////=======
|
||||
////v = 2;
|
||||
////>>>>>>> Branch - a
|
||||
////}
|
||||
|
||||
format.document();
|
||||
verify.currentFileContentIs("class C {\r\n\
|
||||
<<<<<<< HEAD\r\n\
|
||||
v = 1;\r\n\
|
||||
=======\r\n\
|
||||
v = 2;\r\n\
|
||||
>>>>>>> Branch - a\r\n\
|
||||
}");
|
||||
@@ -317,7 +317,9 @@ describe('Colorization', function () {
|
||||
operator("<"),
|
||||
identifier("number"),
|
||||
finalEndOfLineState(ts.EndOfLineState.Start));
|
||||
});
|
||||
|
||||
it("ClassifiesConflictTokens", () => {
|
||||
// no longer in something that looks generic.
|
||||
test("Foo<Foo> number",
|
||||
ts.EndOfLineState.Start,
|
||||
@@ -327,6 +329,33 @@ describe('Colorization', function () {
|
||||
operator(">"),
|
||||
keyword("number"),
|
||||
finalEndOfLineState(ts.EndOfLineState.Start));
|
||||
|
||||
// Test conflict markers.
|
||||
test(
|
||||
"class C {\r\n\
|
||||
<<<<<<< HEAD\r\n\
|
||||
v = 1;\r\n\
|
||||
=======\r\n\
|
||||
v = 2;\r\n\
|
||||
>>>>>>> Branch - a\r\n\
|
||||
}",
|
||||
ts.EndOfLineState.Start,
|
||||
keyword("class"),
|
||||
identifier("C"),
|
||||
punctuation("{"),
|
||||
comment("<<<<<<< HEAD"),
|
||||
identifier("v"),
|
||||
operator("="),
|
||||
numberLiteral("1"),
|
||||
punctuation(";"),
|
||||
comment("======="),
|
||||
identifier("v"),
|
||||
operator("="),
|
||||
numberLiteral("2"),
|
||||
punctuation(";"),
|
||||
comment(">>>>>>> Branch - a"),
|
||||
punctuation("}"),
|
||||
finalEndOfLineState(ts.EndOfLineState.Start));
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user