Commit Graph

2454 Commits

Author SHA1 Message Date
Priyantha Lankapura
743d8dbe0a Fix to remove extra space between function and array index. (#21113)
https://github.com/Microsoft/TypeScript/issues/21111
2018-01-10 09:30:35 -08:00
Sharon Rolel
c0bdd12c4c add fixAwaitInSyncFunction code fix (#21069)
* add fixAwaitInSyncFunction code fix

* Just insert the keyword

* only one codefix

* remove comment

* Change explicit return type T to Promise<T>

* Review changes

* Change codefix message
2018-01-09 17:15:08 -08:00
Andy
8bce69e6bd Add refactoring to convert CommonJS module to ES6 module (#19916)
* Add refactoring to convert CommonJS module to ES6 module

* Code review

* includeGlobals -> excludeGlobals

* Improve handling of `module.exports = require("...")`

* Allow NoSubstitutionTemplateLiteral as argument to createLiteral
2018-01-09 13:15:47 -08:00
Andy
9aa99b90c7 Include directories in completions for path mapping (#21103) 2018-01-09 13:15:30 -08:00
Andy
fed34cd616 Fix bug: normalize path after combining (#21100) 2018-01-09 11:54:35 -08:00
Andy
191b9750c3 Clear jsDocCache for reused nodes (#21099) 2018-01-09 11:22:15 -08:00
Andy
82fb294924 For import fix, support path mapping value that begins in "./" or ends in ".ts" (#21035)
* For import fix, support path mapping value that begins in "./" or ends in ".ts"

* Handle repeated "./" in path

* Rename parameters to indicate that they're relative to baseUrl

* Support relative path beginning with `..\`

* Remove unused function
2018-01-09 10:34:35 -08:00
Wesley Wigham
fdd8a52240 Offer per-member diagnostics for incorrectly implemented inherited members (#21036)
* Offer per-member diagnostics for incorrectly implemented inherited members on classes

* Revise error message, make containingChain a thunk

* Fix typo in comment
2018-01-09 10:20:07 -08:00
Andrew Casey
ba979fa537 Delete redundant test (#21085)
The same test already exists for TS.
2018-01-09 10:11:28 -08:00
Andrew Casey
ef5a289966 Merge pull request #21014 from amcasey/GH19115
Handle different default export forms the same way in import code fixes
2018-01-08 19:07:43 -08:00
Andy
89ceb4b9b5 Support completions that require changing from dot to bracket access (#20547)
* Support completions that require changing from dot to bracket access

* Use insertText and replacementSpan

* Rename includeBracketCompletions to includeInsertTextCompletions

* Don't add completions that start with space
2018-01-08 18:57:46 -08:00
Andy
c4d76292f1 Ensure visitor visits the awaitModifier of a ForOfStatement (#21078) 2018-01-08 17:22:32 -08:00
Wesley Wigham
7e6315075d Synthesize namespace records for proper esm interop (#19675)
* Integrate importStar and importDefault helpers

* Accept baselines

* Support dynamic imports, write helpers for umd module (and amd is possible) kinds

* Accept baselines

* Support AMD, use same helper initialization as is normal

* update typechecker to have errors on called imported namespaces and good error recovery with a quickfix

* Overhaul allowSyntheticDefaultExports to be safer

* Put the new behavior behind a flag

* Rename strictESM to ESMInterop

* ESMInterop -> ESModuleInterop, make default for tsc --init

* Rename ESMInterop -> ESModuleInterop in module.ts, add emit test (since fourslash doesnt do that)

* Remove erroneous semicolons from helper

* Reword diagnostic

* Change style

* Edit followup diagnostic

* Add secondary quickfix for call sites, tests forthcoming

* Add synth default to namespace import type, enhance quickfix

* Pair of spare tests for good measure

* Fix typos in diagnostic message

* Improve comment clarity

* Actually accept the updated changes to the esmodule interop description

* ESModule -> esModule

* Use find and not forEach

* Use guard

* Rely on implicit falsiness of Result.False

* These should have been emit flags
2018-01-08 16:36:23 -08:00
Mohamed Hegazy
2869657da7 Update failing test 2018-01-08 15:22:14 -08:00
Mohamed Hegazy
45a10c8401 Merge branch 'import-quickinfo' of https://github.com/jwbay/TypeScript into jwbay-import-quickinfo 2018-01-08 14:43:56 -08:00
Wenlu Wang
7154df10df add support for insertSpaceBeforeTypeAnnotation (#20466) 2018-01-08 13:25:02 -08:00
Wenlu Wang
0ecdc876f3 imporve conditional operator if missing colon token (#20498)
f2
2018-01-08 13:16:17 -08:00
Andy
97c3e9c3ef Support all path mappings that end in "*" in completions (#21072)
* Support all path mappings that end in "*" in completions

* Check for uppercase TsConfig.JSON
2018-01-08 12:28:50 -08:00
Andy
50fa0f61f5 Fix bug: Resolve module symbol before checking whether module export is a re-export (#20989)
* Fix bug: Resolve module symbol before checking whether module export is a re-export

* Remove unnecessary @nolib
2018-01-08 11:33:57 -08:00
Andy
f34de1a1ca Support find-all-references starting from a reference path or reference types comment (#21007) 2018-01-08 11:33:14 -08:00
Andy
f83283c068 Improve parse error for double comma somewhere inside a call expression (#20399) 2018-01-08 10:38:55 -08:00
Daniel Rosenwasser
1041f09c27 Merge pull request #20941 from mariusschulz/stringCompletionsForIndexedAccessTypes
Return string completions for indexed access types
2018-01-06 21:07:00 -08:00
Andrew Casey
1957dfef8e Merge pull request #20991 from amcasey/GH18794
Refine extends-to-implements code fix
2018-01-05 17:52:22 -08:00
Andy
e35585b938 Fix conflict between formatting rules (#21038) 2018-01-05 17:33:29 -08:00
Andrew Casey
b07797cc97 Convert test from JS to TS 2018-01-05 16:23:08 -08:00
Nathan Shively-Sanders
e78ac47208 Merge pull request #20711 from Microsoft/defer-inference-for-recursive-mapped-types
Defer inference for homomorphic mapped types
2018-01-05 16:01:26 -08:00
Andrew Casey
13c26fe8cf Add regression tests for rename display name 2018-01-05 13:32:01 -08:00
Benjamin Lichtman
5bd477e441 Merge pull request #20924 from uniqueiniquity/jsxSpreadAttributeFormatting
Jsx spread attribute formatting
2018-01-05 10:27:47 -08:00
Marius Schulz
25c5e57091 Return string completions for indexed access types 2018-01-05 18:14:06 +01:00
Andrew Casey
afae97ce6e Refine extends-to-implements code fix
1. Retain surrounding trivia when swapping the keyword.
 2. Insert commas at the full-starts, rather than starts, of existing
 keywords when merging with existing implements clauses.

Fixes #18794
2018-01-04 17:55:12 -08:00
Herrington Darkholme
67eabb98bc fix #20449, insert space between decorators (#20491) 2018-01-04 16:57:27 -08:00
uniqueiniquity
624f68a8e1 Simplify marker names 2018-01-04 16:51:19 -08:00
Matt Bierner
12d5063e4c Add kindModifier to mark if a completion item is for an optional field (#20839)
* Add kindModifier to mark if a completion item is for an optional field

For #12458

Adds a new KindModifier for completion items to mark when a property is optional. This can be used by editors to either change the item icon or add a `?` to the item text

* Add method test

* Baseline-accept
2018-01-04 16:36:31 -08:00
Andrew Casey
1e93967ec4 Add regression tests 2018-01-04 15:34:19 -08:00
Benjamin Lichtman
96530719ac Merge pull request #20912 from uniqueiniquity/jsxFragmentFormatting
Fix formatting for JSX fragment tags
2018-01-04 15:27:36 -08:00
Matt Bierner
3f577b8617 Fix quick info for require template string (#20851)
* Fix quick info for require template string

Fixes #20850

* Add path completions tests
2018-01-04 15:17:40 -08:00
Nathan Shively-Sanders
0834732cd1 Update fourslash baselines too 2018-01-04 12:53:03 -08:00
Wenlu Wang
2ea5f58d60 quick fix of indexed access type (#20956) 2018-01-04 12:45:16 -08:00
Andy
db82a5604a Improve find-all-references for redeclared property in a derived interface (#21002) 2018-01-04 10:58:14 -08:00
Nathan Shively-Sanders
cc7710c71c Add fourslash tests and update missed baselines 2018-01-04 10:55:41 -08:00
Justin Bay
56fc112d8d add more information to quickinfo for imported symbols 2018-01-04 01:17:23 -05:00
Andy
7de8c6bcaa For export default foo, use 'foo' for the completion identifier name, not the module name (#20987) 2018-01-03 14:56:59 -08:00
Andy
a33f229d82 Support completions contextual types in more places (#20768)
* Support completions contextual types in more places

* Adjust formatting
2018-01-03 13:51:33 -08:00
Nathan Shively-Sanders
5539e11b76 Merge pull request #20609 from Microsoft/getRootSymbols
Ensure getRootSymbols always works recursively
2018-01-03 09:44:27 -08:00
Andy
74b8160430 In import fixes, use a ".js" extension if other imports do (#20624)
* In import fixes, use a ".js" extension if other imports do

* Code review
2018-01-03 08:20:53 -08:00
Benjamin Lichtman
05a6f343f7 Update test 2017-12-28 13:10:32 -08:00
Benjamin Lichtman
80b7983d2c Add formatting tests 2017-12-27 16:56:03 -08:00
Andy
813864f021 For import completion, use an existing namespace import (#20457) 2017-12-21 11:16:09 -08:00
Daniel Rosenwasser
89b5d8cb14 Merge pull request #19204 from Kingwl/fix-completions-with-template-literal-type
fix completions for string literal types with template string (#19162)
2017-12-19 11:18:21 -08:00
Andy
60bd262437 Don't treat class name as a completion list blocker if the position comes after it (#20762) 2017-12-18 12:41:05 -08:00