Commit graph

23541 commits

Author SHA1 Message Date
Andy
1df7997014
getJSDocTypeParameterDeclarations: Avoid unnecessary array (#24257) 2018-05-18 13:53:27 -07:00
Andrew Casey
04a351224c
Merge pull request #24237 from amcasey/GH23640
Sort exports when organizeImports is run
2018-05-18 13:39:24 -07:00
Sheetal Nandi
3bb9ccfa8e
Merge pull request #24234 from Microsoft/unusedIdentifierCorrectFile
Unused variable error reporting needs to handle nodes that could not belong to current source file
2018-05-18 13:25:19 -07:00
Andy
7f0258bcb9
getJSDocHost always returns a defined result (#24255) 2018-05-18 13:20:13 -07:00
Andrew Casey
8f662a9131 Extract sorting helper 2018-05-18 12:53:28 -07:00
Mohamed Hegazy
d60866aada
Merge pull request #24236 from Kingwl/quick-fix-for-import-type
simply quick fix for import type missing typeof
2018-05-18 11:34:54 -07:00
TypeScript Bot
9e19567638 Update user baselines (#24247) 2018-05-18 11:23:27 -07:00
Mohamed Hegazy
2e183f58f8
Merge pull request #24238 from bluelovers/patch-1
es2018 regexp dotAll
2018-05-18 11:14:29 -07:00
Andrew Casey
43e1edf10a Eliminate runtime type check 2018-05-18 10:54:40 -07:00
Andrew Casey
7fcf1fdeb6 Delete redundant tests 2018-05-18 10:49:10 -07:00
Andy
76573c6520
getEffectiveTypeParameterDeclarations: Always return a defined result (#24251) 2018-05-18 10:17:35 -07:00
Wesley Wigham
89059f0b85
Some RWC tests had dupes in their input/outher files list because paths werent both resolved (#24235) 2018-05-18 08:46:50 -07:00
Mohamed Hegazy
8c2ed976a5
Merge pull request #24187 from Kingwl/disallow-in-function-like-initializer
disallow acesssor generate in function like initializer
2018-05-17 19:41:01 -07:00
bluelovers
dff19a5f70
es2018 regexp dotAll 2018-05-18 10:07:46 +08:00
王文璐
45c06cfd11 only allow refactor if selected span overlaps name declaration 2018-05-18 10:07:45 +08:00
Andrew Casey
a327241655 Sort exports when organizeImports is run
Note that there's no attempt to remove unused exports.

Fixes #23640
2018-05-17 18:38:42 -07:00
王文璐
49989619db simply quick fix for import type missing typeof 2018-05-18 09:34:14 +08:00
Ryan Cavanaugh
a4eb15635b WIP, need to lint 2018-05-17 16:52:21 -07:00
Ryan Cavanaugh
aeb5625199 WIP 2018-05-17 16:39:15 -07:00
Sheetal Nandi
52e8c2d663 Unused variable error reporting needs to handle nodes that could not belong to current source file
Eg. when resolving module, the another file gets checked and its locals are added to potentiallyUnused list
Fixes #24215
2018-05-17 16:27:08 -07:00
Wesley Wigham
66d6e5e6e0
Remove leveldown, stip absolute paths from test mk 2, accept reordered and new user baselines (#24227) 2018-05-17 15:32:10 -07:00
Wesley Wigham
d82d35c7f5
Set startPos at EOF in jsdoc token scanner so node end positions for nodes terminated at EoF are right (#24184)
* Set startPos at EOF in jsdoc token scanner to node end positions for nodes terminated at EoF are right

* More complete nonwhitespace token check, fix syntactica jsdoc classifier

* Use loop and no nested lookahead

* Do thigns unrelated to the bug in the test

* Fix typo move return

* Patch up typedef end pos

* Fix indentation, make end pos target more obvious
2018-05-17 15:16:18 -07:00
Andy
d579793d0a
moveToNewFile: Fix bug for missing importClause (#24224) 2018-05-17 14:32:12 -07:00
Andy
75ab60f199
Improve ChangeTracker#deleteNodeInList (#24221) 2018-05-17 14:31:58 -07:00
Wesley Wigham
3800d7b246
More robust circularity detection in node builder (#24225) 2018-05-17 14:30:07 -07:00
Andy
08c364d258
fixUnusedIdentifier: Don't delete node whose ancestor was already deleted (#24207) 2018-05-17 14:08:58 -07:00
Wesley Wigham
c25b02fb5b
Accept changed baseline (#24222) 2018-05-17 14:07:49 -07:00
Anders Hejlsberg
3fc3df3c3a
Merge pull request #24137 from Microsoft/fix23977
Optimize intersections of unions of unit types
2018-05-17 13:15:28 -07:00
Wesley Wigham
3fc727b256
Use import types to refer to declarations in declaration emit (#24071)
* Stand up a simple implementation using import types for exports of modules which are otherwise inaccessible

* Ensure references exist to link to modules containing utilized ambient modules

* Accept baselines with new import type usage

* Fix lint
2018-05-17 13:08:22 -07:00
Andy
09b9ec43e3
moveToNewFile: Fix bug for VariableDeclaration missing initializer (#24214) 2018-05-17 12:38:20 -07:00
Mohamed Hegazy
a9660f3c5e
Merge pull request #24212 from Microsoft/Fix24199
Add undefined guard
2018-05-17 12:27:55 -07:00
Mohamed Hegazy
8dc9b76b6d Add undefined guard 2018-05-17 11:45:34 -07:00
Nathan Shively-Sanders
6450490844
Fix jsdoc type resolution [merge to master] (#24204)
* Fix JSDoc type resolution

Breaks type parameter resolution that is looked up through prototype
methods, though. I need to fix that still.

* Check for prototype method assignments first

* Undo dedupe changes to getJSDocTags

* JS Type aliases can't refer to host type params

Previously, js type aliases (@typedef and @callback) could refer to
type paremeters defined in @template tags in a *different* jsdoc tag, as
long as both tags were hosted on the same signature.

* Reduce dedupe changes+update baseline

The only reason I had undone them was to merge successfully with an
older state of master.
2018-05-17 10:46:10 -07:00
Andy
2b5ff29254
Reduce map lookups (#24203) 2018-05-17 10:02:10 -07:00
Andy
176e35b9c3
moveToNewFile: Don't move imports (#24177) 2018-05-17 09:54:47 -07:00
Sheetal Nandi
81ca6502ea Cache the latest source file from document registry so we can keep it alive when script info is orphan 2018-05-17 09:54:07 -07:00
Sheetal Nandi
59d19251cf Add test to verify the document is released from source file when info is orphan 2018-05-17 09:54:07 -07:00
Nathan Shively-Sanders
aa7e2b0f07
Add callback tag, with type parameters (#23947)
* Add initial tests

* Add types

* Half of parsing (builds but does not pass tests)

* Parsing done; types are uglier; doesn't crash but doesn't pass

* Bind callback tag

Builds but tests still don't pass

* Only bind param tags inside callback tags

* Fix binding switch to only handle param tags once

* Checking is 1/3 done or so.

Now I'm going to go rename some members to be more uniform. I hate
unnnecessary conditionals.

* Rename typeExpression to type (for some jsdoc)

(maybe I'll rename more later)

* Rename the rest of typeExpressions

Turns out there is a constraint in services such that they all need to
be named the same.

* Few more checker changes

* Revert "Rename the rest of typeExpressions"

This reverts commit f41a96b24d.

* Revert "Rename typeExpression to type (for some jsdoc)"

This reverts commit 7d2233a00e.

* Finish undoing typeExpression rename

* Rename and improve getTypeParametersForAliasSymbol

Plus some other small fixes

* Core checking works, but is flabbergastingly messy

I'm serious.

* Callback return types work now

* Fix crash in services

* Make github diff smaller

* Try to make github diff even smaller

* Fix rename for callback tag

* Fix nav bar for callback tag

Also clean up some now-redundant code there to find the name of typedefs.

* Handle ooorder callback tags

Also get rid of redundant typedef name code *in the binder*. It's
everywhere!

* Add ooorder callback tag test

* Parse comments for typedef/callback+display param comments

* Always export callbacks

This requires almost no new code since it is basically the same as
typedefs

* Update baselines

* Fix support for nested namespaced callbacks

And add test

* Callbacks support type parameters

1. Haven't run it with all tests
2. Haven't tested typedef tags yet
3. Still allows shared symbols when on function or class declarations.

* Template tags are now bound correctly

* Test oorder template tags

It works.

* Parser cleanup

* Cleanup types and utilities

As much as possible, and not as much as I would like.

* Handle callback more often in services

* Cleanup of binder and checker

* More checker cleanup

* Remove TODOs and one more cleanup

* Support parameter-less callback tags

* Remove extra bind call on template type parameters

* Bind template tag containers

Doesn't quite work with typedefs, but that's because it's now stricter,
without the typedef fixes. I'm going to merge with jsdoc/callback and
see how it goes.

* Fix fourslash failures

* Stop pre-binding js type aliases

Next up, stop pre-binding js type parameters

* Further cleanup of delayed js type alias binding

* Stop prebinding template tags too

This gets rid of prebinding entirely

* Remove TODO

* Fix lint

* Finish merge with use-jsdoc-aliases

* Update callback tag baselines

* Rename getTypeParametersForAliasSymbol

The real fix is *probably* to rename Type.aliasTypeArguments to
aliasTypeParameters, but I want to make sure and then put it in a
separate PR.
2018-05-17 09:28:11 -07:00
Mohamed Hegazy
dbd4ef4910
Merge pull request #24192 from Kingwl/quick-fix-for-import-type
add quick fix for import type missing typeof
2018-05-17 09:04:19 -07:00
王文璐
5d233054c3 add quick fix for import type missing typeof 2018-05-17 16:35:20 +08:00
csigs
2722d2e771
LEGO: Merge pull request 24188
LEGO: Merge pull request 24188
2018-05-16 21:10:42 -07:00
csigs
63a72636a9 LEGO: check in for master to temporary branch. 2018-05-17 04:10:22 +00:00
王文璐
755b443b6d disallow acesssor generate in function like initializer 2018-05-17 10:18:20 +08:00
Wesley Wigham
159c808a0d
Sort the whole diagnostic, plus giving up on isolating tests (#24186)
* Sort the whole diagnostic

* Also strip references to our repos node_modules, since removing it is hard
2018-05-16 18:17:59 -07:00
Anders Hejlsberg
027829fbcd Properly handle edge cases 2018-05-16 16:26:37 -07:00
Mohamed Hegazy
6af5d8b940 Add Unicode ThirdPartyNotice 2018-05-16 15:44:59 -07:00
csigs
67046799c2
LEGO: Merge pull request 24183
LEGO: Merge pull request 24183
2018-05-16 15:11:21 -07:00
csigs
7c52cab219 LEGO: check in for master to temporary branch. 2018-05-16 22:11:01 +00:00
Mohamed Hegazy
6f041e9379 Accept baselines 2018-05-16 14:26:34 -07:00
Mohamed Hegazy
3a00ac1d0b Merge branch 'master' into updateVersion 2018-05-16 14:21:19 -07:00