759 Commits

Author SHA1 Message Date
Andy
a0c672ac02 Add assertion that module / type reference names are defined (#17124) 2017-07-12 10:13:33 -07:00
Andy
8c3f5e2208 Remove createFileMap (#16810)
* Make `createFileMap` an internal detail of `program.ts`

* Remove createFileMap

* Clean up calls to `toPath`
2017-07-10 11:24:17 -07:00
Andy
17578e8a5d Use Map<true> for sets (#16972) 2017-07-07 10:34:36 -07:00
Wesley Wigham
4e6b2f3c93 Created a branded type for identifier-escaped strings (#16915)
* Created a branded type for escaped strings

Then flowed it throughout the compiler, finding and fixing a handful of
bugs relating to underscore-prefixed identifiers in the process.
Includes a test for two cases noticed - diagnostics from conflicting
symbols from export *'s, and enum with underscore prefixed member emit.

* Correctly double underscores WRT mapped types

* Add fourslash tests for other fixed issues

* use function call over cast

* Update forEachEntry type accuracy

* Just use escaped names for ActiveLabel

* Remove casts from getPropertyNameForPropertyNameNode

* This pattern has occurred a few times, could use a helper function.

* Remove duplicated helper

* Remove unneeded check, use helper

* Identifiers list is no longer escaped strings

* Extract repeated string-getting code into helper

* Rename type and associated functions

* Make getName() return UnderscoreEscapedString, add getUnescapedName()

* Add list of internal symbol names to escaped string type to cut back on casting

* Remove outdated comments

* Reassign interned values to nodes, just in case

* Swap to string enum

* Add deprecated aliases to escapeIdentifier and unescapeIdentifier

* Add temp var

* Remove unsafe casts

* Rename escaped string type as per @sandersn's suggestion, fix string enum usages

* Reorganize double underscore tests

* Remove jfreeman from TODO

* Remove unneeded parenthesis
2017-07-06 14:45:50 -07:00
Andrew Casey
569ecabb0a Address PR feedback
Make Program.getMissingFilePaths required

Assume getMissingFilePaths always returns a defined value

Make getMissingFilePaths internal

Replace nullable-bool with enum

Update type to reflect possibility of undefined

Use deepEqual to simplify tests

Make condition const

Don't bother cleaning up map before freeing it

Switch from foreach to for-of to simplify debugging

Use a Map, rather than a FileMap, to track open FileWatchers

Fix compilation errors

Introduce and consume arrayToSet

Fix lint warnings about misplaced braces

Delete incorrect comment

Delete from map during iteration

Eliminate unnecessary type annotations
2017-06-29 11:29:19 -07:00
Andrew Casey
4652fc491f Confirm method is defined before calling 2017-06-29 10:39:32 -07:00
Andrew Casey
4863ada22c Track missing files
1. Expose missing files from the `Program`.
2. In `tsc --watch` and `tsserver`, add file watchers to missing files.
3. When missing files are created, schedule compilation (tsc) or refresh
the containing projects (tsserver).
2017-06-29 10:39:31 -07:00
Andy
9013665e22 Replace FileMap with Map where there is no keyMapper (#16724)
* Replace FileMap with Map where there is no keyMapper

* Remove `toKey` and use `keyMapper` directly
2017-06-28 13:15:34 -07:00
Andy
9260a399a3 Remove duplicate switch cases (#16721) 2017-06-28 12:53:43 -07:00
Yui
47c1563649 Merge pull request #16544 from Microsoft/master-fixIncrementalParsingWithDynamicImport
[Master] wip - fix incremental parsing with dynamic import
2017-06-19 16:44:47 -07:00
Sheetal Nandi
09f0b3471a Merge branch 'master' into ownJsonParsing 2017-06-15 09:59:37 -07:00
Yui T
a92b549336 Set the structureReused to be safemoudles when dynamic import change 2017-06-14 21:50:12 -07:00
Yui T
1636fbc966 Wip-fix incremental parsing 2017-06-14 17:13:35 -07:00
Andy
09321b3834 Convert Extension to a string enum (#16425) 2017-06-09 19:32:44 -07:00
Daniel Rosenwasser
86e54ac787 Correct pluralization of 'Contain' to 'Contains', made the nodeflag internal. 2017-06-08 16:00:38 -07:00
Sheetal Nandi
48189c883f Merge branch 'master' into ownJsonParsing 2017-06-06 11:03:21 -07:00
Yui T
b9017795a0 Revert "Revert "[Master] wip-dynamic import" (#16264)"
This reverts commit ccc60c8b3b75476c4b11abb6ab4d2e6f06214f8f.
2017-06-05 17:16:29 -07:00
Sheetal Nandi
c4ad151a46 Merge branch 'master' into ownJsonParsing 2017-06-05 17:01:09 -07:00
Andy
8ace7b826f importFixes: Support missing "React" at a JSXOpeningElement (#16066)
* importFixes: Support missing "React" at a JSXOpeningElement

* Fix nextLineRule linting

* Rename to resolveJsxNamespaceAtLocation

* Expose getJsxNamespace and resolveNameAtLocation separately
2017-06-05 14:23:39 -07:00
Andy
70564110c0 Make use of array helper functions (#16226)
* Make use of array helper functions

* Remove unnecessary 'ts.'
2017-06-05 14:11:43 -07:00
Mohamed Hegazy
ccc60c8b3b Revert "[Master] wip-dynamic import" (#16264) 2017-06-05 10:49:20 -07:00
Sheetal Nandi
d680720f6d Merge branch 'master' into ownJsonParsing 2017-06-05 10:28:23 -07:00
Yui
9d16d34c6a Merge pull request #14774 from Microsoft/master-dynamicImport
[Master] wip-dynamic import
2017-06-05 06:59:14 -07:00
Yui T
2f476bf22f Merge branch 'master' into master-dynamicImport 2017-06-02 09:10:20 -07:00
Yui T
e6d7327c3f Address PR: error message, fix capitalization, only allow functionLikeDeclaration and ImportCall for create Promise, use fall through comment 2017-06-01 23:21:59 -07:00
Andrew Casey
cd84d2a85a Use emptyArray, rather than [] 2017-06-01 19:05:07 -07:00
Andrew Casey
9d0bbc4e44 Apply --checkJs to bind diagnostics as well as check diagnostics 2017-06-01 18:10:52 -07:00
Sheetal Nandi
8f4f6c565e Merge branch 'master' into ownJsonParsing 2017-06-01 10:43:41 -07:00
Nathan Shively-Sanders
2dd6627022 Report jsdoc syntax errors when checkJs is on 2017-05-30 13:32:46 -07:00
Sheetal Nandi
f1ea38d127 Merge branch 'master' into ownJsonParsing 2017-05-24 12:46:29 -07:00
Kanchalai Tanglertsampan
faab927c8d Merge branch 'master' into master-dynamicImport
# Conflicts:
#	src/compiler/checker.ts
#	src/compiler/emitter.ts
#	src/compiler/parser.ts
#	src/compiler/transformers/module/module.ts
#	src/compiler/transformers/module/system.ts
2017-05-24 11:26:06 -07:00
Donald Pipowitch
e4d6752a93 add createProgram docs (#15697)
* add `createProgram` docs

* updated `createProgram` docs
2017-05-23 10:40:46 -07:00
Andy
38ece3b703 Merge pull request #15737 from Microsoft/findAllRefs_module
Support find-all-references for a module specifier
2017-05-19 08:11:56 -07:00
Andy Hanson
0ff187c8ac Remove 'isDeclarationFile()' function, use '.isDeclarationFile' 2017-05-17 08:12:23 -07:00
Sheetal Nandi
ec2f9670d9 Merge branch 'master' into ownJsonParsing 2017-05-15 11:36:45 -07:00
Alex Eagle
4240f6f5d9 Extract diagnostics formatter used by --pretty
This allows compilers other than tsc.js to display nice in-context diagnostics
2017-05-12 16:19:46 -07:00
Sheetal Nandi
d7e9609ae5 Merge branch 'master' into ownJsonParsing 2017-05-11 09:10:35 -07:00
Andy Hanson
71fb02c099 Support find-all-references for a module specifier 2017-05-10 11:02:17 -07:00
Kanchalai Tanglertsampan
1b7d3bfa07 Merge branch 'master' into master-dynamicImport 2017-05-04 10:14:32 -07:00
Arthur Ozga
2150a7796b Merge pull request #15261 from aozgaa/moduleReuse
Reuse Module Resolutions from Unchanged Files
2017-05-01 17:49:44 -07:00
Arthur Ozga
60825143a4 respond to comments 2017-05-01 17:49:19 -07:00
Arthur Ozga
2118de09e7 Simplify returns 2017-05-01 15:16:42 -07:00
Arthur Ozga
ef1cd50dfc clarifying comments 2017-05-01 11:47:12 -07:00
Arthur Ozga
c63d6d145a Avoid double-resolving modified files 2017-04-28 16:27:41 -07:00
Arthur Ozga
86d7031932 inline createOldProgramState 2017-04-28 10:40:31 -07:00
Arthur Ozga
6547c1816f check ambient modules before reusing old state 2017-04-27 20:27:48 -07:00
Yui T
feb41f7d7c Merge branch 'master' into master-dynamicImport
# Conflicts:
#	src/compiler/diagnosticMessages.json
#	src/compiler/program.ts
2017-04-26 15:35:30 -07:00
Yui T
e50667e49e Address minor PR comment 2017-04-26 15:02:54 -07:00
Yui T
2f61d472ed Address minor PR comment 2017-04-26 12:56:15 -07:00
Arthur Ozga
ac20fc2d26 consolidate program-structure reuse flags 2017-04-21 16:54:42 -07:00