34030 Commits

Author SHA1 Message Date
Andrew Casey
020ef41543
Add a simple queue implementation with better performance than Array.shift (#49623)
* Add a simple queue implementation with better performance than `Array.shift`

This lets us clean up the hack introduced in #49581

* Correct typo

Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>

Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
2022-06-24 10:07:28 -07:00
bentongxyz
b24b6a1125
fixes #49491 (#49493) 2022-06-22 13:25:01 -07:00
Oleksandr T
8636adbbb9
fix(49449): change error location when passing objects/arrays to an argument of type (#49593) 2022-06-22 10:06:01 -07:00
Jake Bailey
71b5bdf980
Ensure resolved signature is cached before processing call errors (#49598) 2022-06-21 13:15:03 -07:00
Gabriel Grubba
9f2ab7fc31
Fix(49473): Added docs for RegExpMatchArray (#49499)
* fix: added docs for RegExpMatchArray

* Accepted baselines.

* Accepted missing baselines.

* Accepted missing baselines pt2.
2022-06-21 12:30:07 -07:00
jordanmbell
db49c6c3ba
Add fractionalSecond part type to DateTimeFormat().formatToParts (#49569)
* Add fractionalSecond part type to DateTimeFormat().formatToParts

This change adds the `fractionalSecond` part type as a valid part
to be returned from Intl.DateTimeFormat().formatToParts().

Fixes microsoft#48882

* fixup
2022-06-21 07:52:24 -07:00
Anders Hejlsberg
529ba99e29
Use separate marker types for variance annotation validation (#49616)
* Use separate marker types for variance annotation validation

* Add regression test
2022-06-21 06:42:10 -07:00
TypeScript Bot
4c2770d769 Update package-lock.json 2022-06-21 06:06:24 +00:00
Oleksandr T
74d76e93b3
fix(49546): create computed property name for symbol props (#49554) 2022-06-20 13:46:47 -07:00
Oleksandr T
c01afb5ef3
fix(49548): show completions after keywords in block (#49600) 2022-06-20 12:52:28 -07:00
csigs
7eddb3a122
LEGO: Merge pull request 49612
LEGO: Merge pull request 49612
2022-06-20 02:59:46 -07:00
csigs
96d298c4bc
LEGO: Merge pull request 49602
LEGO: Merge pull request 49602
2022-06-19 03:01:39 -07:00
csigs
730e6117fd
LEGO: Merge pull request 49599
LEGO: Merge pull request 49599
2022-06-18 03:16:49 -07:00
Jake Bailey
d7e58c8ea9
Fix arrow expressions in conditional expressions, take N+1 (#49531) 2022-06-17 16:34:27 -07:00
Nathan Shively-Sanders
6004b35ce4
Update 4.8 DOM from Typescript-DOM-lib-generator (#49596) 2022-06-17 15:01:44 -07:00
Andrew Branch
7e7c53961a
Add TS Server option to exclude files from auto-imports (#49578)
* Basic functionality

* Add tests

* Add test for ambient modules

* Add to protocol
2022-06-17 14:39:51 -07:00
Andrew Branch
1213c35d57
Add error when importing/exporting types in JS files (#49580)
* Add error when importing/exporting types in JS files

* Ignore type-only imports, update other baselines

* Clean up
2022-06-17 14:39:24 -07:00
Jake Bailey
9f1983d8f4
Downgrade node-fetch back to v2 (#49592) 2022-06-17 11:19:42 -07:00
csigs
9534b2bd46
LEGO: Merge pull request 49590
LEGO: Merge pull request 49590
2022-06-17 03:21:55 -07:00
Wesley Wigham
5c4caafc2a
Allow nongeneric string mapping types to exist (#47050)
* Allow nongeneric string mapping types to exist

* Accept baseline

* Recusive membership testing function

* Fix lint

* Add @DanielRosenwasser's comment
2022-06-16 17:02:31 -07:00
Gabriela Araujo Britto
86d5040031
Fix renaming of node_modules (#49568)
* add bug repro test

* add test and start fix implementation

* adjust for useAlias preference

* fix existing renaming test

* refactor to get rid of options

* fix named bindings & other imports cases

* fix eslint error

* address cr comments

* hopefully actually fix eslint

* clean up stale baseline

* make API change non-breaking

* add/fix comments
2022-06-16 17:01:44 -07:00
Andrew Casey
01ba3a426b
Tune FAR aggregation (#49581)
* Tune FAR aggregation

In making the work queue management more intelligible, we centralized the redundancy check at dequeue time.  As a result, the queue tends to get very large (~1.6M items for `SyntaxKind` in this repo) and dequeuing via `shift` is too slow to do that many times.  This change makes a few tweaks:

1. Use `Project` identity for de-duping and only maintain a set of keys for `loadAncestorProjectTree`
2. Attempt to filter prior to insertion
3. Use `splice` if many consecutive work queue items will be discarded.

On my box, this cuts FAR for `SyntaxKind` in parser.ts from 38 minutes to 20 seconds (we could do better, but effectively decided not to optimize this worst case scenario).
2022-06-16 16:11:55 -07:00
Jake Bailey
734b9828a6
Update all depedencies, including ESLint 8, refresh lockfile (#49550) 2022-06-16 13:39:42 -07:00
Oleksandr T
f83ce9bd9c
fix(49566): Implicit this.property completions not returned while writing property (#49574)
* fix(49566): show this.prop completions in class scoped property declaration

* remove duplicate default value
2022-06-16 12:43:50 -07:00
TypeScript Bot
44d6b51281 Update package-lock.json 2022-06-16 06:06:33 +00:00
Oleksandr T
180bc4cbea
feat(49385): forbid inlay hints for some kind of initialized declarations (#49412)
.
2022-06-15 15:34:57 -07:00
Anders Hejlsberg
18ac37221b
Properly re-scan > token in type argument list determination logic (#49560)
* Properly re-scan '>' token in type argument list determination logic

* Add regression test
2022-06-15 12:06:08 -07:00
Wesley Wigham
ccd8b1d27e
Allow exports map entries to point at .ts source files (#48563)
* Probably works

* Add tests

* Update baselines for module option rename
2022-06-15 11:23:26 -07:00
Wesley Wigham
ba38fe1df2
Expand constraint suggestion related span and add quick fix (#49481)
* Expand constraint suggestion related span and add quick fix

* Remove circular constraint suggestions

* Add error code

* Style feedback and new error code in quickfix
2022-06-15 10:35:51 -07:00
Wesley Wigham
eb4b8a4d2e
Handle this in isEntityNameVisible (#49521) 2022-06-15 10:15:19 -07:00
TypeScript Bot
89d05f7131 Update package-lock.json 2022-06-15 06:06:27 +00:00
Jake Bailey
884f5ac258
Ensure scripts compile, are checked in strict mode (#49524) 2022-06-14 16:28:42 -07:00
Oleksandr T
0ada54c006
fix(49483): throw error on await inside non-async function (#49496) 2022-06-14 16:08:25 -07:00
Matt Bierner
3fc5f968ca
Enable TS Server plugins on web (#47377)
* Prototype TS plugins on web

This prototype allows service plugins to be loaded on web TSServer

Main changes:

- Adds a new host entryPoint called `importServicePlugin` for overriding how plugins can be loaded. This may be async
- Implement `importServicePlugin` for webServer
- The web server plugin implementation looks for a `browser` field in the plugin's `package.json`
- It then uses `import(...)` to load the plugin (the plugin source must be compiled to support being loaded as a module)

* use default export from plugins

This more or less matches how node plugins expect the plugin module to be an init function

* Allow configure plugin requests against any web servers in partial semantic mode

* Addressing some comments

- Use result value instead of try/catch (`ImportPluginResult`)
- Add awaits
- Add logging

* add tsserverWeb to patch in dynamic import

* Remove eval

We should throw instead when dynamic import is not implemented

* Ensure dynamically imported plugins are loaded in the correct order

* Add tests for async service plugin timing

* Update src/server/editorServices.ts

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>

* Partial PR feedback

* Rename tsserverWeb to dynamicImportCompat

* Additional PR feedback

Co-authored-by: Ron Buckton <ron.buckton@microsoft.com>
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2022-06-14 12:35:53 -07:00
uhyo
29dffc3079
Forbid unused property renaming in destructuring binding in function types (#41044)
* Forbid renaming a propertyin function type parameters

* add tests

* Remove renaming from declaration output

* accept baseline

* accept baseline

* renew tests (not very right now)

* get correct result

* update diagnostic text

* accept baseline

* add declaration emit test

* fix declaration emit

* fix formatting

* revert unnecessary change

* accept baseline

* extend tests

* Revert "revert unnecessary change"

This reverts commit 17a29fff6c4ce48e9c3f13b55332ce3411c90dc4.

* accept baseline

* Rename and refactor potentialAlways... stuff

* add non-identifier names

* extend check to non-identifier original property names

* update diagnostic message

* add related span

* accept baseline

* add symbol-keyed test case

* oops?

* workaround for unstable test

* fix suggested name

* add comment about non-identifier property names

* simplify isReferenced check

* accept baseline

* move it one step further
2022-06-14 12:13:49 -07:00
bentongxyz
dbab6eb898
fix #49235 Objects that pass the spread syntax can no longer be assigned to assignable types. (#49337)
* fix issue 49235

* update code with suggested changes

Co-authored-by: Benjamin Tong <benjamin.tong@iddy.ai>
2022-06-14 10:43:18 -07:00
Sheetal Nandi
4c1e8f2281
Fix incorrectly added resolution to resolutionsWithOnlyAffectingLocations (#49523) 2022-06-13 22:46:41 -07:00
Anders Hejlsberg
dc6a80bd00
Fresh {} is subtype of object (#49503)
* Fresh {} is subtype of object

* Add regression test
2022-06-13 12:21:51 -07:00
TypeScript Bot
2ecde27187 Update package-lock.json 2022-06-12 06:07:03 +00:00
csigs
3bc9c80c10
LEGO: Merge pull request 49494
LEGO: Merge pull request 49494
2022-06-11 03:48:51 -07:00
TypeScript Bot
f732a42bdf Update package-lock.json 2022-06-11 06:06:24 +00:00
Jake Bailey
e9ba547d6e
Eliminate (ts as any).SyntaxKind (and similar) in favor of Debug.format functions (#49485) 2022-06-10 16:15:15 -07:00
Jake Bailey
678afe8b9c
Improve performance of Debug.format functions (#49487) 2022-06-10 16:14:59 -07:00
Oleksandr T
806a710470
fix(49478): add return type to method signature (#49482) 2022-06-10 14:14:36 -07:00
Anders Hejlsberg
e6808c4290
Instantiation expression can be followed by line break or binary operator (#49353)
* Allow instantiation expression to be followed by let or interface on new line

* Add tests

* Update src/compiler/parser.ts

* Instantiation expressions followed by line breaks or binary operators

* Add more tests

* Accept new baselines

* Fix lint error

* Update fourslash test

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
2022-06-10 10:26:42 -07:00
Ron Buckton
b3a79dbe04
fix missing 'internal' comment 2022-06-09 18:39:05 -07:00
Ron Buckton
1e65b330a7
Merge 'decorators' into 'modifiers' on various nodes (#49089)
* Merge 'decorators' into 'modifiers' on various Nodes

* Drop RESERVED argument in favor of removing parameter

* Ignore grammar error nodes when asserting invariants

* Revert 'illegalX' property renames

* PR Feedback
2022-06-09 17:24:02 -07:00
Andrew Branch
00c7c476dc
Avoid repeating codefix work when resolving auto-import specifiers for completions (#49442) 2022-06-09 10:37:16 -07:00
csigs
2f7ecc6991
LEGO: Merge pull request 49455
LEGO: Merge pull request 49455
2022-06-09 05:27:19 -07:00
TypeScript Bot
71106a6301 Update package-lock.json 2022-06-09 06:06:27 +00:00