4444 Commits

Author SHA1 Message Date
Andy
4c22bf786e
getEditsForFileRename: Do fresh module resolution instead of relying on cache (#24211)
* getEditsForFileRename: Do fresh module resolution instead of relying on cache

* Add host.resolveModuleNameWithFailedLookupLocations method

* Make host.resolveModuleNameWithFailedLookupLocations mandatory, and implement for Project

* Add test, and no need to check host.fileExists

* Change method name and always use cache

* Update name in string
2018-05-18 16:42:42 -07:00
Andy
3eb66da155
Add code fix to remove unused label (#24037)
* Add code fix to remove unused label

* Test with trivia and fix indentation with dedented label
2018-05-18 15:25:24 -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
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
Andrew Casey
43e1edf10a Eliminate runtime type check 2018-05-18 10:54:40 -07:00
Andy
76573c6520
getEffectiveTypeParameterDeclarations: Always return a defined result (#24251) 2018-05-18 10:17:35 -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
王文璐
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
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
Andy
08c364d258
fixUnusedIdentifier: Don't delete node whose ancestor was already deleted (#24207) 2018-05-17 14:08:58 -07:00
Andy
09b9ec43e3
moveToNewFile: Fix bug for VariableDeclaration missing initializer (#24214) 2018-05-17 12:38:20 -07:00
Andy
176e35b9c3
moveToNewFile: Don't move imports (#24177) 2018-05-17 09:54:47 -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 f41a96b24d44a6b696d39eee9e91ef7f606bea52.

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

This reverts commit 7d2233a00e5c6d794c1de32c03802e8ccce1914c.

* 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
王文璐
5d233054c3 add quick fix for import type missing typeof 2018-05-17 16:35:20 +08:00
王文璐
755b443b6d disallow acesssor generate in function like initializer 2018-05-17 10:18:20 +08:00
Andy
424dba1d69
codeFixInferFromUsage: Avoid duplicate fix for variable declaration (#24169)
* codeFixInferFromUsage: Avoid duplicate fix for variable declaration

* Include VariableDeclaration initializer as a candidate type
2018-05-16 12:28:27 -07:00
Mohamed Hegazy
13ac88647f
Merge pull request #24162 from Kingwl/fix-generate-accessor-starting-underscore
fix generate accessor if starting with underscore
2018-05-16 12:06:15 -07:00
王文璐
b7f725d1b8 fix generate accessor if starting with underscore 2018-05-16 15:34:11 +08:00
王文璐
0fde07f1c5 fix trailing comma in accessor generator 2018-05-16 14:47:44 +08:00
Andy
b4ca23d8f9
Fix bug: Converting 'module.exports = {...}' to ES6 doesn't introduce a default export (#24141) 2018-05-15 16:22:58 -07:00
Andy
d4a3c9c61a
Fix placement of indent for @ts-ignore comment (#24143) 2018-05-15 16:21:15 -07:00
Andy
cbbe34b35e
Fix conversion of TextChanges to FileCodeEdits for new file (#24126) 2018-05-15 13:55:26 -07:00
Mohamed Hegazy
9484653657
Merge pull request #24114 from Microsoft/inspectorToModules
Inspector to modules
2018-05-15 12:59:42 -07:00
Ryan Cavanaugh
2ca0792976
Merge pull request #24074 from RyanCavanaugh/splitTransparentGoToDef
Return mapped locations in alternate fields
2018-05-16 05:39:51 +12:00
Ryan Cavanaugh
f01338fa33 Comments/naming 2018-05-14 18:27:21 -07:00
Mohamed Hegazy
b8c2eca8b3 Reorder, add "http2", "async-hooks" and "perf_hooks" 2018-05-14 15:37:11 -07:00
Mohamed Hegazy
6baaddc4f0 Add 'inspector' to known node modules 2018-05-14 15:22:24 -07:00
Andy
7e3af08a09
Don't add a suggestion to convert to an es6 module if no commonjs import/export appears at top-level. (#24101) 2018-05-14 12:00:40 -07:00
Ryan Cavanaugh
64b1c23a9b Push through original mapping location 2018-05-14 10:54:40 -07:00
Ryan Cavanaugh
69f73eba16 Return mapped locations in alternate fields 2018-05-11 17:22:10 -07:00
Andrew Casey
020d6c7ba3
Merge pull request #24048 from amcasey/GH23366
Ignore case when sorting imports
2018-05-10 19:11:44 -07:00
Andrew Casey
543c5daf9c Ignore case when sorting imports 2018-05-10 18:10:05 -07:00
Andrew Casey
7281bb7510 Stop deleting empty named import lists
Fixes #23892
2018-05-10 18:01:55 -07:00
Andy
2be6aaf813
Support '/' as a trigger character in path completions (#24042) 2018-05-10 16:50:26 -07:00
Andy
6ae4d3a516
Add code fix to remove unreachable code (#24028)
* Add code fix to remove unreachable code

* Code review

* Preserve more kinds of statements
2018-05-10 16:44:48 -07:00
Andy
e33e229a52
Extract 'moduleSpecifiers' namespace out of importFixes (#24010) 2018-05-10 16:30:24 -07:00
Andy
fd17f77cc9
Improvements to find-all-references for import types (#23998)
* Improvements to find-all-references for import types

* Add JS test
2018-05-10 15:31:06 -07:00
Andy
61a2949051
Don't count '/' in division as a completions trigger (#24038) 2018-05-10 14:59:33 -07:00
Andy
7271ec1240
Add 'move to new file' refactor (#23726)
* Add 'move to new file' refactor

* Code review, and support commonjs

* Compute movedSymbols completely before using, and support `export import`

* Fix assertion error: sort empty change before non-empty change

* Remove extra newline

* Add allowTextChangesInNewFiles preference

* Add the new file to 'files' in tsconfig

* Avoid parameter initializer

* Update API baselines

* Use path relative to tsconfig.json

* Code review

* Fix error where node in tsconfig file was missing a source file
2018-05-10 11:17:04 -07:00
Mohamed Hegazy
1b796ed04d
Merge pull request #23954 from Kingwl/readonly-getter-support
add support for readonly modifier
2018-05-10 11:10:03 -07:00
kingwl
44d10dcf59 fix incorrect find reference pos 2018-05-11 01:49:40 +08:00
王文璐
340e8cd56a find reference at begin of constructor 2018-05-10 11:20:07 +08:00
Andy
da413d6fef
Remove unnecessary filtering of tsx completions (#24004) 2018-05-09 15:18:45 -07:00
Mohamed Hegazy
6f9dc2f976
Merge pull request #23923 from Zzzen/master
Document highlights on async/await keywords should highlight other oc…
2018-05-09 09:51:04 -07:00
Andy
7fb7eecf2c
Add telemetry for open JS files (#23833)
* Add telemetry for open JS files

* Send event every time

* Keep stats even for closed files

* Remove tsCheckCountForOpenFilesTelemetry

* Use 'info.path'

* Update API
2018-05-09 07:51:46 -07:00