Commit Graph

5434 Commits

Author SHA1 Message Date
Alexander T
a39a675696 fix(35474): formatter incorrectly adds space after increment (#35550) 2019-12-23 12:27:54 -08:00
Andrew Branch
bed7c89354 Add base constraint completions for JSX attributes (#35803)
* Add base constraint completions for JSX attributes

* Add test for class components
2019-12-23 14:06:46 -06:00
Ron Buckton
6c413e0bbb Add support for Call Hierarchies in language server (#35176)
* Add support for Call Hierarchies in language server

* Use baselines for callHierarchy tests

* Clean up commented code

* Support multiple hierarchy items when an implementation can't be found

* Use optional chaining in a few places

* Use getFileAndProject
2019-12-22 13:25:09 -08:00
Kagami Sascha Rosylight
deb5288e31 Add module: es2020 (#33893) 2019-12-20 16:29:49 -08:00
Wenlu Wang
4c7844be74 Implement export as namespace from (#34903)
* init export start as decl

* fix some broken

* fix more case

* fix more and more case

* make it work

* make lint happy and accept baseline

* add more tests

* fix system module

* add more case

* delete useless assert

* accept baseline

* make lint happy

* fix missing utils

* update api

* make lint happy

* add missing semi

* fix minor issue

* fix locally bound

* avoid useless check

* update public api

* add more case

* fix some case

* Use multi-module selection in test runner to cut down on duplication.

* Accepted baselines.

* remove superfluous tests.

* Remove baseline.

* Downlevel `export * as ns` in es2015.

* Accepted baselines.

* Update names of things.

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
2019-12-20 16:00:20 -08:00
Andrew Branch
d96be353cb Fix JSDoc param type completions when name hasn’t been written yet (#35787) 2019-12-20 15:23:53 -06:00
Andrew Branch
1fd5bd2b4e Filter out self-fulfilling completions (#35709) 2019-12-19 16:05:23 -06:00
Andrew Branch
aef2e0a238 Fix implement interface codefix for synthetic member symbols (#35718) 2019-12-18 07:20:01 -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
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
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
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
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
Andrew Branch
b39b4e05be Use namespace import for esnext when esModuleInterop is off (#35475) 2019-12-04 12:07:25 -08:00
Wesley Wigham
e8748f8162 Add nested global member creation to shim (#35473) 2019-12-03 11:31:30 -08:00
Wesley Wigham
7bfffa745f Remove redundant checker functions and use patterns more friendly to modules (#35399)
* Remove redundant checker functions, use patterns more friendly to modules

* Also use a helper for localizedDiagnosticMessages

* Move types into same file as consts

* Accept slightly changed api baseline

* Whitespace!
2019-12-02 13:44:25 -08:00
Eli Barzilay
d6bd3ac552 Don't filter away private completions if in the same context
Fixes #34405, which was introduced in PR #16953.
2019-11-27 17:41:58 -06:00
Wesley Wigham
c447ebc59c Refactor: No more than 1 namespace declaration per file (#35373)
* Refactor: No more than 1 namespace declaration per file

* Simplify refs where possible
2019-11-27 13:44:31 -08:00
Eli Barzilay
77ec756960 Make getSourceFileToImportFromResolved prefer files in program.getSourceFiles()
Fixes #30550
2019-11-20 18:00:10 -05:00
Andrew Branch
571ca60b08 Add preceding semicolon on await insertion when parentheses are included (#34627)
* Add preceding semicolon on await insertion when parentheses are included

* Just start with precedingToken

* Fix semicolon formatter regression

* Delete test with debatable expected behavior

* Lint after control flow changes
2019-11-19 13:11:42 -08:00
Daniel Rosenwasser
b50b9e0fd2 Fix check for get/set recommendation (#34885)
* Added more tests.

* Accepted baselines.

* Work better with any parameter type.

* Accepted baselines.

* Use the actual indexed expression.

* Add tests that exhibit bad stringification.

* Accepted baselines.

* Short-circuit stringification on 'undefined'.

* Accepted baselines.

* Remove space.

* Accepted baselines.
2019-11-19 13:00:24 -08:00
Orta
af0d5d33b6 Improve positioning of the implement interface codefix (#34928) 2019-11-19 12:13:50 -05:00
Andrew Branch
f2146a627c Fix isInJsxText after JSXOpeningElement with type arguments (#34958)
* Fix `isInJsxText` after JSXOpeningElement with type arguments

* Do the same thing a different way
2019-11-06 15:02:45 -08:00
Sheetal Nandi
47ec514cf4 Use empty object for invalid package json contents instead of undefined (#34906)
* Use empty object for invalid package json contents instead of undefined
Fixes #34726

* Behave as if package json doesnt exist in case of invalid json in package json
2019-11-04 14:31:45 -08:00
Wenlu Wang
234680851b add template literal spans (#34699) 2019-10-30 23:54:00 -07:00
Sheetal Nandi
cbbbcfa4c5 Fix incorrectly looking for position in call/new expression arguments when looking for indentation of type arguments (#34779)
* Fix incorrectly looking for position in call/new expression arguments when looking for indentation of type arguments
Fixes #32487

* Update src/services/formatting/smartIndenter.ts

Co-Authored-By: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2019-10-28 14:02:09 -07:00
Andrew Branch
634e0ad52b Fix extract type on JS function params (#34745) 2019-10-28 10:30:59 -07:00
Sheetal Nandi
f12eee2e4b Include *.json in the root files if they are specified as root (#34676)
Fixes #33827
2019-10-25 13:48:38 -07:00
Andrew Casey
590fd3f2a2 Don't assume that all symbols have declarations
...in Find All References.  For example, global `this` doesn't in
modules.

Part of #34404
2019-10-22 15:00:30 -07:00
Andrew Casey
159b6262ea Merge pull request #34631 from amcasey/ComputedPropName
Handle undefined from getPropertyNameForPropertyNameNode
2019-10-22 10:17:05 -07:00
Andrew Casey
7862e58354 Handle undefined from getPropertyNameForPropertyNameNode
...which can be returned when the property name is computed.

Part of #34404
2019-10-21 17:41:06 -07:00
Daniel Rosenwasser
b845800bdf Add option to configure automatic optional chain completions (#34552)
Add option to configure automatic optional chain completions
2019-10-18 17:35:59 -07:00
Ron Buckton
556da72ffd [WIP] Improve optional chaining checker performance (#33794)
* Improve optional chaining checker performance

* Improve optional chaining checker performance

* Add flags to Signature

* Inline getOptionalExpression

* split checks for optional chains

* Cache optional call signatures
2019-10-18 17:27:47 -07:00
Daniel Rosenwasser
218bbcd669 Don't immediately return in getMemberSymbols. 2019-10-18 15:23:56 -07:00
Daniel Rosenwasser
9b6a027167 Perform checks prior to calling addTypeProperties. 2019-10-18 13:03:25 -07:00
Ben Lichtman
1bfc47252f Merge pull request #33938 from uniqueiniquity/classifcationAssertion
Add assertion when classification has unexpected length
2019-10-18 09:44:51 -07:00
Ben Lichtman
65561a89dd fix assertion condition 2019-10-18 09:18:16 -07:00
Daniel Rosenwasser
73e9715da5 Added option 'includeAutomaticOptionalChainCompletions' to disable '?.' completions. 2019-10-17 17:41:49 -07:00
Andrew Branch
454a3a0b0f Fix auto-imports from auto type acquisition definitions (#33766)
* Fix auto-imports from ATA typings

* Compare canonical filenames in isImportablePath
2019-10-17 13:59:09 -07:00
Andrew Branch
f41b7b59ce Fix quick info for methods whose contextual type is a mapped type property (#33930) 2019-10-17 10:54:01 -07:00
Andrew Branch
a95a25b9a7 Fix completions of optional properties in generic positions (#33937)
* fixes #30507

* Add test case for generic Partial type

* Fixes #28470

* Simplify contextFlags binary check

* Add string literal completion test

* Fix ContextFlags typings

* Speed up inference expression for completion

* Fix baseline merge

* Make contextFlags internal

* Reapply readonly array changes

* accept baselines

* Fix generic completion tests

* Re-merge ContextFlags

* Don’t change type during inference

* Fix typos and superfluous undefined arguments

* Add test for completions in unconstrained generic object literal
2019-10-17 10:45:40 -07:00
Orta
5d20c573a6 Merge pull request #34524 from orta/fix_32675
Does not add a duplicate completion when offering an export which was re-declared as a global
2019-10-17 13:08:32 -04:00
Orta Therox
85010fa6fe Make sure that global module re-exports are short-cutted to be added to completions 2019-10-17 12:33:01 -04:00
Nathan Shively-Sanders
f3a234caac Dedupe inherited jsdoc comments (#34522)
JSDoc on own properties was already deduped, but inherited jsdoc was
incorrectly not deduped.

Fixes #32708
2019-10-16 15:56:01 -07:00
Orta Therox
c40ddb183e Does not add a duplicate completion when offering an export which was re-declared as a global - fixes #32675 2019-10-16 17:02:35 -04:00
Sheetal Nandi
aaadb17afe Merge pull request #34495 from microsoft/forceDts
Add forceDtsEmit flag to getEmitOutput
2019-10-16 08:14:47 -07:00