Commit Graph

2886 Commits

Author SHA1 Message Date
Andy
6cd27a3217 Support doc comment template at function expression (#25050) 2018-06-25 11:40:45 -07:00
Andy
8923a01481 Fix test failure (#25199) 2018-06-25 11:34:04 -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
e7b338e943 Don't treat a declaration as a type argument position (#25046) 2018-06-21 10:18:37 -07:00
Andy
f3e2e891da navigationBar: Avoid double recursion on special property assignment (#25077) 2018-06-20 12:57:34 -07:00
Andy
b3f9ec3796 Fix bug: Still implement a method even if the return type is defined in another file (#24978) 2018-06-19 16:36:18 -07:00
Andy
7f553f4f93 refactorConvertToGetAccessAndSetAccess: Don't trigger on leading trivia (#25054)
* refactorConvertToGetAccessAndSetAccess: Don't trigger on leading trivia

* Update API (#24966)
2018-06-19 13:46:03 -07:00
Andy
db85f37669 fixUnusedIdentifier: Don't needlessly exclude jsdoc (#25014) 2018-06-19 13:44:00 -07:00
Nathan Shively-Sanders
03fff50fa4 Simplify getJSDocCommentAndTags (#24997)
Previously, getJSDocCommentAndTags could recur up to four times if any
of four predicates matched. However, to avoid duplicates, the predicates
have been tuned to be mutually exclusive, which means that the recursion
can be turned into a while loop. The while loop is much simpler and
safer, since it is guaranteed to only walk up the tree one time. In
addition, the extra check that adds jsdoc from initializers only runs
once, before the loop, further reducing the opportunity for duplicate
jsdocs.

I thought about further simplifying the code that gets the next node to
check, but to know when to stop the loop, I'd need a predicate that is
as complicated as the code in `getNextJSDocCommentLocation`, so I kept
the existing code, just reordering it for compactness.
2018-06-19 10:14:47 -07:00
Markus Johnsson
aa87cc5b73 Merge branch 'master' of github.com:Microsoft/TypeScript 2018-06-19 11:18:20 +02:00
Andy
e7e69ad4a2 Fix bug in importTracker: default and namespace imports are not exclusive (#24965) 2018-06-15 12:15:39 -07:00
Wesley Wigham
640af3f75e Introduce related spans into tsserver protocol (#24548)
* Introduce related spans into tsserver protocol

* Incorporate pretty output, implement esModuleInterop related span
2018-06-15 10:54:36 -07:00
Andy
7a1d75cc11 getEditsForFileRename: Don't update unrelated import (#24961)
* getEditsForFileRename: Don't update unrelated import

* Importing source file moved if it's the old path *or* new path
2018-06-14 15:42:16 -07:00
Andy
4a7a550502 moveToNewFile: Reuse code from importFixes for inserting import (#24957)
* moveToNewFile: Reuse code from importFixes for inserting import

* Fix test failures

* Update API baselines (#24966)
2018-06-14 15:41:47 -07:00
Alexander T
f007c3586b mapRoot is not filePath 2018-06-12 18:20:53 +03:00
Wesley Wigham
6c78ce31ea Set use flag (#24881) 2018-06-11 17:00:17 -07:00
Mohamed Hegazy
e07e2e0e1f Merge pull request #23423 from Kingwl/add-braces
add support for add or remove braces to arrow function
2018-06-11 13:09:38 -07:00
Andy
7df81311ac goToDefinition: Don't add duplicate definitions for VariableDeclaration and ArrowFunction at f = () => {} (#24863) 2018-06-11 11:20:34 -07:00
Andy
1aad3c6273 addClassStaticThisReferences: Don't cross class boundary (#24860) 2018-06-11 10:51:11 -07:00
Andy
986532d36b Fix bug: In findAllReferences, don't crash on static method missing body (#24814) 2018-06-11 08:43:17 -07:00
Markus Johnsson
8bc92e4a63 Update test to reflect new behavior 2018-06-10 19:58:32 +02:00
Markus Johnsson
8850f74eab Merge branch 'master' of github.com:Microsoft/TypeScript 2018-06-10 15:00:52 +02:00
Markus Johnsson
cb5b77365c Merge branch 'master' of github.com:Microsoft/TypeScript 2018-06-10 14:59:13 +02:00
Andy
04187bde8d fixStrictClassInitialization: Support array initializer (#24810) 2018-06-08 15:56:56 -07:00
Andy
e821d613a1 fixUnusedIdentifier: Remove unused writes (#24805) 2018-06-08 15:20:33 -07:00
Andy
855c3a6d4f fixUnusedIdentifier: Delete trailing comma in array binding pattern (#24800) 2018-06-08 10:39:01 -07:00
kingwl
0d730c008a Merge branch 'master' into add-braces 2018-06-09 01:32:53 +08:00
Mohamed Hegazy
b4dea5ecce Merge pull request #24760 from krk/codefix-asterisk
addMethodDeclaration codefix creates a generator function when target…
2018-06-08 08:57:49 -07:00
Andy
3822e3e4ed tryGetModuleNameAsNodeModule: Ignore file extension (#24774) 2018-06-07 15:45:03 -07:00
Andy
48dedacf3b fixStrictClassInitialization: Don't provide a default for string or number (#24767)
* fixStrictClassInitialization: Don't provide a default for `string` or `number`

* Update baselines
2018-06-07 15:03:38 -07:00
Andy
33d0893259 Add completions from literal contextual types (#24674)
* Add completions from literal contextual types

* Remove getTypesOfUnion

* undo baseline changes
2018-06-07 15:03:19 -07:00
Andy
fde6f22408 Fix bug: In newFileChanges, setParentNodes in new source file (#24765) 2018-06-07 14:28:06 -07:00
Andy
87217018b8 Add 'nameSpan' property to NavigationTree (#24698) 2018-06-07 12:43:57 -07:00
Andy
0fefaf286d moveToNewFile: Infer quote preference (#24652) 2018-06-07 12:10:48 -07:00
Andy
83c58a4fb5 Don't consider x. a new identifier location just because x has a number index signature (#24699)
* Don't consider `x.` a new identifier location just because x has a number index signature

* Update more tests
2018-06-07 12:05:47 -07:00
krk
acbda14450 addMethodDeclaration codefix creates a generator function when target is child of a YieldExpression, resolves #24728 2018-06-07 20:59:06 +03:00
Andy
735a46f838 If parsing a function type fails, parseTypeReference() to ensure something is returned (#24567)
* If parsing a function type fails, parseTypeReference() to ensure something is returned

* Avoid tryParse

* Add missing semicolon

* Don't check for undefined, check for missing type

* Don't set parameters undefined, set to missingList and return false

* Update API baselines

* Code review
2018-06-05 10:24:37 -07:00
Andy
a641e6f85f goToDefinition: Put variable definition before signature definition (#24649)
* goToDefinition: Put variable definition before signature definition

* Fix lint
2018-06-04 14:13:27 -07:00
Nathan Shively-Sanders
34e68efdae Template tag allows specification of constraints (#24600)
* Parse (and mostly support) template tag constraints

A bunch of tests hit the asserts I added though.

* Messy version is finished. Need to add a few tests

* Refactor to be smaller

* Small refactor + Add one test

* Another test

* Minor cleanup

* Fix error reporting on type parameters on ctors

* Simplify syntax of `@template` tag

This is a breaking change, but in my sample, nobody except webpack used the
erroneous syntax. I need to improve the error message, so
jsdocTemplateTag3 currently fails to remind me of that.

* Better error message for template tag

* Fix fourslash baselines

* Another fourslash update

* Address PR comments

* Simplify getEffectiveTypeParameterDeclarations

Make checkGrammarConstructorTypeParameters do a little more work
2018-06-04 11:42:46 -07:00
Andy
2ce7e5f0cd Add 'unknown' to type keywords (#24606) 2018-06-04 11:31:48 -07:00
Andy
d8cea359f7 moveToNewFile: Update namespace imports (#24612) 2018-06-04 11:30:14 -07:00
Andy
046c5ea6c1 moveToNewFile: Ignore reference to global (#24651) 2018-06-04 10:35:23 -07:00
Andy
886377f8d3 Add autoCloseTag language service (#24543)
* Add autoCloseTag language service

* Change name to getJsxClosingTagAtPosition and return an object
2018-06-04 10:08:15 -07:00
Dan Freeman
4a36ee0c62 Support import completion for merged declaration exports (#24539) 2018-06-01 09:46:56 -07:00