2538 Commits

Author SHA1 Message Date
Wesley Wigham
313a0b8990
Remove deprecated SymbolDisplayBuilder API (#25331)
* Remove deprecated API

* Accept API baseline updates
2018-06-29 18:37:50 -07:00
Andy
c5bd0405c4
JsxTagNameExpression can only be Identifier | ThisExpression, not any PrimaryExpression (#21555)
* JsxTagNameExpression can only be Identifier | ThisExpression, not any PrimaryExpression

* Use a type similar to PropertyAccessEntityNameExpression

* Fix lint errors
2018-06-29 16:50:44 -07:00
Wesley Wigham
30db30055f
Fix module specifier case handling for declaration emit (#25110) 2018-06-29 11:02:43 -07:00
Wesley Wigham
2a19580144
Introduce more caching and deferral into jsx checking (#25302)
* Introduce more caching and deferral into jsx checking

* Accept baseline with removed duplicated error
2018-06-28 14:43:20 -07:00
Wesley Wigham
53e163df0b
Add codes and categories to related information, officially (#25304) 2018-06-28 14:41:21 -07:00
Eugene Timokhov
ff28ffab9f Remove @internal from Program::isSourceFileDefaultLibrary
Fixes #25225
2018-06-26 20:40:11 +03:00
Anders Hejlsberg
70975cd08f
Merge pull request #24897 from Microsoft/restTuples
Tuples in rest parameters and spread expressions
2018-06-25 19:26:35 -07:00
Anders Hejlsberg
28c9f5933a Complete support for rest elements in tuples 2018-06-24 14:32:41 -10:00
Wesley Wigham
c441451f83
Cache specifier resolutions for speed when emitting many types from the same place (#25112)
* Cache specifier resolutions for speed when emitting many types from the same place

* I swear I accepted this once already
2018-06-22 14:05:07 -07:00
Anders Hejlsberg
b0d8c6551e Merge branch 'master' into restTuples
# Conflicts:
#	src/compiler/checker.ts
2018-06-22 06:10:50 -10:00
Wenlu Wang
51e7ae0813 provide spelling suggestion for indexed access (#22225)
* provide spelling suggestion for indexed access

* update merge

* accept baseline

* fix suggession return type

* allow string or identifier on getSuggestionForNonexistentProperty

* fix lint
2018-06-21 13:40:41 -07:00
Ron Buckton
272e5554c8 Merge branch 'master' into gulpProjectRefs 2018-06-21 10:55:35 -07:00
Andy
3e50f502bb
Mark some Type[] and Signature[] as ReadonlyArray (#25099) 2018-06-21 09:57:14 -07:00
Sheetal Nandi
f506b28e95 Mark the declarations visible correctly when emit is disabled but asked to emit declarations for watch mode
Fixes #25068
2018-06-20 12:28:50 -07:00
Andy
b3f9ec3796
Fix bug: Still implement a method even if the return type is defined in another file (#24978) 2018-06-19 16:36:18 -07:00
Ron Buckton
891b15f60a Update gulpfile to support project references 2018-06-18 22:45:13 -07:00
Anders Hejlsberg
4f99bc19c8 Merge branch 'master' into restTuples
# Conflicts:
#	tests/baselines/reference/APISample_Watch.errors.txt
#	tests/baselines/reference/APISample_WatchWithDefaults.errors.txt
#	tests/baselines/reference/APISample_WatchWithOwnWatchHost.errors.txt
#	tests/baselines/reference/APISample_compile.errors.txt
#	tests/baselines/reference/APISample_jsdoc.errors.txt
#	tests/baselines/reference/APISample_linter.errors.txt
#	tests/baselines/reference/APISample_parseConfig.errors.txt
#	tests/baselines/reference/APISample_transform.errors.txt
#	tests/baselines/reference/APISample_watcher.errors.txt
#	tests/baselines/reference/api/tsserverlibrary.d.ts
#	tests/baselines/reference/api/typescript.d.ts
2018-06-16 07:47:30 -07:00
Ryan Cavanaugh
73844ac565 Accept baseline 2018-06-15 11:10:54 -07:00
Ryan Cavanaugh
8491f70379 Merge branch 'master' into esau-squash
# Conflicts:
#	tests/baselines/reference/api/typescript.d.ts
2018-06-14 11:25:00 -07:00
Ryan Cavanaugh
1bbe6610a4 Merge branch 'master' into esau-squash 2018-06-13 15:35:18 -07:00
Ryan Cavanaugh
066b191982 Collapse core/compiler/parser into parser 2018-06-11 17:07:58 -07:00
Ryan Cavanaugh
336c37662d Projzilla phase 1 2018-06-09 16:48:08 -07:00
Ryan Cavanaugh
f4fcb1912c
Merge pull request #24465 from RyanCavanaugh/tsbuild
"tsc -b" with minimal watch capabilities
2018-06-10 05:15:53 +12:00
Andy
04187bde8d
fixStrictClassInitialization: Support array initializer (#24810) 2018-06-08 15:56:56 -07:00
Andy
48dedacf3b
fixStrictClassInitialization: Don't provide a default for string or number (#24767)
* fixStrictClassInitialization: Don't provide a default for `string` or `number`

* Update baselines
2018-06-07 15:03:38 -07:00
Ryan Cavanaugh
cf87bd446d Merge branch 'master' into tsbuild 2018-06-05 14:55:51 -07:00
Wesley Wigham
d9b93903c0
Use more nodelike paths for import types when possible (#24610)
* Use more nodelike paths for import types when possible

* move functionality from services into compiler, fix with propert file/directory conflict handling

* mark suspect cast
2018-06-05 12:54:36 -07:00
Ryan Cavanaugh
45842a0c34 Merge remote-tracking branch 'weswigham/sourcemap-concatenation-station' into tsbuild 2018-06-05 12:31:32 -07:00
Andy
735a46f838
If parsing a function type fails, parseTypeReference() to ensure something is returned (#24567)
* If parsing a function type fails, parseTypeReference() to ensure something is returned

* Avoid tryParse

* Add missing semicolon

* Don't check for undefined, check for missing type

* Don't set parameters undefined, set to missingList and return false

* Update API baselines

* Code review
2018-06-05 10:24:37 -07:00
Ron Buckton
666841264c Merge branch 'master' into libReference 2018-06-04 14:38:56 -07:00
Ryan Cavanaugh
9b0dc37f42 Merge branch 'fixMissingScriptInfo' into tsbuild 2018-06-04 10:59:42 -07:00
Ryan Cavanaugh
7e9e29ce64 Store + use the resolved path of sourceFiles in proj. ref. scenarios 2018-06-01 13:20:57 -07:00
Sheetal Nandi
b0f039c9e2 Make suggestion diagnostics to wire cancellationToken
This especially needed if its a js file without the ts-check, the file wont be typechecked in getSemanticDiagnostics
Fixes part of #19458
2018-05-31 10:47:17 -07:00
Ron Buckton
b4e113b94e Merge branch 'master' into libReference 2018-05-31 10:02:08 -07:00
Ron Buckton
7de55fbb7e PR Feedback 2018-05-31 09:50:51 -07:00
Wesley Wigham
8adbf85e0e
Candidate sectional sourcemap emit implementation 2018-05-30 17:53:26 -07:00
Ryan Cavanaugh
f8c4301f14 Add more errors; commandline help for --build; invalid flag combo detection 2018-05-30 10:00:35 -07:00
Ron Buckton
ec0af20f5a Merge branch 'master' into libReference 2018-05-29 14:13:00 -07:00
Anders Hejlsberg
03f464f433 Add 'unknown' keyword to scanner/parser/emitter 2018-05-26 08:51:09 -07:00
Anders Hejlsberg
8f193b40ee Free up one bit in TypeFlags 2018-05-26 08:29:30 -07:00
Ryan Cavanaugh
8936b030cd Merge branch 'master' into tsbuild 2018-05-24 13:01:58 -07:00
Andy
e53e56cf82
Enable '--strictNullChecks' (#22088)
* Enable '--strictNullChecks'

* Fix API baselines

* Make sys.getEnvironmentVariable non-nullable

* make properties optional instead of using `| undefined` in thier type

* reportDiagnostics should be required

* Declare firstAccessor as non-nullable

* Make `some` a type guard

* Fix `getEnvironmentVariable` definition in tests

* Pretend transformFlags are always defined

* Fix one more use of sys.getEnvironmentVariable

* `requiredResponse` accepts undefined, remove assertions

* Mark optional properties as optional instead of using `| undefined`

* Mark optional properties as optional instead of using ` | undefined`

* Remove unnecessary null assertions

* Put the bang on the declaration instead of every use

* Make `createMapFromTemplate` require a parameter

* Mark `EmitResult.emittedFiles` and `EmitResult.sourceMaps` as optional

* Plumb through undefined in emitLsit and EmitExpressionList

* `ElementAccessExpression.argumentExpression` can not be `undefined`

* Add overloads for `writeTokenText`

* Make `shouldWriteSeparatingLineTerminator` argument non-nullable

* Make `synthesizedNodeStartsOnNewLine` argument required

* `PropertyAssignment.initializer` cannot be undefined

* Use one `!` at declaration site instead of on every use site

* Capture host in a constant and avoid null assertions

* Remove few more unused assertions

* Update baselines

* Use parameter defaults

* Update baselines

* Fix lint

* Make Symbol#valueDeclaration and Symbol#declarations non-optional to reduce assertions

* Make Node#symbol and Type#symbol non-optional to reduce assertions

* Make `flags` non-nullable to reduce assertions

* Convert some asserts to type guards

* Make `isNonLocalAlias` a type guard

* Add overload for `getSymbolOfNode` for `Declaration`

* Some more `getSymbolOfNode` changes

* Push undefined suppression into `typeToTypeNodeHelper`

* `NodeBuilderContext.tracker` is never `undefined`

* use `Debug.assertDefined`

* Remove unnecessary tag

* Mark `LiteralType.freshType` and `LiteralTupe.regularType` as required
2018-05-22 14:46:57 -07:00
Andy
7106a587cc
Add type for diagnostics where location is defined (#23686)
* Add type for diagnostics where location is defined

* getSemanticDiagnostics may return global diagnostics

* Reduce array creation
2018-05-22 11:01:18 -07:00
Andy
982c8d0af9
Add suggestion diagnostics for unused label and unreachable code (#24261)
* Add suggestion diagnostics for unused label and unreachable code

* Always error on unused left hand side of comma
2018-05-22 07:56:29 -07:00
Ryan Cavanaugh
7e0825a3e7 Clean, etc 2018-05-21 17:47:58 -07:00
Ryan Cavanaugh
b1dedf2540 WIP 2018-05-21 13:05:14 -07:00
Anders Hejlsberg
3fc3df3c3a
Merge pull request #24137 from Microsoft/fix23977
Optimize intersections of unions of unit types
2018-05-17 13:15:28 -07:00
Wesley Wigham
3fc727b256
Use import types to refer to declarations in declaration emit (#24071)
* Stand up a simple implementation using import types for exports of modules which are otherwise inaccessible

* Ensure references exist to link to modules containing utilized ambient modules

* Accept baselines with new import type usage

* Fix lint
2018-05-17 13:08:22 -07:00
Nathan Shively-Sanders
aa7e2b0f07
Add callback tag, with type parameters (#23947)
* Add initial tests

* Add types

* Half of parsing (builds but does not pass tests)

* Parsing done; types are uglier; doesn't crash but doesn't pass

* Bind callback tag

Builds but tests still don't pass

* Only bind param tags inside callback tags

* Fix binding switch to only handle param tags once

* Checking is 1/3 done or so.

Now I'm going to go rename some members to be more uniform. I hate
unnnecessary conditionals.

* Rename typeExpression to type (for some jsdoc)

(maybe I'll rename more later)

* Rename the rest of typeExpressions

Turns out there is a constraint in services such that they all need to
be named the same.

* Few more checker changes

* Revert "Rename the rest of typeExpressions"

This reverts commit f41a96b24d44a6b696d39eee9e91ef7f606bea52.

* Revert "Rename typeExpression to type (for some jsdoc)"

This reverts commit 7d2233a00e5c6d794c1de32c03802e8ccce1914c.

* Finish undoing typeExpression rename

* Rename and improve getTypeParametersForAliasSymbol

Plus some other small fixes

* Core checking works, but is flabbergastingly messy

I'm serious.

* Callback return types work now

* Fix crash in services

* Make github diff smaller

* Try to make github diff even smaller

* Fix rename for callback tag

* Fix nav bar for callback tag

Also clean up some now-redundant code there to find the name of typedefs.

* Handle ooorder callback tags

Also get rid of redundant typedef name code *in the binder*. It's
everywhere!

* Add ooorder callback tag test

* Parse comments for typedef/callback+display param comments

* Always export callbacks

This requires almost no new code since it is basically the same as
typedefs

* Update baselines

* Fix support for nested namespaced callbacks

And add test

* Callbacks support type parameters

1. Haven't run it with all tests
2. Haven't tested typedef tags yet
3. Still allows shared symbols when on function or class declarations.

* Template tags are now bound correctly

* Test oorder template tags

It works.

* Parser cleanup

* Cleanup types and utilities

As much as possible, and not as much as I would like.

* Handle callback more often in services

* Cleanup of binder and checker

* More checker cleanup

* Remove TODOs and one more cleanup

* Support parameter-less callback tags

* Remove extra bind call on template type parameters

* Bind template tag containers

Doesn't quite work with typedefs, but that's because it's now stricter,
without the typedef fixes. I'm going to merge with jsdoc/callback and
see how it goes.

* Fix fourslash failures

* Stop pre-binding js type aliases

Next up, stop pre-binding js type parameters

* Further cleanup of delayed js type alias binding

* Stop prebinding template tags too

This gets rid of prebinding entirely

* Remove TODO

* Fix lint

* Finish merge with use-jsdoc-aliases

* Update callback tag baselines

* Rename getTypeParametersForAliasSymbol

The real fix is *probably* to rename Type.aliasTypeArguments to
aliasTypeParameters, but I want to make sure and then put it in a
separate PR.
2018-05-17 09:28:11 -07:00
Wesley Wigham
e01c7d23e1
Correctly show instantiated signatures for JSX element signature help and quick info (#23492)
* Correctly show instantiated signatures for JSX element signature help

* Also bundle fix for quickinfo

* Use more complete cache to avoid duplicate errors
2018-05-16 13:09:54 -07:00