Commit graph

32005 commits

Author SHA1 Message Date
Oleksandr T 3a22b3e701
fix(43535): preserves 'override' modifier in JavaScript output (#43536) 2021-04-06 11:31:54 -07:00
TypeScript Bot a56baa7394
Update user baselines +cc @sandersn (#42842)
Co-authored-by: typescript-bot <typescript@microsoft.com>
2021-04-06 08:58:43 -07:00
Pig Fang fb87079994
Enforce override precedes readonly (#43545) 2021-04-06 08:48:44 -07:00
Oleksandr T 8581a592bb
fix(43347): fix crash occurred when export type to existing commonJs imported name (#43369) 2021-04-06 08:46:22 -07:00
Wenlu Wang f526a38856
Always grammar checker for override (#43544) 2021-04-06 07:29:57 -07:00
Zen 3cf26e44ee
fix(43160): improve error location for functions without explicit return (#43367)
* fix(43160): improve error location for functions without explicit return

* handle functions returning never
2021-04-06 07:21:02 -07:00
Michael サイトー 中村 Bashurov 3b06ef1a73
Add asserts to type only symbols meaning exclusion (#43382)
Fixes #42180
2021-04-05 15:29:51 -07:00
Andrew Branch ffe925ddd5
Go to definition: pass unverified through server (#43483)
* Pass `unverified` through server

* Update protocol baseline

* Fix unit tests

* Fix other tests
2021-04-05 13:42:25 -07:00
Sheetal Nandi 4b556e37db
Handle document Registry to distinguish between files with same name and document registry key(compiler options affecting source file) but different ScriptKind (#43474)
* Test that fails because of change in scriptKind of untitled file

* buckets are keyed with DocumentRegistryBucketKey

* Use scriptKind in document Registry to distinguish between files
Fixes #42613
2021-04-05 13:27:34 -07:00
Song Gao 2d66517312
fix quickinfo of narrowed private filed (#43356)
* fix quickinfo of narrowed private filed

* add test case.

* adapt review.
2021-04-05 13:24:19 -07:00
Anders Hejlsberg a7a010a994
Fix getRecursionIdentity function to always return some identity (#43527)
* Fix getRecursionIdentity, undo changes from #43435 (but keep tests)

* Remove test that takes excessively long to run

* Accept new baselines

* Fix formatting

* Add regression tests

* Reinstate test
2021-04-05 09:53:38 -10:00
Zuckjet f621d67467
fix(42605): support refactoring for export default assignment without equal (#42936) 2021-04-05 11:59:45 -07:00
Wesley Wigham cf8798d977
Make origin union cache key unique for key lists still under construction (#43339) 2021-04-05 11:47:49 -07:00
Wesley Wigham d1b43429c2
Allow nested reverse mapped type printback (#42485)
* Optimize interning of reverse mapped types

* Style feedback

* Whitespace

* Update baseline
2021-04-05 11:37:51 -07:00
Wesley Wigham 1f1dcd60b5
When reusing input type nodes, only instantiate the type for comparison if it is a this type (#42584) 2021-04-05 11:10:47 -07:00
Oleksandr T 5268264e64
fix(43316): omit to suggest converting to async function if a void is explicitly returned (#43358) 2021-04-05 11:09:33 -07:00
Wesley Wigham f03e59ecc9
Do not covariantly mix in constraints from contravarrying positions (#43439)
* Do not covariantly mix in constraints from contravarrying positions

* Exclude keyof from constraint variance tracking

* Extra test case

* Always subtitute on type parameter types
2021-04-05 11:05:33 -07:00
Nathan Shively-Sanders 2f36065588
Add grunt user test (#43510)
* Add grunt user test

* remove unneeded submodule
2021-04-05 09:22:41 -07:00
TypeScript Bot 889a103681 Update package-lock.json 2021-04-05 06:08:00 +00:00
TypeScript Bot 61a9a883a1 Update package-lock.json 2021-04-04 06:07:40 +00:00
TypeScript Bot dfc380aeea Update package-lock.json 2021-04-03 06:07:38 +00:00
Josh Goldberg 38da7c600c
Disabled 'used before initialization' error for optional properties (#43100)
* Disabled 'used before initialization' error for optional properties

* Expanded tests to include code snippet from issue
2021-04-02 10:08:10 -07:00
Sang f9b35cd302
Add @link jsdoc auto-complete (#43475)
* feat(services): jsdoc add link tag name

* test: add jsdoc inline test
2021-04-01 17:02:50 -07:00
Nathan Shively-Sanders c6a2e45768
Add @deprecated to tree walk (#43473)
So various things don't crash. Fixes #43472
2021-04-01 08:42:00 -07:00
Armando Aguirre 8f8a579eee
Added BindingElement to isSomeImportDeclaration (#43387)
* Added BindingElement to isSomeImportDeclaration

* Added tests

* Refactores to use getDeclarationOfAlias
2021-03-31 18:18:16 -07:00
Wenlu Wang 62f3ccd9c0
Error if assignment after block (#41115)
* Error if assignment after block

* Update src/compiler/diagnosticMessages.json

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>

* Fix diags

* Error after block

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2021-03-31 15:57:25 -07:00
Nathan Shively-Sanders 76a2ae3d69
Only issue matching token errors on non-dupe locations (#43460)
* Only issue matching token errors on non-dupe locations

Intead of unconditionally retrieving the last error and attaching a
related span, `parseErrorAt` and friends now return the last error and
return `false` when there is none.

Also make one more place use parseExpectedMatchingBrackets that I missed
last time.

* Inline parseTokenForError, return undefined not false

* skip redundant undefined assignment

* address PR comments
2021-03-31 13:54:53 -07:00
TypeScript Bot 5b7838e6fa Update package-lock.json 2021-03-31 06:08:04 +00:00
Sheetal Nandi d51b8cff6a
Do not delete output file names that are same as input file name (#43448)
* Add failing test case

* Do not delete output file names that are same as input file name
Fixes #43116
2021-03-30 16:04:25 -07:00
Anders Hejlsberg 3dd68b878a
Fix template literal type relations (#43440)
* Fix template literal relationships

* Accept new baselines

* Add regression test
2021-03-30 12:53:15 -10:00
Oleksandr T 819651eb5f
fix(43313): add parentheses to a type assertions (#43315) 2021-03-30 15:29:02 -07:00
Sang a8ee22f73d
"fix(services): convert to es6 module generate invalid code with .default" (#43309) 2021-03-30 15:24:31 -07:00
Andrew Branch b549467368
Consider base types in isArrayLikeType (#43435)
* Types that extend Array or ReadonlyArray are automatically array-like

* Add React repro to test
2021-03-30 13:18:38 -07:00
keerthana1212 555ef73da8
Adding Diagnostic message for missing ']' and ')' in Array literal and conditional statements (#40884)
* Adding Diagnostic message for missing ']' in Array literal

* revert change on parseArrayBindingPattern

* Adding diagnostic message for if, while, do and with statements

* Extract parseExpectMatchingBrackets

Co-authored-by: Keerthana Kanakaraju <kekanaka@microsoft.com>
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2021-03-30 13:13:57 -07:00
Ryan Cavanaugh 294a5a7d78
Remote duplicated assignment (#43399) 2021-03-29 21:30:45 -07:00
Oleksandr T 6fd676b8ef
fix(43215): disallow using never as an interface name (#43217) 2021-03-29 17:22:41 -07:00
Josh Goldberg 57775ed405
Consider class field properties to redeclare parent definitions (#43194) 2021-03-29 17:20:25 -07:00
Eli Barzilay c34b252e1e Fix length of JSDocTypedefTag
(Accidentally broken in dcc27eb.)

Fixes #43394 and microsoft/tsserverfuzzer#309.
2021-03-29 16:06:53 -04:00
Daniel Rosenwasser a3d207a905
Improve (and actually use) "always truthy promise" error (#43023)
* Modify error message and actually use the error message.

* Accepted baselines.
2021-03-29 12:44:05 -07:00
Greg Finley 11097c622c
Fix typo (#43404)
* Fix typo

* Fix off baseline

Co-authored-by: Orta <git@orta.io>
2021-03-29 12:14:44 +01:00
TypeScript Bot b1571fcb71 Update package-lock.json 2021-03-29 06:12:40 +00:00
Anders Hejlsberg 4774666f23
Support relations and inference between template literal types (#43361)
* Support assignment and inference between template literal types

* Add tests

* Accept new baselines

* Add comments
2021-03-28 13:11:56 -07:00
Ryan Cavanaugh 451089e8ef
Rename isWrite -> writing (#43405) 2021-03-27 21:56:50 -07:00
TypeScript Bot 2ac888bf5f Update package-lock.json 2021-03-27 06:10:02 +00:00
Ryan Cavanaugh ff233a9ac2
Variant accessors (#42425)
Allows accessors to have different access modifiers and types

Fixes #2845, #2521
2021-03-26 20:11:02 -07:00
Wenlu Wang 2f0c8b2bea
--noImplicitOverride (#39669)
* wip: add types

* wip

* Add cases

* Add some case

* Add more check

* accept baseline

* add abstract abd declare method

* add override in declaration

* accept baseline

* add property override

* Fix decalre modifier

* update baseline

* Add more cases

* make lint happy

* make lint happy

* Update description

* Add codefix

* simplify code

* accept baseline

* Update desc

* Accept baseline

* Add override completions

* filter out implements field in override context

* fix tests

* Add parameter property check

* Accept baseline

* acept baseline

* Add parameter property to declaration code action

* Add quickfix for override parameter property

* fix code style

* Add override with interface tests

* Add more cases about modifier position

* rename flag

* rename flags

* Added tests.

* Accepted baselines.

* Always issue errors for unnecessary 'override' modifiers.

* Accepted baselines.

* Override perf (#4)

* try cache check result

* pre check for override

* Do not issue error if implement abstract

* Add abstract-spec check

* Avoid override dead lock

* Add more case

* Add codefix for new error

* Fix error message

* Add jsdoc override tag (#6)

* Override jsdoc tag (#7)

* accept baseline

* Disallow codefix in js

* update baseline

* Omit override in d.ts

* Add more case in js

* Accept baseline

* fix override js test

* fix crlf

* Revert merge conflict changes

* Accept baseline

* Avoid space

* Fix CR issues

* Accept baseline

* Fix typo and add more check

* Fix error name

Co-authored-by: Daniel Rosenwasser <Daniel.Rosenwasser@microsoft.com>
2021-03-26 16:29:22 -07:00
Wenlu Wang 41dc625b0a
Add static index signature (#37797)
* Add static index

* fix lint

* make lint happy

* adjust test cases

* add more cases

* fix changes

* Add more case

* accept baseline

* fix error if extends others

* Update vfsUtil.ts

* use equal to empty array

* static signature of interface is an error

* Accept baseline

* Check index constraints for static signature

* Accpet baseline

* Fix crash

* fix crash

* Accept baseline

* Fix regression

* Fix crash

* always return new array
2021-03-26 15:30:09 -07:00
Andrew Branch 2d6a490363
Import statement completions (#43149)
* WIP

* WIP

* Get completion details working

* Start unifying eager and lazy auto imports

* Fix export=

* Fix completion details for totally misspelled names

* Almost fixed duplication...

* Fix remaining completion tests

* Refactor to support multiple origins for same symbol

* Make import fixes make slightly more sense

* Add cache back in

* Set insertText based on import kind

* Update API baselines

* Add semicolons, snippet support, and sourceDisplay

* Add some tests

* Update baselines

* Fix pattern ambient modules appearing in auto imports

* Fix tests

* Remove commented code

* Switch to valueDeclaration for getting module source file

* Small optimizations

* Cache module specifiers / importableness and export map separately

* Fix and test cache invalidation logic

* Update API baselines

* Add separate user preference for snippet-formatted completions

* Require first character to match when resolving module specifiers

* Fix AutoImportProvider export map cache invalidation

* Really fix auto import provider export map invalidation

* Update test added in master

* Use logical or assignment

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>

* Simply conditional by reversing

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>

* When file is deleted need to marked correctly in the project as removed file

* Simplify hasAddedOrRemovedSymlinks with cherry-picked fix

* Ensure replacement range is on one line

* Update baselines

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
Co-authored-by: Sheetal Nandi <shkamat@microsoft.com>
2021-03-26 14:47:07 -07:00
Sheetal Nandi a545ab1ac2
Cache resolved project references and watch wild card directories from them to update them (#42929)
* Test for not watchiong referenced projects fileNames and invalidating it

* Add watching wild card directories and caching parsed command line for projects so that its shared

* Handle config file watching and commandline cache together

* Watch extended files for commndline cache instead of project

* Use extended config cache now that we are watching extended config files

* Structure for getParsedCommandLine from the LS

* Adding some more skeleton with todos

* getParsedCommandLine on WatchCompilerHost

* Tests for Watch, LS scenarios

* Handle getParsedCommandLine so we are looking at all things for referenced

* Cleanup and commenting

* Test for transitive references with tsc-watch

* Cache parsed command line even if host implements getParsedCommandLine

* Cleanup

* Cleanup

* Some tests to verify exclude from referenced project doesnt trigger the update

* Baseline when program is same

* Test for incremental scenario

* Tests for output from referenced project

* Comments
2021-03-26 13:23:03 -07:00
Anders Hejlsberg a26acf4540
Template literal types for contextually typed template literal expressions (#43376)
* Template literal types for contextually typed template literal expressions

* Accept new baselines

* Add regression test

* Add a few more tests
2021-03-26 10:32:05 -07:00