Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

String literal types #5185

Merged
merged 44 commits into from
Nov 10, 2015
Merged
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
311a0cf
Added tests.
DanielRosenwasser Sep 11, 2015
911e907
Added test for string literal types in type arguments.
DanielRosenwasser Oct 1, 2015
f04cc39
Accepted baselines.
DanielRosenwasser Oct 1, 2015
191be4f
Make string literals valid constituent types nodes in the parser.
DanielRosenwasser Oct 1, 2015
84786d8
Accepted baselines.
DanielRosenwasser Oct 1, 2015
dc0e368
Make string literals valid types in type lists.
DanielRosenwasser Oct 1, 2015
8891fba
Accepted baselines.
DanielRosenwasser Oct 1, 2015
82545ce
Added test for string types in tuples.
DanielRosenwasser Oct 1, 2015
ed927d8
Accepted baselines.
DanielRosenwasser Oct 1, 2015
a3e7ccb
Use normalized text for text on string literal types.
DanielRosenwasser Oct 2, 2015
20c2c4e
Amended fourslash tests to expect double quotes.
DanielRosenwasser Oct 2, 2015
87f2957
Accepted baselines.
DanielRosenwasser Oct 2, 2015
f721971
Capture compatible contextual types for unions containing string lite…
DanielRosenwasser Oct 2, 2015
7b4e94d
Accepted baselines.
DanielRosenwasser Oct 2, 2015
d8d72aa
Separated the concept of apparent types from contextual types for str…
DanielRosenwasser Oct 2, 2015
315b06d
Accepted baselines.
DanielRosenwasser Oct 2, 2015
4b736da
Fixed issue in test.
DanielRosenwasser Oct 2, 2015
fd5dec4
Accepted baselines.
DanielRosenwasser Oct 2, 2015
f7a6ac7
Added more tests.
DanielRosenwasser Oct 7, 2015
a440f06
Accepted baselines.
DanielRosenwasser Oct 8, 2015
d2e2a55
Added fourslash test.
DanielRosenwasser Oct 8, 2015
6e3343c
Merge branch 'master' into stringLiteralTypes
DanielRosenwasser Oct 8, 2015
74ac57d
Accepted post-merge baselines.
DanielRosenwasser Oct 8, 2015
61ece76
Return the string literal type itself instead of the union type.
DanielRosenwasser Oct 8, 2015
84b64c4
Accepted baselines.
DanielRosenwasser Oct 8, 2015
3788254
Semicolon.
DanielRosenwasser Oct 8, 2015
ebc47d5
Linting.
DanielRosenwasser Oct 8, 2015
725bda8
Merge branch 'master' into stringLiteralTypes
DanielRosenwasser Oct 15, 2015
ec0d49a
Always use a string literal type if contextually typed by any string …
DanielRosenwasser Oct 15, 2015
1dbd8d1
Accepted baselines.
DanielRosenwasser Oct 15, 2015
307d73e
Merge branch 'master' into stringLiteralTypes
DanielRosenwasser Oct 22, 2015
049d02f
Merge branch 'master' into stringLiteralTypes
DanielRosenwasser Oct 23, 2015
6618fd2
Added tests for operations that use assignable to/from.
DanielRosenwasser Oct 26, 2015
bf4880a
Merge branch 'master' into stringLiteralTypes
DanielRosenwasser Oct 26, 2015
5e23143
Accepted baselines.
DanielRosenwasser Oct 27, 2015
8dbfe1c
Added specific checks for comparing stringlike types.
DanielRosenwasser Nov 6, 2015
a1fcfaf
Accepted baselines.
DanielRosenwasser Nov 6, 2015
bb232f7
Merge remote-tracking branch 'origin/master' into stringLiteralTypes
DanielRosenwasser Nov 6, 2015
f939ff2
Fixed unreachable code in tests.
DanielRosenwasser Nov 6, 2015
d234b8d
Accepted baselines.
DanielRosenwasser Nov 6, 2015
c011ed4
Const.
DanielRosenwasser Nov 6, 2015
38090c6
Added tests for template strings with string literal types.
DanielRosenwasser Nov 9, 2015
d294524
Accepted baselines.
DanielRosenwasser Nov 9, 2015
ea4e21d
Fixed comments.
DanielRosenwasser Nov 9, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added fourslash test.
  • Loading branch information
DanielRosenwasser committed Oct 8, 2015
commit d2e2a55a9ed8e212c1c196a33c9163f8c8bf7da8
41 changes: 41 additions & 0 deletions tests/cases/fourslash/quickInfoDisplayPartsVarWithStringTypes01.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/// <reference path='fourslash.ts'/>

////let /*1*/hello: "hello" | 'hello' = "hello";
////let /*2*/world: 'world' = "world";
////let /*3*/helloOrWorld: "hello" | 'world';

goTo.marker("1");
verify.verifyQuickInfoDisplayParts("let", "", { start: test.markerByName('1').position, length: "hello".length }, [
{ text: "let", kind: "keyword" },
{ text: " ", kind: "space" },
{ text: "hello", kind: "localName" },
{ text: ":", kind: "punctuation" },
{ text: " ", kind: "space" },
{ text: '"hello"', kind: "stringLiteral" }, ],
/*documentation*/ []);

goTo.marker("2");
verify.verifyQuickInfoDisplayParts("let", "", { start: test.markerByName('2').position, length: "world".length }, [
{ text: "let", kind: "keyword" },
{ text: " ", kind: "space" },
{ text: "world", kind: "localName" },
{ text: ":", kind: "punctuation" },
{ text: " ", kind: "space" },
{ text: '"world"', kind: "stringLiteral" },
],
/*documentation*/[]);

goTo.marker("3");
verify.verifyQuickInfoDisplayParts("let", "", { start: test.markerByName('3').position, length: "helloOrWorld".length }, [
{ text: "let", kind: "keyword" },
{ text: " ", kind: "space" },
{ text: "helloOrWorld", kind: "localName" },
{ text: ":", kind: "punctuation" },
{ text: " ", kind: "space" },
{ text: '"hello"', kind: "stringLiteral" },
{ text: " ", kind: "space" },
{ text: "|", kind: "punctuation" },
{ text: " ", kind: "space" },
{ text: '"world"', kind: "stringLiteral" },
],
/*documentation*/[]);