Commit graph

29352 commits

Author SHA1 Message Date
Sheetal Nandi 9445657184
Correctly set filesByName map when reusing program to ensure it is same as old (#35784)
It was previously not populated correctly if preserveSymlinks with useSourceOfProjectReference was true,
in that case if module was resolved to symlink and we deduced it refers to source of project reference we want to set "resolvedFileName" correctly
otherwise it results in incorrect module not found errors.
2019-12-20 07:44:35 -08:00
Wesley Wigham 8c9e96bea9
Move executeCommandLine ambient code into tsc (#35788) 2019-12-19 15:55:42 -08:00
Andrew Branch 1fd5bd2b4e
Filter out self-fulfilling completions (#35709) 2019-12-19 16:05:23 -06:00
Sheetal Nandi ec84392f2e
Use resolvedPath consistently in the builder (#35757)
* Add baseline for #35468

* Use resolvedPath consistently in the builder
Fixes #35468
2019-12-19 10:10:17 -08:00
Eli Barzilay 5d3284032b Fix scripts/hooks/post-checkout
Shell scripts must use LFs.  Also make it executable.

(Both failures probably don't happen on some windows environment where
git is told to translate EOLs, and all files are assumed executable.)
2019-12-18 17:25:07 -05:00
Ben Lichtman 3c153d885b
Merge pull request #35742 from uniqueiniquity/addPositionAssert
Add asserts to narrow down position issue
2019-12-18 14:19:29 -08:00
TypeScript Bot 1952ccc0b6 Update user baselines (#35756) 2019-12-18 13:04:10 -08:00
Nathan Shively-Sanders 3c5ecc2a60
Add jsdoc support for @public/@private/@protected (#35731)
* Add @private/@protected/@public test

* Fix @declaration

* draft abstraction + one usage

* Fill in necessary parsing etc

* make general getEffectiveModifierFlags

move to utilities, make the right things call it

* reorder public/private/protected

* JS declaration emit works with @public/@private/@protected

* revert unneeded/incorrect changes

* Update baselines and skip @public/etc when parsing

1. Update the API baselines with the new functions.
2. Do not check for @public/etc during parsing, because parent pointers
aren't set, so non-local tags will be missed; this wrong answer will
then be cached.

* Parser: don't call hasModifier(s) anymore.

Then move jsdoc modifier tag checks into getModifierFlagsNoCache where
they should be. The jsdoc checks are skipped when the parent is
undefined. There are 3 cases when this can happen:

1. The code is in the parser (or a few places in the binder, notably
declareSymbol of module.exports assignments).
2. The node is a source file.
3. The node is synthetic, which I assume to be from the transforms.

It is fine to call getModifierFlags in cases (2) and (3). It is not fine
for (1), so I removed these calls and replaced them with simple
iteration over the modifiers. Worth noting: Ron's uniform node construction
PR removes these calls anyway; this PR just does it early.

* Fix constructor emit

1. Emit protected for protected, which I missed earlier.
2. Emit a constructor, not a property named "constructor".
3. Split declaration emit tests out so that errors are properly reported
there.
2019-12-18 12:58:12 -08:00
TypeScript Bot f7860b0480 Update user baselines (#35755) 2019-12-18 11:16:25 -08:00
Ben Lichtman 9f1e389441 Remove unnecessary internal tags, handle bad input 2019-12-18 10:44:40 -08:00
Sheetal Nandi 853507642a
Do not list output files that just change their modified time when using --listEmittedFiles (#35714)
* Baseline incremental scenarios for listEmittedFiles

* Do not list output file that just changes modified time stamp as emitted file
Fixes #35605
2019-12-18 10:24:59 -08:00
Sheetal Nandi 8c1900c74b
Baselining tsc --watch output just like tsc baselines for easier updates (#35710)
* Baselining tsc --watch output

* Fix lint errors
2019-12-18 10:23:58 -08:00
Andrew Branch aef2e0a238
Fix implement interface codefix for synthetic member symbols (#35718) 2019-12-18 07:20:01 -08:00
Ben Lichtman 42dc4155ce Refactor to make failure messages more consistent 2019-12-17 17:41:38 -08:00
Ron Buckton 2eb60c2cb2
Fix decoding of HTML entities in TSX/JSX (#35739) 2019-12-17 17:32:48 -08:00
Ben Lichtman 925582d034 Add asserts to narrow down position issue 2019-12-17 17:04:54 -08:00
Anders Hejlsberg cafa175501
Properly reflect CFA effects of return in try or catch blocks (#35730)
* Properly reflect CFA effects of return in try or catch blocks

* Add tests

* Accept new baselines
2019-12-17 16:46:34 -08:00
Sheetal Nandi f90cde4706
Fix completions when the ts installation and project are on two different windows drive (#35733)
* Fix completions when the ts installation and project are on two different windows drive
Fixes #35512

* Fix typo
2019-12-17 14:19:52 -08:00
Andrew Branch c73af610fe
Add ignoreInterpolations util to fourslash for fuzzy diagnostic matching (#35652)
* Add ignoreInterpolations util to fourslash for fuzzy diagnostic matching

* Simplify

* It’s not Swift

* Fix regexp

* Remove unnecessary type assertion
2019-12-16 17:21:21 -08:00
Andrew Branch 53c8b958d7
Fix formatting scanner on multiline JSX attribute strings (#35705)
* Fix formatting scanner on multiline JSX attribute strings

* Update API
2019-12-16 12:36:40 -08:00
TypeScript Bot 16aae96a90 Update user baselines (#35687) 2019-12-16 09:06:46 -08:00
TypeScript Bot 8feff60aee Update user baselines (#35685) 2019-12-15 02:35:18 -08:00
Andrew Branch 8a88c1c84c
Don’t offer import fix for members of arrays or classes (#35635)
* Write failing test

* Don’t offer import fix for members of arrays or classes
2019-12-13 14:20:54 -08:00
TypeScript Bot 543ec2362b Update user baselines (#35671) 2019-12-13 13:04:47 -08:00
TypeScript Bot af95cb3598 Update user baselines (#35665) 2019-12-13 11:28:27 -08:00
Sheetal Nandi c3b2aea9f9
Do not write files directly from builder when noEmitOnError is true (#34832)
* Add tests for noEmitOnError

* Do not write files directly from builder when noEmitOnError is true
Fixes #34823

* make linter happy

* Instead of generating output in memory, check errors before doing the emit in case of noEmitOnError
2019-12-12 19:51:18 -08:00
TypeScript Bot ac5e10bc72 Update user baselines (#35662) 2019-12-12 17:04:09 -08:00
TypeScript Bot 738e222ac5 Update user baselines (#35643) 2019-12-12 16:20:43 -08:00
Anders Hejlsberg 71a91763f4
Fix33448 (#35513)
* Filter out discriminants of type 'never'.

* Add tests

* Accept new baselines

* Remove unnecessary '!' assertion
2019-12-12 06:45:46 -08:00
Nathan Shively-Sanders b98cb0645d
Fix binding of this-assignments w/computed properties (#35639)
Top-level this-assignments do not support computed properties. But the
binder forgets to check for computed properties and tries to bind them
normally. This hits a helpful assert.

This change stop binding this-properties with computed properties at the
top-level.  There's nothing sensible we could do with them; we're unable
to late-bind entries to the global scope or to modules.
2019-12-11 15:55:08 -08:00
Sheetal Nandi 1fd1b429f0
Handles different references and renames involved with import export and import type node (#34813)
* Test

* Handle import type node when handling the namespace import and reexport
Fixes #33017

* Handle qualifier of the importTypeNode

* Handle export specifier

* Fix rename prefix when search for rename starts at qualifier in import type ndoe

* Fix rename of qualifier with importType node when invoked without provideSuffixAndPrefix option
2019-12-11 15:11:27 -08:00
Wesley Wigham fc0f67dcfd
Dedent external runner message text 2019-12-11 14:28:59 -08:00
Sheetal Nandi 236012e47b
Add watchOptions to tsconfig and allow supplying them on command line as well (#35615)
* Create different watch options in compiler options

* Thread through the new watch options

* Actually use the options passed through for watch strategy

* Support delay on updating child directory watches

* Make watchOptions separate from compilerOptions

* Support passing watch options from command line

* Handle displaying of watchOptions
2019-12-11 13:26:44 -08:00
Sheetal Nandi 4212484ae1
Open bigger set of configured projects when opening composite project for operations that operate over multiple projects like rename (#33287)
* Add isInferredProject, isConfiguredProject and isExternalProject

* Skip refreshing configured project on change of config file if its not loaded

* Open a tree of projects when doing findAllRefs or rename operations

* Fix addToSeen project key

* Refactor combineProjectsOutputWorker

* if the definition is local, no need to load and look in other projects

* Add disableSearchSolution as option to disable looking for solution

* Rename the option to disableSolutionSearching
2019-12-11 12:28:18 -08:00
Andrew Branch f1f874699c
Improve some completions on generic object literals (#34855)
* Weird fix

* Slightly better I guess

* Update APIs

* Make `hasTypeArguments` do what it says on the tin

* Fix merge mistake
2019-12-11 11:21:28 -08:00
TypeScript Bot 7fd6e0da62 Update user baselines (#35618) 2019-12-11 10:01:46 -08:00
Sheetal Nandi 07364595e4
Handle consistent file name during editor and tsc --watch scenarios (#34622)
* Add isInferredProject, isConfiguredProject and isExternalProject

* Add test for rename on file with case change that fails
Test for #25460

* Dont store fileName on text storage

* Store root file names in the root file map to reflect their name

* Delay open file triggering watches

* Correct the name of source file as we query it (eg. it could be same source file returned in old program with different casing on case insensitive file name)

* More tests

* Refactoring

* Cache bind And check diagnostics and always get program diagnostics from the program

* Another test

* Try to report conflicting file error on file instead of global diagnostics

* Create better tests for module resolution diagnostics check

* Fix lint errors
2019-12-10 18:25:10 -08:00
Wesley Wigham 50603eda5c
Add ts namespace reference to tsc, since it now doesnt have one 2019-12-09 16:48:00 -08:00
Wesley Wigham a83b928b09
Rename debug.ts so its name differs from its namespace (#35596) 2019-12-09 16:35:01 -08:00
Wesley Wigham 6936ac24fd
Move executeCommandLine.ts into its own project (#35595)
* Move executeCommandLine.ts into its own project

* Remove incorrect prepend
2019-12-09 16:33:24 -08:00
Toxyxer f8cacf97e1 Issue/34870 (#35586)
* Add new error message when missing brace

* Add test for missing close brace

* Update other tests which were affected
2019-12-09 16:31:23 -08:00
Andrew Branch 64a886700f
Fix spelling codefix for optional chain property access (#35583) 2019-12-09 11:31:47 -08:00
Andrew Branch 9a9baebdd6
Sort extract constant above extract function (#35580) 2019-12-09 10:33:28 -08:00
Wesley Wigham a78342a160
Move most harness globals into namespaces (#35530)
* Move most harness globals into namespaces

* Remove forward declaration from `createMapShim` and move all `Map` declarations into one file

* A small pile of more changes to get the harness transforming
2019-12-06 15:20:49 -08:00
TypeScript Bot 2b567b2699 Update user baselines (#35535) 2019-12-06 08:27:22 -08:00
TypeScript Bot 02e79a1832 Update user baselines (#35532) 2019-12-05 18:06:13 -08:00
TypeScript Bot 1a1c8cb602 Update user baselines (#35500) 2019-12-05 18:05:55 -08:00
TypeScript Bot 52d1b2fff8 Update user baselines (#35519) 2019-12-05 15:57:12 -08:00
Andrew Branch f050750cc6
Don’t auto-import undefined (#35504) 2019-12-05 14:47:51 -08:00
Wesley Wigham 27616dd523
Move codefix types into services/types.ts (#35506)
* Move codefix types into services/types.ts

* Also split apart refactorProvider

* Move all meanings of DocumentHighlights into one file

* Use setter for object allocator

* Remove unneeded namespace reference

* Remove some shorthand references to nonlocal namespace variables

* Convert WatchType string enum to a structure that can be merged across modules

* Rename harness to harnessIO

* Move accidental globals into namespace

* Remove unused globals

* Suppress lints - these qualifiers are needed for the migration to go smoothly

* Hide global declaration
2019-12-05 10:51:31 -08:00