Commit Graph

4561 Commits

Author SHA1 Message Date
Andy ed20f7d983 Simplify tryDeleteDeclaration (#24808) 2018-06-11 13:10:29 -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
Ryan Cavanaugh f4fcb1912c Merge pull request #24465 from RyanCavanaugh/tsbuild
"tsc -b" with minimal watch capabilities
2018-06-10 05:15:53 +12: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
krk d7a0619009 Inlined asterisk token creation. 2018-06-08 14:49:11 +03: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
Ryan Cavanaugh cf87bd446d Merge branch 'master' into tsbuild 2018-06-05 14:55:51 -07:00
Wesley Wigham d9b93903c0 Use more nodelike paths for import types when possible (#24610)
* Use more nodelike paths for import types when possible

* move functionality from services into compiler, fix with propert file/directory conflict handling

* mark suspect cast
2018-06-05 12:54:36 -07:00
Ryan Cavanaugh 45842a0c34 Merge remote-tracking branch 'weswigham/sourcemap-concatenation-station' into tsbuild 2018-06-05 12:31:32 -07:00
Ron Buckton fbeb58a147 Merge pull request #23893 from Microsoft/libReference
Adds 'lib' reference directives
2018-06-04 16:14:52 -07:00
Ron Buckton 666841264c Merge branch 'master' into libReference 2018-06-04 14:38:56 -07:00
Andy b3a4b72a16 Always include Jsdoc comment in getTouchingPropertyName (#23379) 2018-06-04 14:15:41 -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
Ron Buckton fb09aeb23d Remove debugger statement 2018-06-04 13:42:31 -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
Benjamin Lichtman c6bab0f395 Remove redundant null assertion 2018-06-04 09:20:49 -07:00
Benjamin Lichtman 8f14e24575 Remove second get call 2018-06-01 15:32:23 -07:00
Benjamin Lichtman 34cee162ed Replace has with get and check undefined 2018-06-01 15:21:22 -07:00
Benjamin Lichtman 45f9370997 Handle installed package missing from registry 2018-06-01 14:11:45 -07:00
Ryan Cavanaugh 7e9e29ce64 Store + use the resolved path of sourceFiles in proj. ref. scenarios 2018-06-01 13:20:57 -07:00
Dan Freeman 4a36ee0c62 Support import completion for merged declaration exports (#24539) 2018-06-01 09:46:56 -07:00
Andy d671c7ae96 getEditsForFileRename: Support directory rename (#24305)
* getEditsForFileRename: Support directory rename

* Code review

* Handle imports inside the new file/directory

* Document path updaters

* Shorten relative paths where possible

* Reduce duplicate code

* Rewrite, use moduleSpecifiers.ts to get module specifiers from scratch instead of updating relative paths

* Update additional tsconfig.json fields

* Add test with '.js' extension

* Handle case-insensitive paths

* Better tsconfig handling

* Handle properties inside compilerOptions

* Use getOptionFromName
2018-06-01 08:23:37 -07:00
Andy e65444214c Remove deprecated internal method (#24540) 2018-06-01 08:14:07 -07:00
Andy 9d42ab983d implementations: Use declaration name for the span (#24537)
* implementations: Use declaration name for the span

* Always get name in nodeEntry
2018-05-31 13:32:02 -07:00
Sheetal Nandi 997991fdcb Merge pull request #24529 from Microsoft/suggestionDiagnosticsToken
Suggestion diagnostics to wire cancellationToken
2018-05-31 13:22:49 -07:00
Mohamed Hegazy 1f66f21e82 Merge pull request #24431 from Zzzen/master
Document highlights on yield keywords highlight other occurrences in …
2018-05-31 12:52:56 -07:00
Sheetal Nandi eab21e5b77 Merge branch 'master' into suggestionDiagnosticsToken 2018-05-31 12:46:33 -07:00
Nathan Shively-Sanders d187de2076 Better JS container binding (#24367)
* Static assignments to class expressions work

* Bind static properties of functions too

Also update SymbolLinks in getTypeOfFuncClassEnumModule so that the
type gets cached correctly.

* Remove initializer handling:obj literals+type lookup

Also include a couple of improved baselines

* Fix 1-nested js containers:binding+cross-file merge

* Consolidate check into one utility

The utility is horrible and needs to change, but at least it's in one
place.

Next step is to make the utility like getDeclarationOfAlias, except
getDeclarationOfJSAlias.

* Defaulted assignments now (mostly) work

* Default assignment definitely work, and IIFEs kind of do

* n-nested undeclared containers now seem to work

Merging even seems to work ok.

* Handle prototype+prototype property assignments

Perhaps in the wrong way. I have an idea how to simplify them.

* Remove prototype special-case

1. It's not completely removed; the checker code in
getJavascriptClassType needs to be fixed, among other places.
2. I didn't actually remove the code so that it will be easier to see
what used to be there on Monday.

Regardless, the code will be much simpler and seems to be mostly
improved with very little work so far.

* Allow more merges+accept baselines

* Update more baselines

* Fix js initializer check in bindPropertyAssignment

* Fix codefixes

* Rest of strictNullChecks cleanup + other cleanup

1. Remove a few TODOs
2. Remove extraneous SymbolFlag
3. Simplify isSameDefaultedName

* Binder cleanup

* Checker cleanup

* Almost done with utilities cleanup

* Utilities cleanup

* Require js initializer to be (1) JS (2) initializer

Change getDeclarationOfJSInitializer to require that the provided js
initializer be in a javascript file, and that it is the initializer of
the retrieved declaration.

* Use getSymbolOfNode instead of accessing symbol directly

* Ugh. Start over with just test cases

* Handle additional cases in getTypeOfVariableOrParameterOrProperty

These are cases in a really embarrassing check, in which we admit that
the symbol flags steered us wrong and switch to
getTypeOfFuncClassEnumModule instead (which never asserts).

* Add test case for #24111

* Address PR comments
2018-05-31 11:41:26 -07:00
Sheetal Nandi b0f039c9e2 Make suggestion diagnostics to wire cancellationToken
This especially needed if its a js file without the ts-check, the file wont be typechecked in getSemanticDiagnostics
Fixes part of #19458
2018-05-31 10:47:17 -07:00
Ron Buckton b4e113b94e Merge branch 'master' into libReference 2018-05-31 10:02:08 -07:00
Ron Buckton 7de55fbb7e PR Feedback 2018-05-31 09:50:51 -07:00
Zzzen 2a8ff1c8d9 Merge remote-tracking branch 'ms/master' 2018-05-31 20:49:43 +08:00
Andy 2cb46407b1 moveToNewFile: Remove newlines after last moved statement (#24503) 2018-05-30 15:16:03 -07:00
Vyacheslav Pukhanov 75f20f9b65 fixUnusedIdentifier: fix "Remove variable statement" codefix (#24497)
* fixUnusedIdentifier: fix "Remove variable statement" codefix

* Add test for a single "Remove variable statement" codefix in a file
2018-05-30 14:51:08 -07:00