Commit Graph

4717 Commits

Author SHA1 Message Date
Ron Buckton
6f7a37c99a Added fourslash test 2018-08-20 17:44:34 -07:00
Ron Buckton
015babb6f7 Initial support for 'typesVersions' 2018-08-20 16:57:18 -07:00
Andy
ee25cdecbc Update LKG and remove newly unnecessary non-null assertions (#26515) 2018-08-17 09:13:43 -07:00
Andy
ad63468ed5 noUnusedLocals: f(x = 1) does not use x (#26366) 2018-08-13 11:14:52 -07:00
Sheetal Nandi
2b83b67aa3 Merge pull request #26140 from Kingwl/completionUnionType
improve completions for union type in type arguments
2018-08-13 10:36:19 -07:00
Elizabeth Dinella
421730a68d Refactoring promises returning functions to use async and await (#26373) 2018-08-10 16:11:45 -07:00
Andy
08f5edbd03 Treat NoSubstitutionTemplateLiteral like StringLiteral in more places (#26330)
* Treat NoSubstitutionTemplateLiteral like StringLiteral in more places

* Move isStringOrNumericLiteral closer to its only use
2018-08-10 16:00:08 -07:00
Andy
4bb740218d getDefaultExportInfo: Use getImmediateAliasedSymbol instead of getAliasedSymbol (#26364) 2018-08-10 14:35:18 -07:00
Andy
5efd1cb4a7 fixAddMissingMember: Support interface and don't crash on type parameter (#25995)
* fixAddMissingMember: Support interface and don't crash on type parameter

* Remove InfoBase
2018-08-09 17:32:28 -07:00
王文璐
23601a10b8 improve completions for union type in type arguments 2018-08-09 17:26:34 +08:00
Andy
1a05f13aef moveToNewFile: Don't remove empty named imports (#26265) 2018-08-07 12:54:46 -07:00
Andy
794f3a5e76 goToTypeDefinition: Go to function return type (#25952)
* goToTypeDefinition: Go to function return type

* Add more tests

* If a function returns 'void' or some other type with no definition, just return the function definition.
2018-08-07 12:54:19 -07:00
Andy
937afab4b0 Support signature help for contextual parameter type (#26022) 2018-08-06 16:46:30 -07:00
Andy
d0ed21cad1 completions: 'true' and 'false' are type keywords (#26237) 2018-08-06 12:42:56 -07:00
Andy
9c9f3e3cf9 importFixes: When one file redirects to another, consider both for global import specifiers (#25834)
* importFixes: When one file redirects to another, consider both for global import specifiers

* Add test for #26044

* Avoid a symlinked package globally importing itself (fixes another case of #26044)

* Compare to node_modules with getCanonicalFileName
2018-07-31 17:28:56 -07:00
Andy
f326b4b7cb Make import fix for default import mention that it's a default import (#26105) 2018-07-31 17:28:35 -07:00
Andy
0d1a49c865 Ignore trailing comma when resolving signature for quick info (#25841)
* Ignore trailing comma when resolving signature for quick info

* Add test for signature help
2018-07-31 11:39:39 -07:00
Andy
5e1872f0c0 getDocCommentTemplateAtPosition: Return result if in empty comment (#26026) 2018-07-27 17:34:16 -07:00
Andy
57d425169a createJavaScriptSignatureHelpItems: Use array helpers and simplify (#26025) 2018-07-27 17:33:17 -07:00
Andy
d40d54984e Support deleting all unused type parameters in a list, and deleting @template tag (#25748)
* Support deleting all unused type parameters in a list, and deleting @template tag

* Support type parameter in 'infer'
2018-07-27 11:55:31 -07:00
Andy
3bfe91cdd8 navigationBar: Fix bug for shorthand ambient module (#25992) 2018-07-26 17:27:12 -07:00
Andy
af3f737451 Fix bug for isValidTrigger when contextToken is undefined (#25993) 2018-07-26 17:26:58 -07:00
Andy
0e5af11625 Fix bugs for go-to-definition on mapped type method (#25991) 2018-07-26 17:26:41 -07:00
Andy
998c911c49 Break createSignatureHelpItems into functions (#25948) 2018-07-26 17:26:29 -07:00
Andy
0227997fa5 Use import().T for import completions/fixes of pure types in JS files (#25852)
* Use `import().T` for import completions/fixes of pure types in JS files

* Don't call tryUseExistingNamespaceImport if position undefined
2018-07-26 16:16:57 -07:00
Andy
673ae746da Simplify and inline getPropertySymbolsFromType (#25940)
* Simplify and inline getPropertySymbolsFromType

* Combine lambdas
2018-07-26 11:52:22 -07:00
Andy
f12e9a8389 Minor refactor in goToTypeDefinition (#25951) 2018-07-25 17:10:06 -07:00
Andy
1e8a5bf2f1 signatureHelp: Factor out 'isSyntacticOwner' function (#25518) 2018-07-25 17:01:35 -07:00
Andy
7546fd03c6 Simplify getContainers (#23323) 2018-07-25 12:30:13 -07:00
Andy
d60f4988a6 In getPropertySymbolsFromContextualType, use union discriminant to filter types (#25914) 2018-07-25 11:53:20 -07:00
Nathan Shively-Sanders
9658b476c2 Fix inferFromUsage on index signatures (#25934)
* Fix inferFromUsage on index signatures

1. Check the argumentExpression to determine the index signature type.
Previously, the code mistakenly checked the type of the element access
itself, which never returned a good type.
2. If inference for the index signature type fails, substitute anyType.
Previously, the code would create a bad index signature with an
undefined type.
3. Add tests. Previously, there were no tests.

* Fixing (1) means that number index signatures are now created.
Previously, only string index signatures would be created.
* Fixing (2) means that index signatures will be inferred from single
usage like `return a[0]`. Previously, the refactoring would fail,
perhaps because of a check when stringifying the index signature (I
haven't tracked down why.)

* Update fourslash test with improved inference
2018-07-25 10:51:11 -07:00
Andy
e4d4b0ae4b Handle PropertyAssignment in getCommentOwnerInfo (#25911) 2018-07-24 17:43:46 -07:00
Andy
93722c8942 findAllReferences/rename: Search in all open projects (#25648)
* findAllReferences/rename: Search in all open projects

* Avoid needing a dummy location when location is unused

* Remove Program#getDeclarationEmitPath

* Only iterate over enabled projects
2018-07-20 16:53:59 -07:00
Andy
3d672d9550 Ensure fixSpelling and importFixes still trigger on "Did you mean the instance/static member ..." (#25847) 2018-07-20 16:51:35 -07:00
Andy
e103692f32 Don't report quickInfo inside a comment in a PropertyAccessExpression (#25813) 2018-07-20 11:49:21 -07:00
Wenlu Wang
fedcd3a1b4 improve completions keyword for function like body (#25824) 2018-07-20 08:25:16 -07:00
Andy
46827f4a76 Handle completions at name of namespace declaration (#25661)
* Handle completions at name of namespace declaration

* Handle namespace merging
2018-07-19 10:26:18 -07:00
Andy
854462d383 Fix formatting at trailing comma (#25706) 2018-07-17 15:21:35 -07:00
Andy
89f2af17f0 Avoid using old node in import fix to use namespace import (#25729) 2018-07-17 13:34:56 -07:00
Andy Hanson
1038c76f88 navigationBar: Don't merge unrelated grandchildren 2018-07-16 12:38:38 -07:00
Andy
afdd47c9ce Simplify rules for isControlFlowEndingStatement (#25693) 2018-07-16 11:17:46 -07:00
Jordi Oliveras Rovira
4f411a8cce Change jsDocTagNames to lower case. 2018-07-14 01:02:20 +02:00
Andy
3f4412b173 getContainingList: Handle TypeAliasDeclaration (#25614)
* getContainingList: Handle TypeAliasDeclaration

* Handle ClassExpression and InterfaceDeclaration
2018-07-13 10:30:22 -07:00
Andy
27da9eab8d fixUnreachableCode: Don't delete whole block when non-first line is unreachable (#25625) 2018-07-13 09:57:04 -07:00
Andy
88c6ced3c6 indentMultilineCommentOrJsxText: Fix bug when 'parts' is empty (#25645) 2018-07-13 09:56:21 -07:00
Andy
af412e39cf mapTextChangesToCodeEditsUsingScriptInfo: Handle tsconfig.json text change (#25586)
*  mapTextChangesToCodeEditsUsingScriptInfo: Handle tsconfig.json text change

* Can't use `program.getSourceFile()` to determine file existence when multiple projects exist

* Use direct union instead of discriminated union
2018-07-12 12:09:04 -07:00
Andy
f9764d17f0 fixUnusedIdentifier: Support deleting @template tag (#25597)
* fixUnusedIdentifier: Support deleting @template tag

* Just return createTextRangeFromNode instead of adjusting range
2018-07-12 11:26:17 -07:00
Andy
5f4a03c408 Ensure TypeChecker#getTypeAtLocation returns a defined result (#25583)
* Ensure TypeChecker#getTypeAtLocation returns a defined result

* Update additional baseline
2018-07-11 16:33:56 -07:00
Andy
52486ae362 Improve isPossiblyTypeArgumentPosition (#25043)
* Improve isPossiblyTypeArgumentPosition

* Update API (#24966)

* Handle new Type<Type<

* Add test for `new C < C<`
2018-07-11 11:15:04 -07:00
Andy
5e2102799b Reduce non-null assertions in getPropertySymbolsFromContextualType (#24675) 2018-07-10 16:53:08 -07:00