Commit Graph

4102 Commits

Author SHA1 Message Date
Andy
74f01abfcf Clean up findPrecedingToken and avoid returning whitespace-only jsx text token (#21903) 2018-02-12 14:42:16 -08:00
Andy
458c12fa78 importFixes: Fix bug by using replaceNode and removing changeIdentifierToPropertyAccess (#21898) 2018-02-12 13:05:40 -08:00
Sheetal Nandi
d6d9953f6d Fix completion of jsx attributes in self closing element
Fixes #21844
2018-02-12 11:57:20 -08:00
Andy
fcf348610c documentHighlights: Handle some invalid modifier locations (#21893) 2018-02-12 11:34:49 -08:00
Andrew Casey
ddf206b184 Merge pull request #21845 from amcasey/GH21793
Harden Extract Symbol against symbols without declarations
2018-02-12 10:40:31 -08:00
Mohamed Hegazy
3fb481ff40 Multiple telemetry debug assert failure fixes (#21886)
* Use getAllowSyntheticDefaultImports to access `--allowSyntheticDefaultImport` value

* Fix #21788: Handel missing imporotClause case

* Fix #21789: Add a defensive check to forgottenThisPropertyAccess code fix for non-identifier locations

* Do not suggest prefix with `this` if the name we are looking for is diffrent from the errorLocation

* Fix #21796: Handel case of unknown module

* Add check to capture more info for #21800

* Fix #21807: check for symbol before looking up its flags

* Fix #21812: Gracefully fail if the token is not `this`.
2018-02-12 10:34:17 -08:00
Eric Grube
879cb69d6a add beautifier rule for space after close paren and destructure bracket (#21859) 2018-02-10 12:45:54 -08:00
Priyantha Lankapura
a732ff6b35 Add type infer formatting (#21850)
* add test for type infer formatting

* Fix type infer formatting

* update test to use condtional
2018-02-10 12:36:04 -08:00
Andrew Casey
e65a1a429c Harden Extract Symbol against symbols without declarations
Fixes #21793
2018-02-09 19:42:34 -08:00
Andrew Casey
025418fdb0 Handle class declarations without names in Extract Symbol
Fixes #21816
2018-02-09 19:09:25 -08:00
Andrew Casey
22c4862d9e Merge pull request #21835 from amcasey/GH21786
Handle variable declaration without initializer in Convert to ES6 Module
2018-02-09 18:21:50 -08:00
Andrew Casey
1baae42149 Handle variable declaration without initializer in Convert to ES6 Module
Fixes #21786
2018-02-09 18:08:47 -08:00
Andrew Casey
ab5596e785 Call replaceNode rather than replaceRange
...where convenient.  Same for deleteNode/Range.
2018-02-09 17:51:28 -08:00
Andrew Casey
8d1f316414 Eliminate ChangeMultipleNodesOptions in favor of smart separators 2018-02-09 16:06:14 -08:00
Andy
49e78f68d2 findAllRefs: Fix bug for export not at top-level of a module/namespace (#21846) 2018-02-09 15:10:34 -08:00
Andy
425a4182a3 Handle empty declaration list in Convert to ES6 Module (#21843)
* Handle empty declaration list in Convert to ES6 Module

* Fix test
2018-02-09 14:46:57 -08:00
Benjamin Lichtman
f989ef7261 Merge pull request #21004 from uniqueiniquity/updateATA
Enable typings cache entries to expire and be updated
2018-02-09 14:17:26 -08:00
Andy
171b68c9e7 Add assertions for bad symbol declaration (#21837)
* Add assertions for bad symbol declaration

* Fix lint
2018-02-09 14:08:56 -08:00
Andy
31ec5e7390 findAllReferences: Don't fail on broken re-export (#21841) 2018-02-09 13:56:04 -08:00
Andy
aa1ebda6a6 Fix bug: handle missing symbol.parent for non-accessible symbol (#21834) 2018-02-09 13:48:40 -08:00
Andrew Casey
6dd88b39d5 Merge pull request #21781 from amcasey/TextChangesReplace
Tidy up textChanges.replace*
2018-02-09 10:35:20 -08:00
Andy
1b620886a9 Assert getExportEqualsLocalSymbol returns a defined result (#21831) 2018-02-09 10:28:31 -08:00
Andrew Casey
f77cefee88 Introduce *WithNodes paralleling textChanges.Replace*
1) Take options
2) Return `this`
3) Use adjusted positions
2018-02-08 15:52:12 -08:00
Andrew Casey
80b2c58c51 Eliminate replaceWithSingle in favor of replaceRange 2018-02-08 15:43:46 -08:00
Andrew Casey
8d6e48a2ec Change the meaning of useNonAdjustedStartPosition
Old: getFullStart
New: getStart
Impact: only used in tests
Reason: symmetry with useNonAdjustedEndPosition - both now effectively
mean "exclude trivia from range"
2018-02-08 15:43:41 -08:00
Andy
e2178ecfab In getSymbolAtLocation, return undefined instead of unknownSymbol (#21774)
* In getSymbolAtLocation, return undefined instead of unknownSymbol

* Update check in completions to look for undefined instead of unknownSymbol
2018-02-08 14:35:21 -08:00
Andy
16f3b93ffd Simplify TextSpan creation (#21306)
* Simplify TextSpan creation

* Rename 'start' to 'pos' where possible
2018-02-08 13:51:10 -08:00
Mohamed Hegazy
4150a463e2 Fix #20805 (#21755)
* Add `-dev` to version patch number in master

* Refactor to handel non-identifier tokens for UMD modules

* Be more graceful handeling non-identifier tokens in import fixes

* Fix bad merge

* Remove check for isIdentifier
2018-02-08 10:32:08 -08:00
Andy
2a17825428 completions: Add assertions that symbols are defined (#21764)
* completions: Add assertions that symbols are defined

* Add assertion messages
2018-02-08 10:20:01 -08:00
Andy
05510a8612 Don't use export function for a function whose name differs from its exported name (#21739)
* Don't use `export function` for a function whose name differs from its exported name

* Fix lint
2018-02-08 09:53:53 -08:00
Priyantha Lankapura
79dde93068 Fix formatting of conditional types (#21762)
* Add test for formatting of conditional types

* Fix formatting of conditional types
2018-02-08 09:28:38 -08:00
Wesley Wigham
65149063ed Fix #21641, Add indirect location for default imports for synthetic defaults (#21703) 2018-02-07 15:04:37 -08:00
Andy
ed941c27b8 Don't check modifier legality, highlight anyway (#21335) 2018-02-07 13:51:08 -08:00
Sheetal Nandi
01d160e3b6 Merge pull request #21740 from Microsoft/gotoDefinition
Fix assert when goToDefinition, from location that is new expression target but not a class symbol
2018-02-07 13:50:02 -08:00
Sheetal Nandi
dab0dbe6f0 Avoid the class declaration not found assert when the new expression doesnt contain construct signature 2018-02-07 13:30:58 -08:00
Sheetal Nandi
35450d3451 Construct signature is valid signature declaration
Fixes #21501
2018-02-07 13:29:47 -08:00
Andy
c4362ac4ba Simplify use of FindAllReferences in inferFromUsage (#20551) 2018-02-07 13:25:36 -08:00
Andy
786bacfa3b Fix bug: support non-Identifier previousToken in importFixes (#21650)
* Fix bug: support non-Identifier previousToken in importFixes

* Remove intersection type
2018-02-07 12:33:16 -08:00
Andy
d35d5d0793 Fix bug: Check for both "./" and ".\" (#21730)
* Fix bug: Check for both "./" and ".\"

* Use normalizeSlashes
2018-02-07 10:50:49 -08:00
Priyantha Lankapura
4cfb7a5105 Fix space issue in mapped type formatting (#21712)
* Add the test for mapped type formatting issue

* Fix inconsistent number of spaces within braces when formatting mapped types
2018-02-07 09:23:31 -08:00
Andy
c1b4c5b827 Fix bug in normalizeAndPreserveTrailingSlash: For "./", return "", not "/" (#21704) 2018-02-07 09:07:05 -08:00
Andy
a1ffa9478c Fix ScriptElementKind for path mapping completions (#21695) 2018-02-06 13:42:32 -08:00
Andy
ba1833759f Simplify string literal completions (#21415) 2018-02-06 12:31:34 -08:00
Andy
c4c9a00a9f Support incomplete identifier in JSX initializer completions (#21681) 2018-02-06 11:40:39 -08:00
Andy
cd22ea73d3 Remove leading directory separator from path mapping completion (#21688) 2018-02-06 11:39:09 -08:00
Andy
cde1cd0075 Add top-level completion for path mapping (#21686) 2018-02-06 11:17:06 -08:00
Andy
57a50f4b9d fixInvalidImportSyntax: Preserve comment (#21684) 2018-02-06 10:19:14 -08:00
Andy
044fb53476 Escape quotes in bracketed completions (#21676) 2018-02-06 09:28:03 -08:00
Andy
d6f52c3477 importFixes: Bundle module specifiers with import kinds, and replace ImportCodeActionMap with existing functionality (#20700) 2018-02-06 08:57:32 -08:00
Andy
48c0af5d43 Support testing document highlights with "filesToSearch" (#21640)
* Support testing document highlights with "filesToSearch"

* Fix lint
2018-02-05 14:02:50 -08:00