Commit Graph
24434 Commits
Author SHA1 Message Date
Andrew Branch 8bd7ce6feb Find Source Definition (#48264)
* Prototype resolving to JS when go-to-def aliases all resolve to ambient declarations

* Add test infrastructure

* Start fleshing out test coverage

* Fix some go-to-def stuff

* Finish lodash test case

* Make go-to-implementation never return ambient results

* Build new functionality into go-to-implementation

* Update baselines

* Two more test cases

* Refine definition searches for unresolved imports

* Revert "Build new functionality into go-to-implementation"

This reverts commit 381799d0f1.

* Fix tests

* Revert go-to-implementation changes

* Wow a bunch of code was unnecessary

* Update baselines and go-to-def test

* Fix navigation on symbols that are not aliases but resolve through aliases in chain

* Temporarily replace go-to-def with new command implementation

* Revert "Temporarily replace go-to-def with new command implementation"

This reverts commit 34c6cfdebb.

* Revert "Wow a bunch of code was unnecessary"

This reverts commit 1cb2ba646c.

* Bring back some deleted code needed for a new test case

* Clean up a little

* Rename more stuff

* Update test

* Update API baseline

* Temporarily replace go-to-def with new command implementation

* PR review fixes

* Fix getTopMostDeclarationNamesInFile

* Rename local

* Use hash set

* Remove option from commandLineParser

* Keep noDtsResolution project around

* Handle AuxiliaryProject kind in ScriptInfo getDefaultProject etc.

* Do not run updateGraph in the background for AuxiliaryProject

* Don’t create auxiliary project outside of semantic mode

* No-op on scheduled invalidation

* Add comments to unit test

* Sync compiler options to auxiliary project

* Fix case sensitivity

* Update extensionIsOk with new file extensions

* PR feedback

* Update API baseline

* Mark scheduleInvalidateResolutionsOfFailedLookupLocations internal

* Use same heuristics on property accesses of loosely-resolvable aliases as unresolvable named imports

* Rename command, and no need to return the bound span

* Update API baseline
2022-04-14 15:44:19 -07:00
Jake Bailey e6dcf6f5cb Fix lints after dep update (#48707) 2022-04-14 15:19:22 -07:00
Josh Goldberg fa2515ecd9 Fixed multiple prologue directives with parameter properties (#48687) 2022-04-14 09:29:15 -07:00
Andrew Branch 796be45118 Update signatures to avoid post-LKG error (#48677) 2022-04-13 16:36:35 -07:00
Oleksandr T 73c93eec5c fix(48657): allow JSXElement names to be IdentifierNames (#48661) 2022-04-13 12:32:10 -07:00
Anders Hejlsberg a027cfa8ac More permissive parsing of instantiation expressions (#48659)
* More permissive parsing of expressions with type arguments

* Add test
2022-04-13 09:16:43 -04:00
Sheetal Nandi 988fa85f88 Handle declaration file names consistently (#48647) 2022-04-12 11:43:57 -07:00
Anders Hejlsberg cce61d1b69 Variance annotations on class expressions + deferred valiation (#48645)
* Variance annotations on class expressions + deferred validation

* Add regression tests
2022-04-12 09:34:33 -04:00
Sheetal Nandi a1e77edfdf Fix the issue with not serializing impliedFormat when signature and version of the file are same (#48614)
* When checking for incremental correctness always calculate signature

* Fix the issue with not serializing impliedFormat when signature == version of the file
2022-04-11 12:39:57 -07:00
Andrew Branch 02787cfde1 Make LKG and nightly declaration emit the same (#48641) 2022-04-11 12:33:57 -07:00
Sheetal Nandi 15c2120a95 Update affected files pending emit when emitting using SemanticDignosticsBuilderProgram (#48519)
* Update affected files pending emit when emitting using SemanticDignosticsBuilderProgram

* Saving of affected files pending emit is not needed any more

* PR feedback
2022-04-11 11:54:39 -07:00
Jack Bates c1db699482 Don't skip tests named *Fourslash.ts (#48615) 2022-04-11 11:45:44 -07:00
Gabriela Araujo Britto dfb9f2f953 don't have type annotations on suggested object literal methods (#48607) 2022-04-11 11:33:02 -07:00
csigs f81f63f343 LEGO: Merge pull request 48633
LEGO: Merge pull request 48633
2022-04-10 03:15:53 -07:00
Anders Hejlsberg a744862aa5 Explore fewer constraints in getResolvedBaseConstraint (#48613) 2022-04-09 10:06:01 -04:00
csigs b797a3eb2e LEGO: Merge pull request 48621
LEGO: Merge pull request 48621
2022-04-09 03:16:15 -07:00
Andrew Branch af3e1d4dfd Reuse type nodes from optional parameters even when not written as a union with undefined (#48605)
* Reuse type nodes from optional parameters and properties even when not written as a union with `undefined`

* Remove newly unneeded NodeBuilderFlag

* Update public API

* Update baselines from main
2022-04-08 14:28:36 -07:00
Oleksandr T 3b2fa50a14 fix(48487): allow using private names as the self-assignment entity name (#48496) 2022-04-08 10:48:28 -07:00
csigs b1fb7293c0 LEGO: Merge pull request 48612
LEGO: Merge pull request 48612
2022-04-08 07:59:17 -07:00
LowR b45cf0d694 disentangle the meaning of SymbolLinks.target (#47098) 2022-04-07 15:40:39 -07:00
Zzzen f4b99ea47c preserve this when extracting functions (#41992)
* preserve this when extracting functions

* rename IsThisReferringToFunction to UsesThisInFunction

* refactor

* update tests
2022-04-07 15:05:46 -07:00
Sheetal Nandi d8edd191ab Write version for baselining in buildinfo (#48602)
Also baseline buildinfo so its easier to detect mistakes
2022-04-07 13:38:54 -07:00
jihndai b18141b0bc Do not reset control flow analysis on index signatures (#48427)
* do not flag index signatures as a control flow container

* add tests and baselines
2022-04-07 13:29:07 -07:00
Ron Buckton b975dfa102 Write more useful types in .types test outputs (#48578) 2022-04-07 09:51:17 -07:00
Wesley Wigham 4d2fb5407c Preserve the distributivity of inlined conditional types in declaration emit (#48592) 2022-04-06 17:21:46 -07:00
Wesley Wigham 94d33ba85d Ensure late painted statements are only transformed once, so inner substitutions are consistently read (#48558)
* Ensure late painted statements are only transformed once, so inner substitutions are consistently read

* PR suggestion

* Fix lint
2022-04-06 16:36:42 -07:00
Sheetal Nandi 4c6f25a998 More refactoring of tsc baselines to help with easier updates (#48572)
* Some refactoring of baselines

* Some refactoring of baselines
2022-04-06 14:10:08 -07:00
Anders Hejlsberg 8f6e626d1c Permit type alias variance annotations only for certain object types (#48589)
* Permit type alias variance annotations only for certain object types

* Accept new baselines
2022-04-06 14:04:42 -07:00
Sheetal Nandi 3fd8a6e443 Some refactoring for baselining for easy update (#48516)
* Some refactoring for baselining for easy update

* Set modified time in baseline

* Some renames per feedback
2022-04-06 12:46:34 -07:00
Nathan Shively-Sanders 16b6f0f533 manually update webworker to remove AbortSignal.abort (#48580) 2022-04-05 17:08:17 -07:00
Andrew Casey 76e74370ab Only report isDefinition when FAR is triggered on a definition (#48566)
* Don't report isDefinition unless the starting node is a declaration

* Drop isDefinition everywhere it isn't specifically needed

* Fix tsserver tests

* Update shim comment

* Update baselines

* Add tests for isDefinition

* Update doc comment

* Clear isDefinition from all references if the first one lacks it
2022-04-05 17:04:18 -07:00
jihndai f7c457d207 Update Intl.DisplayNames types for better spec compliance (#48442)
* update display names types

* update baselines

* add tests and baselines

* add another test
2022-04-05 16:58:25 -07:00
Oleksandr T 9881c993fc fix(48544): allow to convert default exports to names for import type nodes (#48550) 2022-04-05 16:53:01 -07:00
Minh Quy 50a5bc839a fix(48540): Extract to typedef from (invalid) type with comments in JS file causes assertion failure (#48545)
* fix(48540): Remove comments from jsdoc union type expression

* fix(48540) - Remove comment for top level import and add extract typedef tests

* fix(48540) - Remove comments from jsdoc's descendant

* fix(48540) - Using no nested comments instead of traversing
2022-04-05 16:51:32 -07:00
Nathan Shively-Sanders 42032df06d Update DOM for 4.7 beta (#48577) 2022-04-05 16:47:25 -07:00
jihndai 88f31d72c2 Add more options to DateTimeFormatOptions.timeZoneName (#48467)
* update timeZoneName

* add tests and baselines
2022-04-05 13:46:54 -07:00
Leonard Ginters 312737b430 feat(46907): Add Intl.ListFormat type declarations (#47254)
* feat(46907): Add ListFormat type declarations

* feat(46907): Fix JSDoc return type

* feat(46907): Use correct formatToParts list parameter type description, link to Array MDN page

* refactor(46907): Change ListFormatLocaleMatcher MDN link to match the rest

* feat(46907): Add explicit undefined to ListFormatOptions
2022-04-05 13:38:38 -07:00
Daniel Rosenwasser c99afde6ad Run API tests with 'strict' and 'exactOptionalProperties'. (#48574) 2022-04-05 13:35:21 -07:00
Anders Hejlsberg a3c22187c9 Improve inference for context sensitive functions in object and array literal arguments (#48538)
* Use intra-expression inference sites in type argument inference

* Accept new baselines

* Add tests
2022-04-05 13:08:59 -07:00
Ron Buckton 7da80d79e2 Add 'extends' clause to 'infer' type (#48112)
* Add 'extends' clause to 'infer' type

* Revise parse for infer..extends, improve parenthesizer

* More aggressive parens to match existing DT tests

* tests 'infer' constraint using outer type parameter

* Adds a test showing 'infer' cannot reference other 'infer' in same 'extends'

* Emit extends clause for synthetic infer typesduring declaration emit
2022-04-05 12:35:28 -07:00
Minh QuyandJake Bailey 6e0447fdf1 [Feature] - Automatically create sort groups based on newlines (#48330)
Co-authored-by: Jake Bailey <5341706+jakebailey@users.noreply.github.com>
2022-04-05 11:53:19 -07:00
David Sherret f654f18d86 fix: ensure ts source file with no-default-lib that augments the global scope gets emitted with incremental program (#48412)
* fix: do not classify non-declaration files as default library source files

* Add test.
2022-04-05 10:00:37 -07:00
Zzzen 370d34cdca narrow type for generic variables inside TypeQuery (#48434) 2022-04-05 09:33:19 -07:00
Minh QuyandDaniel Rosenwasser 25aecd4c3e fix(48109) - 'Convert to arrow function' refactoring adds extra indent (#48440)
* fix(48109) - Remove extra indent when converting to arrow function

* fix(48109) - Only treat curly brace in object literal as block

* Apply suggestions from code review

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
2022-04-04 17:57:34 -07:00
Jake Bailey 276719753e Allow arrow function parameter parsing to bail out during speculation, redo (#48493)
* Allow arrow function parameter parsing to bail out during speculation, redo

* Add correct baselines

* Allow await/yield keywords for more graceful error reporting

* Add test for other parser issue

* Address some PR feedback

* Add extra comment

* Add async variants
2022-04-04 16:57:26 -07:00
Andrew Casey 493ddc2447 Remove non-baselining fourslash FAR validation (#48564)
* Fix fourslash failures

* Delete unused FAR fourslash helpers
2022-04-04 16:54:10 -07:00
Gabriela Araujo Britto 99ea99b386 Properly check singleton labeled tuple before unwrapping (#48554)
* properly check if singleton labeled tuple has optional element

* also check if labeled element is rest
2022-04-04 15:53:41 -07:00
Oleksandr T aa3c5a787c fix(48418): allow using empty tuple (#48420) 2022-04-04 14:56:35 -07:00
Oleksandr T e5ca3e4386 fix(48406): resolve JSDoc host of property signature (#48407) 2022-04-04 14:42:50 -07:00
Pablo Sabater Jiménez 3b12284fc4 fixed code duplication (#48425)
* fixed code duplication

* updated baselines
2022-04-04 14:16:21 -07:00