Commit Graph

3607 Commits

Author SHA1 Message Date
Benjamin Lichtman 83f2401523 Merge pull request #17954 from uniqueiniquity/regions
Add support for custom outlining regions
2017-09-15 17:04:32 -07:00
uniqueiniquity e5c43cddb7 Remove extra OutliningSpan and simplify regex 2017-09-15 16:47:59 -07:00
uniqueiniquity 484bd2082e Refactored out RegionRange 2017-09-15 16:15:32 -07:00
uniqueiniquity 3dfeb2d0f4 Combine and simplify regex 2017-09-15 15:52:08 -07:00
uniqueiniquity 7781245f1e Move RegionRange to private scope 2017-09-15 10:38:05 -07:00
Andrew Casey 74139186ed Re-enable extraction of single tokens
Now that we explicitly prevent extraction of empty spans.
2017-09-15 10:28:20 -07:00
Vakhurin Sergey 95594e3ef3 Fixed formatting for multiline initialization of object and class members (#18494) 2017-09-15 09:12:35 -07:00
Andy c522f379b2 Update assertion: symbol in union type may be a Function (#18483) 2017-09-14 15:02:32 -07:00
Andy 0747b33038 Fixes to emit / format for codeFix (#18484) 2017-09-14 14:30:50 -07:00
Armando Aguirre 21bbdd33c5 Merge pull request #17415 from armanio123/FixRenameInDefaultLibrary
Excluded the default library from rename service.
2017-09-14 14:04:46 -07:00
Armando Aguirre 1ab67c0f22 Fixed sourceFiles type error 2017-09-14 12:48:04 -07:00
Andy 8dc66e4665 Cleanup navTo (#18150) 2017-09-14 12:38:17 -07:00
Andy 89eb06e475 For completions of union, exclude types with methods (#18124)
For completions of union, exclude arrays
2017-09-14 12:37:38 -07:00
Armando Aguirre b03fbaf313 Merge branch 'master' into FixRenameInDefaultLibrary 2017-09-14 12:01:31 -07:00
Andy 6e512a495f extractMethod: Don't try to extract an ExpressionStatement consisting of a single token (#18450)
* extractMethod: Don't try to extract an ExpressionStatement consisting of a single token

* Move to unit test
2017-09-14 11:16:21 -07:00
Andy d96dfeb708 Don't normalize whitespace in fourslash tests (#18447)
* Don't normalize whitespace in fourslash tests

* Only render whitespace when the diff is text-only
2017-09-14 08:23:50 -07:00
Andrew Casey be5c00f4c9 Merge pull request #18427 from amcasey/GH17869
Forbid extraction of empty spans
2017-09-13 16:43:14 -07:00
Andrew Casey e2d94a2922 Only introduce return properties at the top level
...not in nested functions.
2017-09-13 13:36:25 -07:00
Andrew Casey 255951c270 Stop preventing extraction when a type parameter wouldn't bind
...correctly in a containing scope.  It's not an issue because we'll
just declare a corresponding type parameter on the extracted function
and pass the original as a type argument.

Fixes #18142
2017-09-13 13:35:05 -07:00
Andrew Casey 34576c2521 Call getShorthandAssignmentValueSymbol rather than getSymbolAtLocation
...for shorthand property assignment names when collecting usages.
2017-09-13 13:31:42 -07:00
Andy 2a70bf5158 Don't count a write-only reference as a use (#17752)
* Don't count a write-only reference as a use

* Split isWriteAccess to isWriteOnlyAccess and isReadOnlyAccess

* Update "unusedParameterUsedInTypeOf" to use "b"

* Update diagnostic messages: "is never used" -> "its value is never read"

* Use a WriteKind enum

* Rename enum and move documentation to enum members
2017-09-13 09:02:33 -07:00
Andy c3199c7772 extractMethod: Support renameLocation (#18050)
* extractMethod: Support renameLocation

* Add tslint disable

* Properly analyze list of changes to always get a correct rename location

* Update test

* Ensure name is really unique

* Improvements to test code

* Respond to PR comments
2017-09-13 09:02:10 -07:00
Andrew Casey a02aaf2625 Forbid extraction of empty spans 2017-09-12 18:17:15 -07:00
Andrew Casey 40e459117a Merge pull request #18343 from amcasey/InsertionPosition
Improve insertion position of extracted methods
2017-09-12 16:48:45 -07:00
Andy e51e91dd2c Change wording of scope description (#18342) 2017-09-09 05:52:52 -07:00
Andy 018c645913 In import code fix, don't treat a re-export as an import (#18341) 2017-09-09 05:52:08 -07:00
Andrew Casey e77425f984 Delete staticAssertNever in favor of assertTypeIsNever 2017-09-08 14:36:21 -07:00
Andrew Casey 26903552fe Improve insertion position of extracted methods
Old: End of target scope
New: Before the first non-constructor function following the extracted
range in the target scope
2017-09-08 14:19:28 -07:00
Andrew Casey baefdd2ccb Revert "Make permittedJumps a parameter to eliminate save-restore pattern"
This reverts commit 57906fe90e8efd2fb285fcb67f018c0438ba06dd.
2017-09-07 16:22:12 -07:00
Andrew Casey e3808b65d4 Simplify and correct PermittedJumps computation
1. It was looking at the parent which wasn't guaranteed to be in the
extracted range.
2. It was checking direct, rather than indirect containment - apparently
to avoid applying the rules to certain expressions (which can't contain
jumps anyway, unless they're in anonymous functions, in which case
they're fine).

Fixes #18144
2017-09-07 16:21:20 -07:00
Andrew Casey a81fa7a801 Make permittedJumps a parameter to eliminate save-restore pattern 2017-09-07 16:13:27 -07:00
Andrew Casey 9d11fbb9b9 Correct permitted jumps check 2017-09-07 16:13:26 -07:00
Andrew Casey 0e50da62c4 Handle the combination of a write and a void return
When the return type is void, there's no `returnValueProperty`, but that
doesn't mean we don't need a `return` at the call site.

Fixes #18140.
2017-09-07 14:43:02 -07:00
Andy ed4e2e6e3b Ensure that emitter calls callbacks (#18284)
* Ensure that emitter calls calbacks

* Move new parameter to end of parameters

* Fix for ConditionalExpression

* Make suggested changes to emitter

* Fix parameter ordering

* Respond to minor comments

* Remove potentially expensive assertion

* More emitter cleanup
2017-09-07 14:30:19 -07:00
Stas Vilchik 727facb55c fix initialization of shouldCreateNewSourceFiles (#17686) 2017-09-07 12:15:28 -07:00
Wesley Wigham c1f2afd645 Add typedef declaration space, unify typedef name gathering (#18172)
* Add typedef declaration space, unify typedef name gathering, strengthen errorUnusedLocal

* Bonus round: make jsdoc presence way mroe typesafe

* Be exhaustive in nameForNamelessJSDocTypedef

* Remove nonrequired casts

* Replace more casts with guards

* Cannot be internal

* Debug.fail returns never, assert never no longer needs unreachable throw to satisfy checker

* Rename type

* Add replacement message as in 18287
2017-09-07 10:28:58 -07:00
Andy 193f4be355 Enable interface-over-type-literal lint rule (#17733) 2017-09-07 09:14:59 -07:00
Andy be0633825c Don't provide string literal completions for string enums (#18288)
* Don't provide string literal completions for string enums

* Rename test
2017-09-07 09:13:46 -07:00
Nathan Shively-Sanders b84e6bc188 Merge pull request #18096 from Microsoft/fix-codefix-jsdoc-variablelike-decls
Fix the jsdoc codefix for VariableLike declarations
2017-09-07 08:11:19 -07:00
Andy 7541c705bf Support navTo for special assignment kinds (#18154)
* Support navTo for special assignment kinds

* Return ScriptElementKind.unknown
2017-09-07 07:45:11 -07:00
Andy b533b24686 extractMethod: Don't try to extract a single token (#18090)
* extractMethod: Don't try to extract a single token

* Update tests
2017-09-07 07:28:12 -07:00
Andy b3c87aa919 Support find-all-references for default keyword (#17992)
* Support find-all-references for anonymous default exports

* Also handle re-exported default exports

* Add test for using `export =` with `--allowSyntheticDefaultExports`
2017-09-07 07:26:22 -07:00
Andy 817c329667 getFormattingScanner: Ensure scanner is closed, and avoid global variables (#18293) 2017-09-07 07:23:53 -07:00
Andy 23f793fc3e findAllReferences: Handle root symbols of binding element property symbol (#17738) 2017-09-07 07:23:06 -07:00
Andy 0434fe797a Get quickInfo from a contextual type if possible (#18119) 2017-09-07 07:22:39 -07:00
Andy 8c714c3651 Support special JS property assignments in doc comment templates (#18193) 2017-09-07 07:21:47 -07:00
Andy 53b5abe5bb Update fromCodeFixContext (#18290) 2017-09-07 07:19:00 -07:00
Andy 697c4d3353 Add debugName property to Rule (#18289) 2017-09-06 14:46:47 -07:00
Andy 36607e1bde Allow quoted names in completions (#18162)
* Allow quoted names in completions

* Don't allow string literal completions if not in an object literal; and use string literals for number keys

* Add TODO
2017-09-06 14:39:53 -07:00
Anders Hejlsberg 601a21c77b Fix signature help 2017-09-02 15:39:14 -07:00