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
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
Ron Buckton
2b4569c04f
Fix prologue order in async function
2018-06-07 13:34:16 -07:00
Andy
87217018b8
Add 'nameSpan' property to NavigationTree ( #24698 )
2018-06-07 12:43:57 -07:00
Andy
0fefaf286d
moveToNewFile: Infer quote preference ( #24652 )
2018-06-07 12:10:48 -07:00
Andy
83c58a4fb5
Don't consider x. a new identifier location just because x has a number index signature ( #24699 )
...
* Don't consider `x.` a new identifier location just because x has a number index signature
* Update more tests
2018-06-07 12:05:47 -07:00
krk
acbda14450
addMethodDeclaration codefix creates a generator function when target is child of a YieldExpression, resolves #24728
2018-06-07 20:59:06 +03:00
Wesley Wigham
d0ae03c4cc
Handle import types in serializeType ( #24701 )
2018-06-07 10:40:14 -07:00
Mohamed Hegazy
34dd7738c9
Merge pull request #24672 from bakkot/binding-comma
...
Allow trailing commas after non-rest elements in destructuring
2018-06-06 13:00:17 -07:00
Nathan Shively-Sanders
30994c86e4
Improve valueDeclaration for js module merges ( #24707 )
...
Nearly everything in a merge of JS special assignments looks like a
valueDeclaration. This commit ensures that intermediate "module
declarations" are not used when a better valueDeclaration is available:
```js
// File1.js
var X = {}
X.Y.Z = class { }
// File2.js
X.Y = {}
```
In the above example, the `Y` in `X.Y.Z = class { }` was used as the
valueDeclaration for `Y` because it appeared before `X.Y = {}` in the
compilation.
This change exposed a bug in binding, #24703 , that required a change in
typeFromPropertyAssignmentOutOfOrder. The test still fails for the
original reason it was created, and the new bug #24703 contains a repro.
2018-06-06 11:11:15 -07:00
Nathan Shively-Sanders
d6250c8342
Fix circularity error when extending class in same JSContainer ( #24710 )
...
Do this by not widening properties of an object literal that are
1. JS initialisers
2. and not an object literal
These properties have types that will never widen, so the compiler
shouldn't ask for the types earlier than it strictly needs to.
2018-06-06 09:13:38 -07:00
Wesley Wigham
d9b93903c0
Use more nodelike paths for import types when possible ( #24610 )
...
* Use more nodelike paths for import types when possible
* move functionality from services into compiler, fix with propert file/directory conflict handling
* mark suspect cast
2018-06-05 12:54:36 -07:00
Andy
735a46f838
If parsing a function type fails, parseTypeReference() to ensure something is returned ( #24567 )
...
* If parsing a function type fails, parseTypeReference() to ensure something is returned
* Avoid tryParse
* Add missing semicolon
* Don't check for undefined, check for missing type
* Don't set parameters undefined, set to missingList and return false
* Update API baselines
* Code review
2018-06-05 10:24:37 -07:00
王文璐
0bcbbbdd58
disallow static field access
2018-06-05 18:42:21 +08:00
Ron Buckton
fbeb58a147
Merge pull request #23893 from Microsoft/libReference
...
Adds 'lib' reference directives
2018-06-04 16:14:52 -07:00
Kevin Gibbons
87bb5e3cbb
Allow trailing commas after-rest elements in destructuring
2018-06-04 14:58:30 -07:00
Ron Buckton
666841264c
Merge branch 'master' into libReference
2018-06-04 14:38:56 -07:00
Wesley Wigham
7eaa78846e
Visit the children of an import type/require call/dynamic import when looking for those ( #24663 )
2018-06-04 14:31:56 -07:00
Wesley Wigham
cbbf2e4e6f
Resolve aliases before using getTypereferenceType ( #24594 )
2018-06-04 14:19:41 -07:00
Andy
a641e6f85f
goToDefinition: Put variable definition before signature definition ( #24649 )
...
* goToDefinition: Put variable definition before signature definition
* Fix lint
2018-06-04 14:13:27 -07:00
Sheetal Nandi
c3dcc83d4f
Merge pull request #24664 from Microsoft/builderAPIBreak
...
Fix the issue with createSemanticDiagnosticsBuilderProgram, createEmitAndSemanticDiagnosticsBuilderProgram and createAbstractBuilder not assignable to CreateProgram<T>
2018-06-04 13:35:40 -07:00