Commit Graph

29618 Commits

Author SHA1 Message Date
Daniel Rosenwasser
870cd7b603 Update LKG for 3.8.2. 2020-02-14 15:41:36 -08:00
Daniel Rosenwasser
203ed3ec44 Bump version to '3.8.2'. 2020-02-14 15:39:03 -08:00
TypeScript Bot
1f660074f4 🤖 Cherry-pick PR #36807 into release-3.8 (#36810)
Component commits:
ec495ab121 Fix organizeImports with type-only imports

Co-authored-by: Andrew Branch <andrewbranch@users.noreply.github.com>
2020-02-14 15:38:06 -08:00
Klaus Meinhardt
051eee00c9 Exempt ambient private properties from noImplicitAny (#36640) 2020-02-14 15:04:35 -08:00
Andrew Branch
5a2fa49205 Cherry-pick release bugs (#36804)
* Fix renaming an ExportSpecifier name when propertyName is present (#36790)

* Fix renaming exportSpecifier name when propertyName is present

* Add baseline test for name without propertyName too

* Set correct pos for NamespaceExport (#36794)

* Set correct pos for NamespaceExport

* Update tests
2020-02-14 13:44:37 -08:00
TypeScript Bot
e7fec6d565 🤖 Cherry-pick PR #36785 into release-3.8 (#36786)
Component commits:
206d39e9b5 Add/convert to failing tests.

11e827ba84 Stop offering to convert single string literals to template expressions.

7d3ad0c8f6 Ensure we're actually testing for single quotes.

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
2020-02-13 12:23:16 -08:00
TypeScript Bot
1986a5faa3 🤖 Cherry-pick PR #36751 into release-3.8 (#36757)
Component commits:
ebbba5bd8f fix(36416): empty import path causes server crash

Co-authored-by: Alexander T. <alexander.tarasyuk@outlook.com>
2020-02-12 14:49:54 -08:00
Sheetal Nandi
5f623b2e21 Handle walkThroughSnippet:/ and untitled:/ as dynamic files (#36722) (#36760)
Handle walkThroughSnippet:/ and untitled:/ as dynamic files
Fixes #36681
2020-02-12 14:02:58 -08:00
TypeScript Bot
94b98f41d8 Update user baselines (#36729) 2020-02-10 16:43:22 -08:00
TypeScript Bot
ae8dc2f610 Cherry-pick PR #36663 into release-3.8 (#36726)
Component commits:
6aaf9845e7 Allow intersections (and substitutions) to be checks against discriminable unions

Co-authored-by: Wesley Wigham <wwigham@gmail.com>
2020-02-10 16:00:56 -08:00
Andrew Casey
fb868964fc Make Response.performanceData public (#36621) 2020-02-05 13:34:23 -08:00
Daniel Rosenwasser
0026225e78 Update LKG. v3.8-rc 2020-02-05 13:06:35 -08:00
Orta
eaf97e057c De-duplicate indentations in JSX Texts (#36552)
* WIP on making the JSX text node not include whitespace

* Scans to the last newline for JSX correctly

* Handle JSX closing element wrapping

* Offload all jsx text indentation handling to indentMultilineCommentOrJsxText

* Switch from find node -> find inde in formatting

Co-authored-by: Wesley Wigham <wwigham@gmail.com>
2020-02-05 13:03:09 -08:00
Daniel Rosenwasser
e6f4a0f59c Update LKG. 2020-02-05 12:24:47 -08:00
Andrew Branch
ede2f43c80 Fix crash when trying to import a non-exported type (#36619) (#36634)
* Fix crash when trying to import a non-exported type

* Add related info on each declaration
2020-02-05 12:03:43 -08:00
Wesley Wigham
68cbe9e7b4 Also edit the cherry-pick script to handle non-master base branches while we are here 2020-02-05 11:02:49 -08:00
Wesley Wigham
212edf8948 Patch cherry pick script for new octokit 2020-02-05 11:02:31 -08:00
TypeScript Bot
0d93d67615 Update user baselines (#36568) 2020-02-03 12:56:36 -08:00
Daniel Rosenwasser
6396f8e4a5 Update LKG. 2020-01-31 18:20:33 -08:00
Daniel Rosenwasser
e842d8d6f9 Bump version to 3.8.1-rc 2020-01-31 18:15:30 -08:00
Daniel Rosenwasser
2a5ba1d7ef Merge branch 'master' into release-3.8 2020-01-31 18:13:44 -08:00
Andrew Branch
ef8eb0c876 Fix contextually typed object literal completions where the object being edited affects its own inference (#36556)
* Conditionally elide a parameter from contextual type signature calculation

* Slightly different approach to forbid inference to specific expressions

* Handle nested literals and mapped types correctly

* Delete unused cache

* Rename ContextFlags.BaseConstraint and related usage

* Add tests from my PR

* Update ContextFlags comment

Co-Authored-By: Wesley Wigham <wwigham@gmail.com>

* Update comments and fourslash triple slash refs

Co-authored-by: Wesley Wigham <wwigham@gmail.com>
2020-01-31 15:37:18 -08:00
Nathan Shively-Sanders
ad249043da resolvedJSDocType should cache on node, not symbol (#36561) 2020-01-31 15:19:45 -08:00
Andrew Branch
86556d6c03 Fix export * that resolves to something type-only (#36558)
* Fix `export *` that resolves to something type-only

* Add same tests but non-tsserver
2020-01-31 15:09:27 -08:00
Ron Buckton
8db1d7bc6d Do not adjust location for import/export keywords with more than one possible binding (#36560) 2020-01-31 14:58:30 -08:00
Ron Buckton
9a357c19f3 Fix wrong script info used to resolve line/offset for call hierarchy items (#36559) 2020-01-31 14:41:25 -08:00
Ron Buckton
01af3aa483 Support 'find references' on most declaration-related keywords (#36490)
* Allow 'find references' to work on most declaration keywords

* Add support for rename

* Add more keywords, move logic out of checker and into services

* Add additional type and expression keywords
2020-01-31 11:53:57 -08:00
Ron Buckton
afddaf090a Fix declaration for Array.prototype[Symbol.unscopables] (#36540) 2020-01-31 10:42:02 -08:00
Ron Buckton
fcf28506aa Fix overzealous renaming of emit helpers in es module emit (#36541) 2020-01-31 10:41:47 -08:00
Ron Buckton
24d8f795b2 Fix crash in emitTokenWithComment (#36542) 2020-01-31 10:41:09 -08:00
Sheetal Nandi
80ad0de87e Fixes to handle file names in module resolution watching and createGetCanonicalFileName (#36106)
* Add test case to verify directory casing preservation when watching

* Fix unicode file name handling when watching failed lookup locations

* Add special file name lower conversion routine and use that instead of toLowerCase
Fixes #31819 and #35559

* Remove unicode from code

* Replace toLocaleLowerCase on filenames with ts.toFileNameLowerCase

* Make the intent of using toFileNameLowerCase more clear and why we make the restriction on turkish I with dot on top of it

* Update baselines for newly added tests in master
2020-01-31 10:40:57 -08:00
Eli Barzilay
ad8feb5f90 Filter out private fields in string literal property completions.
Also some minor simplifications.

Fixes 36082.
2020-01-30 22:42:32 -05:00
Eli Barzilay
75d1ead3fd Improvements based on @sandersn's notes 2020-01-30 22:42:04 -05:00
Eli Barzilay
1a1ed7464d Add a similar test for target.symbol.valueDeclaration
(With the same question still open.)
2020-01-30 22:42:04 -05:00
Eli Barzilay
68a9d4592f Avoid testing isClassDeclaration if there's no valueDeclaration
I'm not sure if this is enough -- perhaps it's better to make the test
dig through the interface/s to the class?

Fixes 36059.
2020-01-30 22:42:04 -05:00
Ron Buckton
f24f36350b Fixes JSX attribute escaping when parent pointers are missing (#35743)
* Fixes JSX attribute escaping when parent pointers are missing

* Fix whitespace change
2020-01-30 16:52:31 -08:00
Hye Sung Jung
8ed129771f fix spelling errors (#36523)
* fix spelling errors

* remove changes in lib/*
2020-01-30 13:39:54 -08:00
Alexander T
bfff11530f fix(35069): insert blank line after last new import (#36531) 2020-01-30 11:20:09 -08:00
Sheetal Nandi
4c378c09dc Report config file parsing diagnostics correctly with tsc --b (#36520)
* Refactor the test

* Add tests for syntax errors in tsconfig not being reported

* Report config file parsing diagnostics correctly
Fixes #36515

* Fix errors in existing tests for unintended tsconfig parse errors

* Fix lint
2020-01-30 11:18:06 -08:00
Nathan Shively-Sanders
c1e45ac8af Fix use-before-def errors for ESNext property declarations (#36465)
* Fix use-before-def errors for ESNext property declarations

Fixes #36441
Fixes #36442

* Handle property declarations in nested classes
2020-01-30 10:58:07 -08:00
Anders Hejlsberg
8a0b8822b2 Fix contextually typed parameter issues (#36476)
* Fix multiple issues with contextually typed parameters

* Accept new baselines

* Fix lint error

* Add tests

* Address CR feedback

* Add fourslash tests
2020-01-30 10:50:39 -08:00
Wesley Wigham
140fee96d7 Capture fakes.version instead of the current version string in baselines (#36518)
* Capture CURRENT.VERSION instead of the current version string in baselines

* Use fakes.version

* Move replacer into patchHostForBuildInfoReadWrite
2020-01-29 16:15:09 -08:00
Andrew Branch
2fac535158 Fix type-only imports in interface 'extends' and import=/export= (#36496)
* Handle when files get checked in different orders

* Fix interface extends clause

* Fix import= something type only from a module

* Revert apparently unnecessary addition

* Revert "Revert apparently unnecessary addition"

This reverts commit 7444b0b72e.

* Disallow `import = a.b.c` on anything with type-only imports

* Safety first

* Add test for TS Server single-file open

* Add big comment

* Extract error reporting function for import aliases

* Delete blank line

* Un-export, comment, and colocate some utils

* Combine 3 type-only marking function calls into one

* Add more export default tests
2020-01-29 15:00:17 -08:00
Wesley Wigham
aec732a898 Actually use the caches resolvedJSDocType (#36516) 2020-01-29 14:58:06 -08:00
Nathan Shively-Sanders
36169b4d13 Class fields w/esnext+[[Define]]:no shadow error (#36405)
* Class fields w/esnext+[[Define]]:no shadow error

With useDefineForClassFields: true and ESNext target, initializer
expressions for property declarations are evaluated in the scope of
the class body and are permitted to reference parameters or local
variables of the constructor. This is different from classic
Typescript behaviour, with useDefineForClassFields: false. There,
initialisers of property declarations are evaluated in the scope of
the constructor body.

Note that when class fields are accepted in the ECMAScript
standard, the target will become that year's ES20xx

* add negative test case

* Add explanatory comment
2020-01-29 14:47:44 -08:00
Nathan Shively-Sanders
8da3eff7b0 Subtypes of ErrorConstructor extend it (#35549)
Previously subtypes of Error extended Error, but the matching subtypes
of ErrorConstructor did not extend ErrorConstructor. The members in
es5.d.ts are identical, so there's no need except for allowing interface
merging into ErrorConstructor to affect subtypes as well.
2020-01-29 13:26:00 -08:00
Nathan Shively-Sanders
1bbcb5553a @typedef's nested Object syntax disallows type arguments (#36172)
Previously the jsdoc index signature syntax was incorrectly treated the
same as Object:

```js
/** @typedef {Object} AllowsNesting
 * @property ... */
/** @typedef {Object.<string,string>} IncorrectlyAllowsNesting */
```

Fixes #34911
2020-01-29 12:53:00 -08:00
Sheetal Nandi
502e711235 Dont use sourcemap if it contains inlined sources (#36384)
Fixes #35014
2020-01-29 11:21:42 -08:00
Andrew Casey
566202f55d Fix commas in JSON (#36497) 2020-01-29 10:50:03 -08:00
Nathan Shively-Sanders
c42ef575be createPrivateIdentifier: names must start with # (#36506) 2020-01-29 10:11:30 -08:00