3030 Commits

Author SHA1 Message Date
Andy
24a5bdd1b1
Add 'fileToRename' property to RenameInfo (#24702)
* Add 'fileToRename' property to RenameInfo

* Update tests

* Support directory rename
2018-09-10 11:25:03 -07:00
Ron Buckton
af8e44ac85
Merge pull request #26568 from Microsoft/typesVersions
Adds support for "typesVersions" redirects
2018-09-07 15:40:50 -07:00
Ron Buckton
a255d9a163 Merge branch 'master' into typesVersions 2018-09-07 13:52:12 -07:00
Andy
cbde861af6
Improve use of SemanticMeaning in symbol display (#26953) 2018-09-07 12:23:23 -07:00
Andy
b1430e5e2c
Avoid adding duplicate completion from contextual keyword (#26947) 2018-09-07 12:18:03 -07:00
Andy
d31973b905
findAllReferences: Consistently use 'this' parameter as definition site (#26950) 2018-09-06 17:06:50 -07:00
Andy
c401d63c5f
findAllReferences: Fix declarationIsWriteAccess for PropertyAssignment in destructuring (#26949) 2018-09-06 15:24:07 -07:00
Andy
a0ebbfb8f0
Fix JSX completions after boolean property (#26943) 2018-09-06 14:15:12 -07:00
Andy
8c22770ea8
Improve 'isWriteAccess' for findAllReferences (#26889) 2018-09-06 10:44:32 -07:00
Ryan Cavanaugh
4975dc85b1
Merge pull request #25822 from Kingwl/rechabilityImprove
improve enum rechability check
2018-09-05 11:46:07 -07:00
Andy
1eb3082387
Support completions inside JSDoc before EndOfFileToken (#25568) 2018-09-05 11:34:27 -07:00
Andy
06774962ed
Properly handle JS enum symbols (#26893) 2018-09-05 11:19:32 -07:00
Nathan Shively-Sanders
ff05082e45
Bind non-expando property assignments at top-level (#26908)
* Bind non-expando property assignments at toplevel

Previously, only property assignments with expando initialisers were
bound in top-level statements. Now, all property assignments are bound.

This requires a matching change in the checker to make sure that these
assignments remain context sensitive if their valueDeclaration is a
'real' declaration (ie a non assignment-declaration).

* Add baselines for new test
2018-09-05 10:53:43 -07:00
Tim Schaub
262ea5b06e Skip asterisks after newline when parsing JSDoc types (#26528)
* Skip asterisks after newline when parsing JSDoc types

* Single boolean expression

* Test for parsing and printing multiline function signatures with *
2018-09-04 15:41:08 -07:00
Nathan Shively-Sanders
540e8b9eb0
Collect jsdoc tags for type parameters (#26824)
Before the template tag, there was no reason to do this, but now you can
add JSDoc for type parameters in Typescript.
2018-09-04 09:29:19 -07:00
Sheetal Nandi
bf6d265b97 Add test for signaure help with recursive type
Test for #26155
2018-08-30 10:12:04 -07:00
Andy
cea49dfb0d
Completion for tuple index doesn't need to include quotes (#26750) 2018-08-29 16:38:42 -07:00
Andy
f78dc2ad11
importFixes: Only provide a fix using the best module specifier for a given module (#26738) 2018-08-29 16:18:56 -07:00
Andy
7b4f864b49
moduleSpecifiers: Simpler criteria for preferring relative path vs baseUrl (#25803)
* moduleSpecifiers: Simpler criteria for preferring relative path vs baseUrl

* Don't unconditonally use a path mapping
2018-08-29 15:06:26 -07:00
Ron Buckton
210de32933 Merge branch 'master' into typesVersions 2018-08-29 13:26:13 -07:00
Andy
02630273a2
codeFixInferFromUsage: Assume that using x[0] means that x is an array (#26739)
* codeFixInferFromUsage: Assume that using `x[0]` means that `x` is an array

* Remove unnecessary '||' with non-falsy LHS

If only there were some kind of type-checker for JavaScript that could detect this sort of thing
2018-08-29 11:37:31 -07:00
Andy
0feeb48783
Make generator function name a completion list blocker (#26640)
* Make generator function name a completion list blocker

* Improvements for class/object members

* Separate KeywordCompletionFilter.None and .All
2018-08-29 10:53:32 -07:00
Ron Buckton
5f6a2cbf69 Merge branch 'master' into typesVersions 2018-08-28 17:37:23 -07:00
Andy
cff04e6050
Ensure JsonSourceFile has all the non-optional properties of SourceFile (#26162)
* Ensure JsonSourceFile has all the non-optional properties of SourceFile

* Set properties in parseSourceFile
2018-08-28 16:43:14 -07:00
Andy
9106fdbc47
Support signature help for type parameters of a type (#26702) 2018-08-28 14:21:09 -07:00
Andy
552bd1c8a2
Support import fix/completions for export = (#25708) 2018-08-28 13:04:11 -07:00
Andy
b94061c587
getEditsForFileRename: Avoid changing import specifier ending (#26177)
* getEditsForFileRename: Avoid changing import specifier ending

* Support .json and .jsx extensions

* Restore typeRoots tests

* Fix json test

* When --jsx preserve is set, import ".tsx" file with ".jsx" extension

* Support ending preference in UserPreferences
2018-08-28 13:03:24 -07:00
Andy
b183418124
Fix bug: Don't go to *any* constructor signature for jsx element (#26715) 2018-08-28 11:06:14 -07:00
Andy
1b5de9d16e
Uncomment tests fixed with #23631 (#26700) 2018-08-28 10:25:00 -07:00
Ron Buckton
dc5cd9676b Switch to paths-like pattern matching 2018-08-28 09:33:03 -07:00
Andy
0a59da1a2c
In pickLongestCandidateSignature, instantiate using inferred type arguments (#26646) 2018-08-27 10:30:25 -07:00
Andy
e411381266
Fix bug: Don't let empty signature documentation override other documentation (#26638) 2018-08-27 09:38:52 -07:00
Wenlu Wang
8ba501926a try get add missing member return type from context (#26250)
* try get add missing member return type from context

* support contextual type
2018-08-23 21:31:53 -07:00
Andy
f3ceebe552
Fix duplicate completions bugs (#26648)
* Fix duplicate completions bugs

* Remove old TODO
2018-08-23 18:22:07 -07:00
Nathan Shively-Sanders
6ea2278c7a
Get symbol at location for class expressions/keywords (#26636)
* getSymbolAtLocation understands class expressions

Previously it did not.

* Update baselines
2018-08-23 11:27:03 -07:00
Andy
194ffb3449
fourslash: Allow to verify textChanges without changing file content (#26607) 2018-08-22 15:20:33 -07:00
Ron Buckton
6f7a37c99a Added fourslash test 2018-08-20 17:44:34 -07:00
Ryan Cavanaugh
7a658256a2
Merge pull request #26431 from mattmccutchen/issue-26430
Mapped types like Pick<T, K> should adopt property documentation from T.
2018-08-16 13:35:55 -07:00
Nathan Shively-Sanders
cc67ce1141
Property assignments in Typescript (#26368)
* Allow special property assignments in TS

But only for functions and constant variable declarations initialised with
functions.

This specifically excludes class declarations and class expressions,
which differs from Javascript. That's because Typescript supports
`static` properties, which are equivalent to property assignments to a
class.

* Improve contextual typing predicate

Don't think it's right yet, but probably closer?

* More fixes.

The code is still fantastically ugly, but everything works the way it
should.

Also update baselines, even where it is ill-advised.

* Cleanup

* Remove extra whitespace

* Some kind of fix to isAnyDeclarationName

It's not done yet.

Specifically, in TS:
Special property assignments are supposed to be declaration sites (but not all
top-level assignments), and I think I
got them to be. (But not sure).

In JS:
Special property assignments are supposed to be declaration sites (but not all
top-level assignments), and I'm pretty sure ALL top-level assignments
have been declaration sites for some time. This is incorrect, and
probably means the predicate needs to be the same for both dialects.

* Add fourslash and improve isAnyDeclarationName

Now JS behaves the same as TS.

* Cleanup from PR comments
2018-08-15 15:25:25 -07:00
Matt McCutchen
d7b802577c Mapped types like Pick<T, K> should adopt property documentation from T.
Fixes #26430.
2018-08-13 19:56:20 -04: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
Andy
4bb740218d
getDefaultExportInfo: Use getImmediateAliasedSymbol instead of getAliasedSymbol (#26364) 2018-08-10 14:35:18 -07:00
Andy
a73161e9d5
Don't store @template constraint in a TypeParameterDeclaration node (#26283)
* Don't store @template constraint in a TypeParameterDeclaration node

* Code review

* Update API
2018-08-09 17:39:15 -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
Anders Hejlsberg
20ebe1eb2b
Merge pull request #26244 from Microsoft/fixThisAndContextualTypes
Revise logic that computes the contextual type for a parameter
2018-08-09 06:07:11 -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
Anders Hejlsberg
9d71023b5c Add fourslash tests 2018-08-06 16:33:21 -07:00