Commit Graph

4638 Commits

Author SHA1 Message Date
Daniel Rosenwasser
9481faab98 Only provide signature help contextually on a character trigger. 2018-07-03 17:08:32 -07:00
Daniel Rosenwasser
0fd587a3c3 Account for comments. 2018-07-03 13:02:14 -07:00
Andy
304d45d833 Canonicalize path before calling startsWith (#25364)
* Canonicalize path before calling `startsWith`

* More specific type for sourceDirectory, and add fourslash test

* Update API (#24966)
2018-07-03 11:23:19 -07:00
Daniel Rosenwasser
e13fd0c568 Merge pull request #24915 from Microsoft/triggerSignatureHelpIArdlyKnowSignatureHelp
Trigger characters in signature help
2018-07-02 23:36:57 -07:00
Andy
efc1b7df08 More thoroughly test navigateTo (#25239)
* More thoroughly test navigateTo

* Fix #25233 and #25237

* Update API (#24966)
2018-07-02 19:25:27 -07:00
Andy
5c57e14000 goToDefinition: Don't go to jsx constructor signature (#25382) 2018-07-02 17:18:07 -07:00
Daniel Rosenwasser
e56a5c1b35 Lints. 2018-07-02 16:40:08 -07:00
Andy Hanson
271bbb027c Merge branch 'master' into fixAddMissingMember_all_dedup 2018-07-02 16:06:57 -07:00
Daniel Rosenwasser
9651c4231e Account for trigger reasons, as implemented by Roslyn. 2018-07-02 16:04:48 -07:00
Daniel Rosenwasser
c046958752 Merge remote-tracking branch 'origin/master' into triggerSignatureHelpIArdlyKnowSignatureHelp 2018-07-02 15:36:41 -07:00
Mohamed Hegazy
956f9d0be2 Merge pull request #25335 from Microsoft/codeFixAddMissingEnumMember_all
Combine code-fix-all for missing class member and missing enum member
2018-07-02 15:14:19 -07:00
Andy Hanson
e0109ea93e Remove shadowed variable 2018-07-02 13:26:31 -07:00
Andy
dc2dc8d539 rename: Re-use code for isDefinedInLibraryFile (#25367) 2018-07-02 12:25:27 -07:00
Andy Hanson
f3bc891ae9 fixAddMissingMember: Improve deduplication in code-fix-all 2018-07-02 11:26:50 -07:00
Andy
a1746d4cfe Use helper functions in a few more places (#21308)
* Use helper functions in a few more places

* Fix typo

* Update API (#24966)
2018-06-29 20:07:42 -07:00
Andy
ded446573a ChangeTracker: Combine deleteDeclaration, deleteNode, and deleteNodeInList (#25276)
* ChangeTracker: Combine deleteDeclaration, deleteNode, and deleteNodeInList

* Change name

* Update API (#24966)
2018-06-29 19:53:32 -07:00
Andy Hanson
2fa27ffdf7 Combine code-fix-all for missing class member and missing enum member 2018-06-29 19:39:19 -07:00
Andy
e7543d6d81 Simplify getRangeOfEnclosingComment (#25168) 2018-06-29 16:58:28 -07:00
Andy
48d31eddc8 Split isConst into isVarConst and isEnumConst (#25312) 2018-06-29 16:47:11 -07:00
Benjamin Lichtman
ba8bc55907 Make regexp a constant 2018-06-29 11:51:56 -07:00
Benjamin Lichtman
699186083b Stop including region delimiter comments in comment fold regions 2018-06-29 11:34:58 -07:00
Mohamed Hegazy
c27dace3df Merge pull request #25182 from Kingwl/fix-missing-enum-member
add quick fix for add missing enum member
2018-06-29 10:19:23 -07:00
Wesley Wigham
297f12e92c Add bailout case to sourcemap searching code (#25212)
* Add bailout case to sourcemap searching code

* Also skip sourcemappy comments like sourceURL
2018-06-28 11:40:31 -07:00
Nathan Shively-Sanders
5c2eeb20b1 Destructuring declaration prefers type annotation type (#25282)
* Destructuring declaration prefers type annotation type

Previously, getTypeForBindingElement would always union the declarations type and
the type of the default initializer. Now, if the declaration has a type
annotation, it does not union with the initializer type. The type
annotation's type is the one used.

* Small cleanup in parentDeclarationHasTypeAnnotation

* Refactoring based on PR comments

* Combine getCombined*Flags into a single helper function

Retain the individual functions since they are used a lot.

* Remove unneeded temp
2018-06-28 10:41:38 -07:00
王文璐
d8cdd7552e do not handle enum type member 2018-06-28 09:36:26 +08:00
Andy
fd8b7f3da5 Remove redundant checks in getNameOfDeclaration (#25244) 2018-06-27 13:56:31 -07:00
Andy
1cb691f52d findPrecedingToken: default includeJsDocComment to true (#25262)
* findPrecedingToken: default includeJsDocComment to true

* Add exception for smartIndenter
2018-06-27 12:14:41 -07:00
Andy
c9d44ce395 getTouchingToken: default includeJsDocComment to true (#25258) 2018-06-27 11:15:15 -07:00
Andy
c35cb86192 When renaming at a tsx opening/closing tag, just rename the current element (#25273) 2018-06-27 11:01:38 -07:00
Andy
d957b1c8c2 fixUnusedIdentifier: Remove arguments corresponding to unused parameters (#25011)
* fixUnusedIdentifier: Remove arguments corresponding to unused parameters

* Update API (#24966)

* Fix handling of deletions: Make a list of things to delete and don't delete until the end

* Remove dummy test

* Bug fixes

* Update API (#24966)

* Move code to textChanges
2018-06-27 09:26:47 -07:00
王文璐
d6f5fc6518 add Initializer if enum value is another enum 2018-06-27 21:03:50 +08:00
Andy
c8c547a706 Only add completion for a symbol if it is accessible (#25096) 2018-06-26 18:03:07 -07:00
Andy
ab9e913af3 getEditsForFileRename: Test both before and after the rename (#25074) 2018-06-26 16:55:51 -07:00
Andy
13bc46d970 getTokenAtPosition: default includeJsDocComment to true (#25015)
* getTokenAtPosition: default includeJsDocComment to true

* Update API (#24966)

* Flip meaning of parameter

* Update API (#24966)

* Remove all `ignoreJsDocComment` uses (fixes #25162)
2018-06-26 16:20:44 -07:00
王文璐
a62a54df57 Merge branch 'master' into fix-missing-enum-member 2018-06-26 10:30:09 +08:00
王文璐
d5268c81e7 add quick fix for add missing enum member 2018-06-26 10:17:22 +08:00
Andy
0b5b7ef547 Fix removal of default import (#25200) 2018-06-25 12:41:32 -07:00
Andy
f52c881ab1 Improve verify.renameLocations (#25192) 2018-06-25 12:41:12 -07:00
Andy
6cd27a3217 Support doc comment template at function expression (#25050) 2018-06-25 11:40:45 -07:00
Andy
9aa60f27eb goToDefinition: Don't add duplicate definitions for PropertyAssignment and ArrowFunction at m: () => {} (#24995)
* goToDefinition: Don't add duplicate definitions for PropertyAssignment and ArrowFunction at `m: () => {}`

* Just use !isCallLikeExpression
2018-06-25 11:33:47 -07:00
Andy
b3a6428186 Fix completions trigger character on JSX opening tag (#25167) 2018-06-25 11:10:38 -07:00
Andy
806a661be3 Add refactor to convert named to default export and back (#24878)
* Add refactor to convert named to default export and back

* Support ambient module

* Handle declaration kinds that can't be default-exported

* Update API (#24966)
2018-06-25 10:34:24 -07:00
Wesley Wigham
bd97e12f76 Multifaceted approach to performantly enabling fileExists outside of the synchronize step in the emit host (#25107)
* Multifaceted approach to performantly enabling fileExists outside of the synchronize step in the emit host

* make cache undefinable and handle correctly

* Remove unneeded cast

* Readd assert

* More useful failure messager
2018-06-22 14:05:36 -07:00
Andy
42fc8431f7 getEditsForFileRename: Don't update import with non-relative path if the imported file didn't move (#25159) 2018-06-22 11:21:45 -07:00
Andy
cb9c3e0f6a Don't provide a path completion if a directory name was already typed (#25055) 2018-06-22 11:18:16 -07:00
Andy
e3e4c5dd2e getEditsForFileRename: For directory rename, preserve casing of suffix (#24975) 2018-06-21 11:46:13 -07:00
Andy
7a73c89c57 Convert getInsertNodeAfterOptionsWorker to switch statement (#25128) 2018-06-21 11:20:03 -07:00
Andy
e7b338e943 Don't treat a declaration as a type argument position (#25046) 2018-06-21 10:18:37 -07:00
Nathan Shively-Sanders
43d0794ba3 Fix crash when binding jsdoc-style inner namepaths (#25106)
* getDeclarationIdentifier handles undefined name

getNameOfDeclaration actually doesn't handle all declarations, only
those that produce names that could be reasonably used as an identifier.
Until now, getDeclarationIdentifier assumed that getNameOfDeclaration
always returned a name. This caused crashes whenever we tried to get the
name of something like a Constructor.

* Add test and baselines

* getNameOfDeclaration can return undefined

This requires all callers to handle it, which turns out now to be too
disruptive.

* Fix lint
2018-06-21 10:01:39 -07:00
Andy
3e50f502bb Mark some Type[] and Signature[] as ReadonlyArray (#25099) 2018-06-21 09:57:14 -07:00