2061 Commits

Author SHA1 Message Date
Andy
08030c7d02 Convert most of core.ts to accept ReadonlyArray (#17092)
* Convert most of core.ts to accept ReadonlyArray

* Fix lint

* Fix isArray
2017-07-11 17:39:33 -07:00
Ron Buckton
bb3253e544 Merge pull request #17044 from filipesilva/patch-1
Allow visitors to return undefined
2017-07-10 11:47:48 -07:00
Andy
bffde588cc Improve performance of JSDoc tag utilities (#16836)
* Improve performance of JSDoc tag utilities

* Use emptyArray instead of null, and address PR comments
2017-07-10 11:26:59 -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
Filipe Silva
ae533551c2 Allow visitors to return undefined
While implementing `ts.Visitor`, it is possible to return `undefined` in order to drop a node. However, the typings do not reflect this and only allow to return `Node | Node []`.

This PR extends the typings to allow `undefined` as well.
2017-07-09 18:50:45 +01:00
Andy
17578e8a5d Use Map<true> for sets (#16972) 2017-07-07 10:34:36 -07:00
Wesley Wigham
07e8263204 Start using a union for FunctionLike things (#16988)
* Start using a union for FunctionLike things

* Rename to shorter name
2017-07-06 14:46:15 -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
ac72803bb2 Merge pull request #16684 from amcasey/Vsts434619
Watch for the creation of missing files
2017-06-29 13:41:18 -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
Andy
179a3e10b5 Handle depth in all readDirectory implementations (#16646) 2017-06-29 11:04:33 -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
Arnaud Tournier
9ccf8ca6b0 Comments incorrectly read 'TypeFlags' instead of 'ObjectFlags' at some places 2017-06-29 17:54:34 +02:00
Andy
18357543c6 Provide better services for incomplete generic calls (#16535)
* Provide better services for incomplete generic calls

* Use clearer name

* Remove `inferredAnyDefaultTypeArgument` and `getBestGuessSignature`; have `resolveSignature` always get the best signature if !produceDiagnostics

* Update names and comments
2017-06-27 09:14:23 -07:00
Sheetal Nandi
09f0b3471a Merge branch 'master' into ownJsonParsing 2017-06-15 09:59:37 -07:00
Nathan Shively-Sanders
9f69cd5a62 Merge pull request #16497 from Microsoft/use-checker-for-decl-emit-of-optional-param-props
Use checker for declaration emit of optional, uninitialised parameter properties
2017-06-13 13:21:35 -07:00
Nathan Shively-Sanders
433a06d599 Add isOptionalUninitializedParameterProperty
Improves declaration emit and code readability
2017-06-13 11:49:58 -07:00
Anders Hejlsberg
31f0814d4a Simplify generic function call error reporting (#16439)
* Simplify error reporting for generic functions

* Accept new baselines

* Fix fourslash tests
2017-06-13 11:43:13 -07:00
Anders Hejlsberg
dde60bb624 Merge pull request #16368 from Microsoft/stricterGenericChecks
Stricter generic signature checks
2017-06-12 13:56:21 -07:00
Anders Hejlsberg
dc28aaa132 Add --noStrictGenericChecks compiler option 2017-06-12 13:09:01 -07:00
Andy
2748b3b334 Add isForInOrOfStatement utility (#16455) 2017-06-12 11:08:41 -07:00
Andy
09321b3834 Convert Extension to a string enum (#16425) 2017-06-09 19:32:44 -07:00
Andy
13b7d17da7 Don't bind JSDoc type parameter in a TS file (#16413)
* Don't bind JSDoc type parameter in a TS file

* Fix tests

* Remove unnecessary non-null assertions
2017-06-09 14:52:01 -07:00
Daniel Rosenwasser
af41c28ba9 Fixed up comments. 2017-06-08 16:00:39 -07:00
Daniel Rosenwasser
86e54ac787 Correct pluralization of 'Contain' to 'Contains', made the nodeflag internal. 2017-06-08 16:00:38 -07:00
Ron Buckton
d450b8b2ab Merge pull request #13272 from Microsoft/externalExportStar
Support for an external exportStar helper
2017-06-07 13:59:54 -07:00
Andy
abb9681248 Support completions for JSDoc @param tag names (#16299)
* Support completions for JSDoc @param tag names

* Undo change to finishNode

* Don't include trailing whitespace in @param range; instead, specialize getJsDocTagAtPosition
2017-06-07 12:28:52 -07:00
Ron Buckton
9250d0a290 Merge branch 'master' into externalExportStar 2017-06-07 10:53:42 -07:00
Ron Buckton
b217c39bb1 Merge pull request #15935 from chuckjaz/external-file-source-map
Add support for external file references in source maps
2017-06-06 18:06:06 -07:00
Chuck Jazdzewski
ce1d1c81ef Add support for external file references in source maps 2017-06-06 17:45:08 -07:00
Ron Buckton
8cb5333791 Verify JS function is constructor 2017-06-06 13:33:19 -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
Arthur Ozga
c179d9a22d Merge pull request #16045 from aozgaa/codeFixAddMissingMethod
Code fix add missing method
2017-06-05 16:50:46 -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
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 T
e386d65ed6 Use ESNext instead of ES2018 2017-06-04 19:58:24 -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
Arthur Ozga
2fb9ab798c repond to feedback 2017-06-01 16:06:53 -07:00
Sheetal Nandi
8f4f6c565e Merge branch 'master' into ownJsonParsing 2017-06-01 10:43:41 -07:00
Arthur Ozga
21fc30f69b Add support across files and static, js methods 2017-05-31 17:41:35 -07:00
Nathan Shively-Sanders
928da675ac Merge pull request #16156 from Microsoft/report-jsdoc-syntax-errors
Report JSDoc syntax errors
2017-05-31 16:21:32 -07:00
Ron Buckton
615920672e Merge branch 'master' into fix15857 2017-05-30 17:41:45 -07:00
Arthur Ozga
c9f5a46121 Merge branch 'master' into addCodeFixMissingMethod 2017-05-30 15:20:59 -07:00
Nathan Shively-Sanders
2dd6627022 Report jsdoc syntax errors when checkJs is on 2017-05-30 13:32:46 -07:00
Sheetal Nandi
8d771ca044 Merge branch 'master' into ownJsonParsing 2017-05-30 13:03:23 -07:00
Yui T
fe838bab2d Parse ts-style property tag 2017-05-27 19:10:53 -07:00