Commit Graph

2665 Commits

Author SHA1 Message Date
Andy
e99be8c47d Avoid duplicate import completions when a namespace is exported by two different modules (#24473) 2018-05-29 15:52:34 -07:00
Wesley Wigham
64642bb5c3 Dump fork output on unclean exit (#24394)
* Dump fork output on unclean exit

* Remember to clear timeout on process exit in case processes exit at very different times
2018-05-24 16:13:32 -07:00
Sheetal Nandi
51058b56e5 Do not trigger invalidation if emitted file is in declarationDir 2018-05-24 13:36:52 -07:00
Wesley Wigham
a0b57808d0 Dont count duplicated errors in case-insensitive duped files in rwc (#24383) 2018-05-24 12:23:43 -07:00
Andy
bc570cd85f moveToNewFile: Respect UserPreferences#quote (#24365) 2018-05-24 09:36:37 -07:00
Mohamed Hegazy
dd6dc5e27a Merge pull request #24328 from Microsoft/getEditsForFileRename_oldFileStillPresent
getEditsForFileRename: Handle old file still being present
2018-05-23 16:16:00 -07:00
Wenlu Wang
4606709672 add code fix convert to mapped object type (#24286)
* add code fix convert to mapped object type

* add support for type literal and improve test

* fix typo

* add support for heritageClauses

* only determine declaration is not class
2018-05-23 14:09:49 -07:00
Wesley Wigham
7e4b20e587 Use compare paths for comparing diagnostic paths, since the canonicalization of fileName and unitName differ (#24340) 2018-05-22 17:01:34 -07:00
Andy
aed0eb6693 Improve verify.codeFixAvailable (#24325)
* Improve verify.codeFixAvailable

* Revert change to `verify.not.codeFixAvailable()`, and use `assertObjectsEqual` for better errors
2018-05-22 16:04:39 -07:00
Andy
e53e56cf82 Enable '--strictNullChecks' (#22088)
* Enable '--strictNullChecks'

* Fix API baselines

* Make sys.getEnvironmentVariable non-nullable

* make properties optional instead of using `| undefined` in thier type

* reportDiagnostics should be required

* Declare firstAccessor as non-nullable

* Make `some` a type guard

* Fix `getEnvironmentVariable` definition in tests

* Pretend transformFlags are always defined

* Fix one more use of sys.getEnvironmentVariable

* `requiredResponse` accepts undefined, remove assertions

* Mark optional properties as optional instead of using `| undefined`

* Mark optional properties as optional instead of using ` | undefined`

* Remove unnecessary null assertions

* Put the bang on the declaration instead of every use

* Make `createMapFromTemplate` require a parameter

* Mark `EmitResult.emittedFiles` and `EmitResult.sourceMaps` as optional

* Plumb through undefined in emitLsit and EmitExpressionList

* `ElementAccessExpression.argumentExpression` can not be `undefined`

* Add overloads for `writeTokenText`

* Make `shouldWriteSeparatingLineTerminator` argument non-nullable

* Make `synthesizedNodeStartsOnNewLine` argument required

* `PropertyAssignment.initializer` cannot be undefined

* Use one `!` at declaration site instead of on every use site

* Capture host in a constant and avoid null assertions

* Remove few more unused assertions

* Update baselines

* Use parameter defaults

* Update baselines

* Fix lint

* Make Symbol#valueDeclaration and Symbol#declarations non-optional to reduce assertions

* Make Node#symbol and Type#symbol non-optional to reduce assertions

* Make `flags` non-nullable to reduce assertions

* Convert some asserts to type guards

* Make `isNonLocalAlias` a type guard

* Add overload for `getSymbolOfNode` for `Declaration`

* Some more `getSymbolOfNode` changes

* Push undefined suppression into `typeToTypeNodeHelper`

* `NodeBuilderContext.tracker` is never `undefined`

* use `Debug.assertDefined`

* Remove unnecessary tag

* Mark `LiteralType.freshType` and `LiteralTupe.regularType` as required
2018-05-22 14:46:57 -07:00
Andy
9cda2bdba0 Support recommended completion for union (#24326)
* Support recommended completion for union

* Fix for empty enum, which is not a union
2018-05-22 13:38:28 -07:00
Andy Hanson
46eaf62abb getEditsForFileRename: Handle old file still being present 2018-05-22 12:20:34 -07:00
Sheetal Nandi
f44dd6f53b Merge pull request #24206 from Microsoft/documentRegistery
Cache the latest source file from document registery in script info so that we do not have to reparse orphan script info
2018-05-22 12:11:16 -07:00
Sheetal Nandi
e8a0e56e3e Add a test when orphan file changes before it gets added back to project 2018-05-22 11:45:52 -07:00
Andrew Casey
bedc110c74 Merge pull request #24311 from amcasey/GH23287
Preserve jsx imports even when the compiler option is not set
2018-05-22 11:23:15 -07:00
Sheetal Nandi
66590a9391 Verify ref counts are set correctly when reusing the source file from script info cache 2018-05-22 11:18:40 -07:00
Andy
7106a587cc Add type for diagnostics where location is defined (#23686)
* Add type for diagnostics where location is defined

* getSemanticDiagnostics may return global diagnostics

* Reduce array creation
2018-05-22 11:01:18 -07:00
Mohamed Hegazy
7fb3123984 Merge pull request #24298 from Microsoft/noErrOnBackgroundUpdate
Add noGetErrOnBackgroundUpdate session option to not queue diagnostics check for open files
2018-05-22 10:56:18 -07:00
Andrew Casey
2e0cc63067 Check TransformFlags.ContainsJsx, rather than LanguageVariant.JSX 2018-05-22 10:51:19 -07:00
Andy
982c8d0af9 Add suggestion diagnostics for unused label and unreachable code (#24261)
* Add suggestion diagnostics for unused label and unreachable code

* Always error on unused left hand side of comma
2018-05-22 07:56:29 -07:00
Andrew Casey
edd31a1505 Preserver jsx imports even when the compiler option is not set
...based on feedback from VS Code users.

Fixes #23287
2018-05-21 16:57:18 -07:00
Sheetal Nandi
f1acbc93ef Add noGetErrOnBackgroundUpdate session option to not queue diagnostics check for open files
This will ensure that the getErr will be queued in by host and hence would make sure that it is cancellable.
Handles one of the scenario delaying completions in #19458
2018-05-21 12:53:31 -07:00
Sheetal Nandi
e4c380a698 Merge branch 'master' into documentRegistery 2018-05-21 12:27:12 -07:00
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
7fcf1fdeb6 Delete redundant tests 2018-05-18 10:49:10 -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
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
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
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
王文璐
5d233054c3 add quick fix for import type missing typeof 2018-05-17 16:35: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
Wesley Wigham
a85f1d5c1e Fix lint 2018-05-16 13:11:25 -07:00
Wesley Wigham
8ce581149c Bump user test enumeration timeout 2018-05-16 12:42:46 -07: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
Sheetal Nandi
77168e5d50 Merge pull request #24112 from Microsoft/packageJsonWithMainInSubDirectory
Resolve using package json's "main" field when resolving typescript extensions
2018-05-15 14:18:27 -07:00
Wesley Wigham
86dce41ec0 Move synthetic comments from arrow body expressions to return statement (#24135) 2018-05-15 13:11:38 -07:00
Andy
e1f22ac568 Combine signatureHelp testing methods (#24132) 2018-05-15 12:34:53 -07:00
Wesley Wigham
5756ae1fd8 External runner fixes (#24115)
* Add missing @types/node dep to so many projects, rename parent node_modules dirs so they dont participate in tests, sort errors

* Accept new baselines

* Satisfy linter
2018-05-15 11:15:08 -07:00
Sheetal Nandi
dc50fe5e40 Apart from typing, use main field in package json to resolve typescript files
Fixes #23502
2018-05-14 14:52:11 -07:00
Andy
9b6378b938 Use SHA256 hash for project info telemetry (#24099)
* Use SHA256 hash for project info telemetry

* Update API baselines
2018-05-14 11:32:16 -07:00
Ron Buckton
672d8e5e9d Merge pull request #24076 from Microsoft/fix24006
Cut back on more 'caught exceptions' from vfs
2018-05-14 09:24:26 -07:00
Ron Buckton
f5281d62cc Fix async generator rejection handling 2018-05-12 02:07:31 -07:00
Ron Buckton
70b6bd95c3 Cut back on more 'caught exceptions' from vfs 2018-05-11 20:44:21 -07:00
Armando Aguirre
5cc833a5f5 Merge pull request #24049 from armanio123/AddDeferredToProjectTelemetry
Add deferred to project telemetry
2018-05-11 13:07:32 -07:00
Alexader
60d39d7f18 add tests 2018-05-11 21:27:40 +03:00
Andrew Casey
020d6c7ba3 Merge pull request #24048 from amcasey/GH23366
Ignore case when sorting imports
2018-05-10 19:11:44 -07:00
Armando Aguirre
bb178d38bf Small test fixes 2018-05-10 18:18:43 -07:00