Nathan Shively-Sanders
36cdbb2857
Merge pull request #18625 from Microsoft/fix-getAdjustedStartPosition-on-first-line
...
Fix get adjusted start position on first line
2017-09-21 10:08:30 -07:00
Nathan Shively-Sanders
3cc0aeb6be
PR comments
...
I plan to fix the missing comment issue when I add the
convert-jsdoc-types-to-typescript-types refactoring. Or at least work
around it.
2017-09-21 09:44:51 -07:00
Andrew Casey
f00c78c9b5
Merge pull request #18622 from amcasey/NoModifiers
...
JavaScript: handle lack of modifiers on extracted method
2017-09-20 17:10:42 -07:00
Nathan Shively-Sanders
ae87db7b3e
getAdjustedStartPosition shouldn't skip to next line when on 1st line
2017-09-20 16:26:46 -07:00
Andrew Casey
a1dee452fa
JavaScript: handle lack of modifiers on extracted method
...
The emitter expects undefined, rather than empty. This only affects JS,
because TS applies `private` to all extracted methods.
(cherry picked from commit 9630c46ea7 )
2017-09-20 16:25:15 -07:00
Andy
4d2aa9bf2c
Fix formatting when keyword is parsed as part of a JSX identifier (e.g. module-layout) ( #18598 )
2017-09-20 15:01:04 -07:00
Andy
12649516cf
navigation tree / bar: Set span of anonymous function to span of VariableDeclaration containing it ( #18575 )
...
* navigation tree / bar: Set span of anonymous function to span of VariableDeclaration containing it
* Add back `isFunctionOrClassExpression`
2017-09-19 14:39:29 -07:00
Andrew Casey
cb63ea5242
Merge pull request #18563 from amcasey/GH18546
...
Stop requiring that the full range of a declaration fall within the selection
2017-09-19 10:47:16 -07:00
Andy
951974dff6
Use find array helper ( #18557 )
...
* Use `find` array helper
* Provide explicit type argument to `find`
2017-09-19 08:27:31 -07:00
Andrew Casey
af49c60a2c
Stop requiring that the full range of a declaration fall within the
...
selection
Fixes #18546
2017-09-18 19:17:47 -07:00
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