Nathan Shively-Sanders
0f55566cf4
In JS, always check the extends tag of a class before its heritage clause ( #25111 )
...
* Check extends tag first in getClassExtendsHeritageClauseElement
Previously getBaseTypeNodeOfClass checked, but this is only used in a
few places.
* Fix names and add test
* Update API baseline
* Move jsdocAugments tests to conformance/jsdoc
* Better naming in checkClassLikeDeclaration
2018-06-20 16:28:30 -07:00
Andy
f3e2e891da
navigationBar: Avoid double recursion on special property assignment ( #25077 )
2018-06-20 12:57:34 -07:00
Andy
b3f9ec3796
Fix bug: Still implement a method even if the return type is defined in another file ( #24978 )
2018-06-19 16:36:18 -07:00
Andy
7f553f4f93
refactorConvertToGetAccessAndSetAccess: Don't trigger on leading trivia ( #25054 )
...
* refactorConvertToGetAccessAndSetAccess: Don't trigger on leading trivia
* Update API (#24966 )
2018-06-19 13:46:03 -07:00
Andy
db85f37669
fixUnusedIdentifier: Don't needlessly exclude jsdoc ( #25014 )
2018-06-19 13:44:00 -07:00
Nathan Shively-Sanders
03fff50fa4
Simplify getJSDocCommentAndTags ( #24997 )
...
Previously, getJSDocCommentAndTags could recur up to four times if any
of four predicates matched. However, to avoid duplicates, the predicates
have been tuned to be mutually exclusive, which means that the recursion
can be turned into a while loop. The while loop is much simpler and
safer, since it is guaranteed to only walk up the tree one time. In
addition, the extra check that adds jsdoc from initializers only runs
once, before the loop, further reducing the opportunity for duplicate
jsdocs.
I thought about further simplifying the code that gets the next node to
check, but to know when to stop the loop, I'd need a predicate that is
as complicated as the code in `getNextJSDocCommentLocation`, so I kept
the existing code, just reordering it for compactness.
2018-06-19 10:14:47 -07:00
Markus Johnsson
aa87cc5b73
Merge branch 'master' of github.com:Microsoft/TypeScript
2018-06-19 11:18:20 +02:00
Andy
e7e69ad4a2
Fix bug in importTracker: default and namespace imports are not exclusive ( #24965 )
2018-06-15 12:15:39 -07:00
Wesley Wigham
640af3f75e
Introduce related spans into tsserver protocol ( #24548 )
...
* Introduce related spans into tsserver protocol
* Incorporate pretty output, implement esModuleInterop related span
2018-06-15 10:54:36 -07:00
Andy
7a1d75cc11
getEditsForFileRename: Don't update unrelated import ( #24961 )
...
* getEditsForFileRename: Don't update unrelated import
* Importing source file moved if it's the old path *or* new path
2018-06-14 15:42:16 -07:00
Andy
4a7a550502
moveToNewFile: Reuse code from importFixes for inserting import ( #24957 )
...
* moveToNewFile: Reuse code from importFixes for inserting import
* Fix test failures
* Update API baselines (#24966 )
2018-06-14 15:41:47 -07:00
Nathan Shively-Sanders
4db1c132b7
No dupe jsdoc for assignment inside an initializer ( #24973 )
2018-06-14 15:32:10 -07:00
Nathan Shively-Sanders
57e652dd02
Js/check type tags ( #24967 )
...
* Check the type expression of `@type` tags
* Update existing tests and baselines
2018-06-14 13:11:52 -07:00
Andy
345012e29d
Don't add diagnostic on unused import starting with underscore ( #24958 )
...
* Don't add diagnostic on unused import starting with underscore
* Fix lint
2018-06-14 12:55:12 -07:00
Nathan Shively-Sanders
a56b272d38
In JS, fix crash with in a file with conflicting ES2015/commonjs exports ( #24960 )
...
* fix crash with conflicting ES2015/commonjs modules
* Refactor based on PR comments
2018-06-14 11:18:23 -07:00
Wesley Wigham
a77068827d
Handle combinations of rootdir and outdir when calculating paths ( #24941 )
2018-06-14 11:07:46 -07:00
Mohamed Hegazy
90895198fa
Merge branch 'master' into fixAPISampleTests
2018-06-13 11:14:22 -07:00
Nathan Shively-Sanders
2a8c4d1bd7
Support @this tags ( #24927 )
...
* Type check `@this` tags
No special support in fourslash yet, so quickinfo probably doesn't work.
* Do no require braces and update API baselines
2018-06-13 10:11:12 -07:00
Mohamed Hegazy
838b76e928
Merge remote-tracking branch 'origin/master' into fixAPISampleTests
2018-06-12 13:03:11 -07:00
Wesley Wigham
61fb222cd2
Use symlinks when looking for module names for declaration emit ( #24874 )
...
* fix symlink tag, support arbitrary (ie, directory) links via @link
Introduce indirect symlink lookup to specifier deriver
Use fileset, move exec
vfs path resolution :shakes fist:
Apply files symlink relative to dirname
Use directory function
* Accept really bad baseline updates
2018-06-12 12:52:44 -07:00
Mohamed Hegazy
1b6f0ea07e
Fix API Sample tests
2018-06-12 12:52:06 -07:00
Mohamed Hegazy
7a322d72f7
Merge pull request #23989 from a-tarasyuk/bug/23180-generate-source-maps-with-relative-path
...
#23180 - Generating source maps with relative path in sourceRoot option produces maps with absolute file paths
2018-06-12 10:57:17 -07:00
Nathan Shively-Sanders
5be8f1f9f9
Better handling of circular JS containers in getTypeOfVariableOrParameterOrProperty ( #24732 )
...
* avoid circularity in getTypeOfVariableOrParameterOrProperty
Modify getTypeOfVariableOrParameterOrProperty to get the type of the
variable declaration before widening it. This essentially avoids some
circularities by (1) setting the type of the variable declaration to the
unwidened type (2) updating the type of the variable declaration to the
widened one.
You will still get a circular noImplicitAny in (1), for expressions that
actually are circular, but not in (2), for the containers of things that
are not themselves circular.
* Stop checking js init object literals via checkObjectLiteral
* checkBinaryExpression: new code for special assignments
* Chained lookup for js initializer type
* Check for JS-specific types only once
Also make sure to respect the type annotation if there is one.
* Accept API changes
2018-06-12 09:42:26 -07:00
Alexander T
f007c3586b
mapRoot is not filePath
2018-06-12 18:20:53 +03:00
Wesley Wigham
6c78ce31ea
Set use flag ( #24881 )
2018-06-11 17:00:17 -07:00
Mohamed Hegazy
64dab639ce
Merge remote-tracking branch 'origin/master' into Fix24826
2018-06-11 15:50:41 -07:00
Mohamed Hegazy
c34a6d9d12
Remove error baseline
2018-06-11 15:29:52 -07:00
Nathan Shively-Sanders
923a8aab0e
Add Variable to HasExports ( #24871 )
...
JS containers are variables, but may have exports just like classes and
modules.
2018-06-11 14:45:27 -07:00
Mohamed Hegazy
35d25ff280
Merge pull request #24645 from Kingwl/this-type-accessibility
...
allow access protected member in this parameter context
2018-06-11 13:17:58 -07:00
Mohamed Hegazy
e07e2e0e1f
Merge pull request #23423 from Kingwl/add-braces
...
add support for add or remove braces to arrow function
2018-06-11 13:09:38 -07:00
Mohamed Hegazy
b33d5e3f19
Fix #24826 : Add mapping for ES2018 target to library
2018-06-11 12:46:13 -07:00
Andy
7df81311ac
goToDefinition: Don't add duplicate definitions for VariableDeclaration and ArrowFunction at f = () => {} ( #24863 )
2018-06-11 11:20:34 -07:00
Andy
1aad3c6273
addClassStaticThisReferences: Don't cross class boundary ( #24860 )
2018-06-11 10:51:11 -07:00
Andy
986532d36b
Fix bug: In findAllReferences, don't crash on static method missing body ( #24814 )
2018-06-11 08:43:17 -07:00
Markus Johnsson
8bc92e4a63
Update test to reflect new behavior
2018-06-10 19:58:32 +02:00
Markus Johnsson
8850f74eab
Merge branch 'master' of github.com:Microsoft/TypeScript
2018-06-10 15:00:52 +02:00
Markus Johnsson
cb5b77365c
Merge branch 'master' of github.com:Microsoft/TypeScript
2018-06-10 14:59:13 +02:00
Andy
04187bde8d
fixStrictClassInitialization: Support array initializer ( #24810 )
2018-06-08 15:56:56 -07:00
Sheetal Nandi
8c7a9ccc27
Merge pull request #24811 from Microsoft/computedPropertyNameWithDefaultImport
...
Always resolve the first identifier of computed property name to get the symbol and track it
2018-06-08 15:35:38 -07:00
Andy
e821d613a1
fixUnusedIdentifier: Remove unused writes ( #24805 )
2018-06-08 15:20:33 -07:00
Sheetal Nandi
5d70d9223c
Always resolve the first identifier of computed property name to get the symbol and track it
...
Fixes #24798
2018-06-08 14:03:18 -07:00
Wesley Wigham
4240d9dc0f
always visit them all ( #24802 )
2018-06-08 13:11:30 -07:00
Andy
855c3a6d4f
fixUnusedIdentifier: Delete trailing comma in array binding pattern ( #24800 )
2018-06-08 10:39:01 -07:00
kingwl
0d730c008a
Merge branch 'master' into add-braces
2018-06-09 01:32:53 +08:00
Mohamed Hegazy
b4dea5ecce
Merge pull request #24760 from krk/codefix-asterisk
...
addMethodDeclaration codefix creates a generator function when target…
2018-06-08 08:57:49 -07:00
Andy
3822e3e4ed
tryGetModuleNameAsNodeModule: Ignore file extension ( #24774 )
2018-06-07 15:45:03 -07:00
Ron Buckton
e947154aec
Merge pull request #24768 from Microsoft/fix24722
...
Fix prologue order in async function
2018-06-07 15:05:09 -07:00
Andy
48dedacf3b
fixStrictClassInitialization: Don't provide a default for string or number ( #24767 )
...
* fixStrictClassInitialization: Don't provide a default for `string` or `number`
* Update baselines
2018-06-07 15:03:38 -07:00
Andy
33d0893259
Add completions from literal contextual types ( #24674 )
...
* Add completions from literal contextual types
* Remove getTypesOfUnion
* undo baseline changes
2018-06-07 15:03:19 -07:00
Andy
fde6f22408
Fix bug: In newFileChanges, setParentNodes in new source file ( #24765 )
2018-06-07 14:28:06 -07:00