Commit graph

1209 commits

Author SHA1 Message Date
Nathan Shively-Sanders 1ae6b8bfb5
Forbid duplicate tests only in compiler+fourslash runner (#44752)
* Forbid duplicate tests only in compiler runner

Not in fourslash, user, docker, etc.

* Include fourslash, but exempt shims and server
2021-06-25 17:33:31 -07:00
Andrew Branch 328e888a9d
Resolve module specifiers for auto imports in completion list (in incomplete chunks) (#44713)
* Enable module specifiers for all auto imports

* Use isIncomplete

* isIncomplete continuation

* Lots of fixes

* Merged/transient symbol fixes, resolve all ambient module specifiers up front, pull as many as we want from cache

* Fix existing tests

* Start testing

* Add more tests

* Set cache attempt limit, update API baseline

* Fix a few tests

* Fix contextToken

* Split getModuleSpecifiers

* Unexport function

* Clean up importFixes

* Clean up completions

* Delete transient symbol assertion - fixing later
2021-06-25 17:26:53 -05:00
Wenlu Wang 66b4ba4b35
Add inlay hints support (#42089)
* Add signature arguments label support

* Support rest parameters and destruction

* make lint

* Fix tuple rest parameters

* Adjust name styles

* Rename to inline hints

* Partition inline hints

* Adjust range pred

* Add function expression like hints

* Support configure inline hints

* Display hints in single line

* Add test suits and tests

* Add range tests

* Support more hints

* Add more options

* Fix logical

* Add more cases

* Support call chains

* Rename options

* Match lastest protocol

* Update protocol changes

* Support context value and hover message

* Revert "Support context value and hover message"

This reverts commit 37a7089633.

* Revert "Update protocol changes"

This reverts commit e5ca31bc30.

* Add hover message

* Accept baseline

* Update src/services/inlineHints.ts

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

* Update src/services/inlineHints.ts

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

* Cache across the program

* Fix possible undefined

* Update protocol changes

* Fix missing property

* Make lint happy

* Avoid call chain hints

* I'm bad

* Add whitespace before type

* Add more tests

* Should care about jsdoc

* Support complex rest parameter

* Avoid module symbol  hints

* Care about leading comments

* Fix CR issues

* Avoid changes

* Simplify comments contains

* Fix CR issues

* Accept baseline

* Check parameter name before create regex

* Rename option

* Avoid makers

* Skip parens for argument

* Fix CR issues

* Fix enums

* Accept baseline

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
2021-06-24 23:06:34 -07:00
Tobias Koppers 22637a232b
avoid computing a full shape for indirectly invalidated files (#44090)
* add shape updates to baselines

* avoid computing a full shape for indirectly invalidated files

using file version as shape is enough to keep build info valid
and it's much cheaper
2021-06-22 10:33:54 -07:00
Ron Buckton 711b4e778b
Indirect calls for imported functions (#44624)
* Indirect calls for imported functions

* Fix unit tests
2021-06-21 19:51:13 -07:00
Wenlu Wang 8d3125b78a
Allows plugin to register commands (#44291)
* Pass session into plugin

* Use unknown message type

* Add missing unknown

* use editor services insted of every project

* Fix baseline

* Add plugin test

* Avoid type parameter

* Accept baseline
2021-06-18 14:46:09 -07:00
Nathan Shively-Sanders 0f216f36ec
Forbid duplicates in baselines (#44652)
* Forbid duplicates in baselines

The check is case insensitive.

* Update baselines and add semi-colons

Gotta have those semicolons.
2021-06-18 11:40:25 -07:00
Nathan Shively-Sanders 580bb066c1
Make files safe for Windows (#44651)
* make typeofthis tests case-insensitive-safe

* shorten test case names

* correct way to change test directories

* update baselines
2021-06-18 09:06:51 -07:00
Andrew Casey 9549928ce9
Make export-module and reference maps invertible (#44402)
* Make export-module and reference maps invertible

Right now, we're enumerating all the entries to find out which keys map
to a corresponding value.  By maintaining a two-way map, we can convert
this linear search into a map lookup and skip allocation of many, many
iterator results.

* Fix lint error

* Add some explanatory comments

* Rename, drop type parameters, and add readonly variant

* Simplify member list

* Fold non-exporting behavior into custom map type
2021-06-17 11:06:42 -07:00
Song Gao 971133d5d0
New command line help developer experience. (#44157)
* refactor help CLI output.

* fix typo and omit false condition boolean output.

* fix typo

* add line break

* add --plugins option to basic option category.

* add ts icon and remove old print help function.

* better command description for --jsx.

* Fix test

* fix lint

* Improvements to the UX

* Fix tests

* fix test.

* add missing help out.

* use environemnt variable to control test case.

* fix merge issues.

* No `No Category`

* make getWidthOfTerminal optional.

* fix test

* fix review.

* fix review.

* Update baselines

Co-authored-by: Orta <git@orta.io>
2021-06-16 14:18:00 +01:00
Ron Buckton a0c44b26b7
Improve __spreadArray perf, and other fixes related to SpreadElement (#44527)
* Improve __spreadArray perf, fix array packing and trailing omitted expressions

* Ensure __spreadArray is backwards-compatible

* Add signature restriction for __spreadArray

* Added reusable true/false literals
2021-06-11 16:21:55 -07:00
Oliver Joseph Ash 69cc9ba5e4
Init (#44206) 2021-06-10 14:12:33 -07:00
Andrew Branch 7c293c8d46
Include actual generated module specifiers in module specifier cache (#44176)
* Add cache invalidation for node_modules, config, and preferences changes

* Share watches with closed script info

* Update API baseline

* Small adjustments for fewer object allocations

* Document overloaded return value

* Update baselines

* Store isAutoImportable separately from modulePaths

* Add back missing return

* Return wrapped watcher instead of underlying one

* Make user preferences part of the cache key instead of implicitly clearing in editor services

* Fix missed merge conflict
2021-06-10 12:26:32 -05:00
Orta Therox 481c2037cc
Re-name really long file (#44413) 2021-06-10 14:18:56 +01:00
Andrew Branch 703c1bc69d
Include type reference directives in symlink cache, wait until program is present to create it (#44259)
* Fix discovery of more pnpm symlinks

* Add some tests

* Never show pnpm paths in auto imports, even if there’s no other path

* Import statement completions can return none

* Fix tests

* Add failing test showing poor symlink cache reuse

* Fix test, fails for right reasons now

* Preserve cache built up during program creation, then fill in with program resolutions

* Remove obsolete comment

* Remove obsolete type assertion

* Revert fully filtering out ignored paths
2021-06-08 12:06:55 -05:00
Sheetal Nandi dab2ffc45a
Add SolutionBuilderHostBase.getCustomTransformers to be used when emitting. (#44489)
This allows not having to specify the transformers during normal watch scneario
Builds on top of #43984
2021-06-07 15:32:39 -07:00
Sheetal Nandi 24da242b67
Update the version in baselines (#44447) 2021-06-04 15:08:23 -07:00
Nathan Shively-Sanders 8e1bf08fa9
Fix duplicate visit of param tag comments (#44443)
Fixes #44422
2021-06-04 12:54:36 -07:00
Paul Gschwendtner b26f77a703
Do not incorrectly add line separators for non-synthetic nodes when emitting node list (#44070)
As of 3c32f6e154, a line separator is
added between nodes if the nodes are not synthetic and on separate
lines. This it push s wrong and previously only happened if the non-synthetic
nodes were on different lines but had the same parent.

Fixes #44068.
2021-06-04 09:46:23 -05:00
Sheetal Nandi 9df7ecb38b
Handle strict flag when writing tsbuildinfo (#44394)
* Add test showing how setting strict is not preserved in tsbuildinfo
Test for #44305

* Handle strict flag when writing tsbuildinfo
Fixes #44305

* Apply suggestions from code review

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

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
2021-06-03 16:14:58 -07:00
Orta Therox 9d345e7734
Rename TSConfig option categories (#42514)
* Update the category descriptions for the tsconfig options

* Gets tests green

* Whitespace change

* Drop command line options from --init

* Go back to the old re-build baseline

* Fix numbers

* Remove formatting options from --showconfig

* Dpon't show output formatting changes in showConfig

* Update baselines

* Update baselines
2021-06-03 12:21:04 +01:00
Sheetal Nandi d2516fa95b
Tsserver tests can be baselined (#44326)
* Tests to baseline tsserver instead of checking
Also ensures inferred and auto import projects have name per project service

* Log structureIsReused value

* more baselines
2021-06-02 11:22:01 -07:00
Oleksandr T 1f4c8708c2
fix(44123): forbid convert to async for generator callbacks (#44147) 2021-05-28 14:42:09 -07:00
Sheetal Nandi 817e45d1c1
Dont update timestamps of output files if noEmit was specified (#44306)
* Add failing test for #44303

* Dont update timestamps of output files if noEmit was specified.
Fixes #44303
2021-05-27 17:09:30 -07:00
Sheetal Nandi 8721dd06f1
Add type brands for fileId and fileIdListId (#44280) 2021-05-27 11:15:13 -07:00
Sheetal Nandi 6329a0df90
Add traces for module resolution reuse (#44282) 2021-05-27 11:14:12 -07:00
Andrew Branch b1eaf3e170
Ensure AutoImportProviderProject can share source files with main program (#44274)
* Ensure AutoImportProviderProject can share source files with main program

* Revert package-lock change

* Add back reclassified options
2021-05-26 16:47:40 -07:00
Sheetal Nandi 2ffd35de4d
More updates to program reuse with different option changes (#44276) 2021-05-26 15:57:43 -07:00
Sheetal Nandi b7b4856944
Refactor tsbuild watch tests (#44258) 2021-05-25 17:01:06 -07:00
Oleksandr T db01e84700
feat(eslint): consistent-type-assertions (#43556) 2021-05-18 06:20:57 -07:00
Ikko Ashimine 493ec4cc26
Fix typo in host.ts (#43930)
encounted -> encountered
2021-05-13 14:00:26 -07:00
Sheetal Nandi 182b6c90d6
Test for Update the type reference cache with correct project options (#44008)
* Test without change

* Update showing fix in #44004 works
2021-05-10 12:29:36 -07:00
Ron Buckton cb9cd898d1
Revert #35877 - fix receiver on calls of imported and exported functions (#43993) 2021-05-07 13:42:12 -07:00
Sheetal Nandi e5395efe49
Add writeFile and customTransformers to build and buildReferences (#43984) 2021-05-07 12:13:17 -07:00
Sheetal Nandi cfed79b7a2
Correctly use ownMap from module resolution cache (#43986)
* Test showing the moduleResolutionCache reset issue with tsc --b --w

* Fix incorrect usage of ownMap by making it function returning ownMap instead of constant value
2021-05-07 09:56:29 -07:00
Sheetal Nandi 233f28ca27
When directory watcher is invoked with any file from node_modules package, invalidate for file paths in that package (#43974)
Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
2021-05-06 09:48:26 -07:00
Oleksandr T e0d7703cf3
fix(43939): forbid converting getters to async/await (#43944) 2021-05-06 01:48:54 -07:00
Sheetal Nandi f7ef1540d3
Use options from referenced project for including resolved imports in the file when using sources of project reference (#43914)
* Test where allowJs present in referenced project affects picking up right set of import files

* use options from referened project for including resolved imports in the file when using sources of project reference
Fixes #43909
2021-05-03 11:35:21 -07:00
Sheetal Nandi c96b472e0b
Handle localness in special cases by checking exported variable assignment (#43851)
* Handle localness in special cases by checking exported variable assignment
Fixes #42976

* Fix existing tests where arrow now behaves similar to function expression

* Update src/services/goToDefinition.ts
2021-04-30 13:17:59 -07:00
Sheetal Nandi f6d425e1e3
Module Resolution and Type Reference directive cache updates and its API changes (#43700)
* Make the module resolution cache apis for updating compiler options or clearing it

* Cache package.json lookup results from module resolution

* Use per directory cache for type reference directive resolution as well

* Update Baselines and/or Applied Lint Fixes

* Change trace according to feedback

* Update Baselines and/or Applied Lint Fixes

Co-authored-by: TypeScript Bot <typescriptbot@microsoft.com>
2021-04-21 21:30:18 -07:00
Josh Goldberg a910c8df13
Added skipDestructiveCodeActions argument to organize imports server command (#43184)
* Stopped removing unused imports in files with syntactic errors

* Added allowDestructiveCodeActions arg

* Updated .d.ts baselines

* Stop factoring syntax errors. Weird that no tests break...

* Have args extend scope so it is not a breaking change

* Update src/harness/harnessLanguageService.ts

Co-authored-by: Jesse Trinity <jetrinit@microsoft.com>

* Fixed API breaking change, and renamed to skip

* Always with the baselines

* One more .d.ts baseline to fix

* Remove blank line in src/harness/harnessLanguageService.ts

Co-authored-by: Jesse Trinity <jetrinit@microsoft.com>
2021-04-20 09:04:17 -07:00
Sheetal Nandi 01264ac414
Reducing tsbuildinfo size further (#43695)
* Serialize compiler options that are needed from old state when creating new state

* Dont write affectsGlobalScope if not true

* Encode FileInfo for better serialization size

* Update src/compiler/builder.ts

Co-authored-by: TypeScript Bot <typescriptbot@microsoft.com>
2021-04-16 23:22:14 -07:00
Andrew Branch f74f9cac13
Add telemetry properties for import statement completions (#43664) 2021-04-13 16:17:52 -07:00
Sang a354a77030
Improve rendering of JSDoc comment text with displayparts (#43390)
* feat(services): jsdoc use custom name for display parts

* fix(services): jsdoc typo

* feat(services): revert jsDoc changes

* feat(services): jsdoc improve displayparts with more comment kinds

Improve rendering of JSDoc comment text with displayparts for:

- `@typedef`
- `@callback`
- `@param`
- `@property`

* feat(services): jsdoc improve displayparts for template

* test: accept baseline

* test: update jsdoc parameterName

* feat: resolve pr comments

* test: add fourslash tests for jsdoc callback, typedef

* test: accept baselines

* test: revert changes for api baselines

* refactor: naming

* refactor: code quality

* refactor: clean up code as to pr comments
2021-04-09 09:44:44 -07:00
Josh Goldberg fe4a6709da
Specified diagnostic for CLI flags mismatched with/out --build (#43199)
* Specified diagnostic for CLI flags missing a required --build

* Switched to an alternateMode member

* Added --build-incompatible flags too

* Small fixups to remove a hardcoding

* Switched to ||= factories

* Not a function

* I think I get it now
2021-04-07 16:03:17 -07:00
Titian Cernicova-Dragomir 2484210a00
Gh 41788 incorrect output for esprivate with nested class in esnext (#42663)
* If target:esnext,then useDefineForClassFields: true will now be the default.

* Added error if a private identifier is used in a static a initializer if target:ESNext and useDefineForClassFields:false.

* Added test for new useDefineForClassFields default and error message.

* Fixed tests after changing the default of useDefineForClassFields to true for target esnext

* Fixed code review suggestions.

* Updated error message.

* Added missing static check for the containing property. Fixed other code review issues.
2021-04-07 08:23:16 -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
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
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