Commit graph

814 commits

Author SHA1 Message Date
Wesley Wigham 9319ea4941
--showConfig files list condition was inverted from what it needed to be (#28693)
* --showConfig files list condition was inverted from what it needed to be

* Make no assumptions about file list normalization

* accept updated, correct, baseline
2018-11-28 14:01:02 -08:00
Sheetal Nandi 99d357db57 Enable statistics reporting per program through temporary build api 2018-11-19 12:38:36 -08:00
Daniel Rosenwasser 25462beeb7
Merge pull request #28456 from Microsoft/nonExperimentalBigInt
BigInt shouldn't be considered experimental
2018-11-12 15:59:15 -08:00
Michael Tang 4e0bb7a80a
Fix typo comment 2018-11-11 19:03:46 -08:00
Kagami Sascha Rosylight 7017d1a9ef
Merge branch 'master' into async-es2018 2018-11-12 11:04:21 +09:00
Daniel Rosenwasser f7ad54b432 Only complain about BigInt literals in pre-ESNext targets. 2018-11-09 16:20:54 -08:00
Sheetal Nandi c77f0c41c2 Add affectsModuleResolution to compile options: maxNodeModuleJsDepth
Fixes inferred project incorrectly modifying existing compiler options
Fixes #27108
2018-11-09 10:48:28 -08:00
Caleb Sander 28e9ec497c Address review comments 2018-11-05 11:36:32 -08:00
Caleb Sander 95c24c6c6a experimentalBigInt compiler flag 2018-11-05 11:36:31 -08:00
Caleb Sander 0c1bf316a2 Declaration files for BigInt 2018-11-05 11:36:30 -08:00
Sheetal Nandi 77ef9cedab Report error summary in pretty mode during normal compilation 2018-11-01 16:11:22 -07:00
Wesley Wigham a4a1bed88b
Add showConfig tsc flag for debugging configs (#27353)
* Add showConfig tsc flag for debugging configs

* Merge showConfig implementation with init implementation, add basic unit tests

* Fix lint

* Add missing semicolon

* showConfig when theres no config file
2018-10-31 15:57:09 -07:00
Andy 7c515bf6e8
Remove toSortedArray and toDeduplicatedSortedArray, use sort and sortAndDeduplicate (#28214) 2018-10-30 08:41:31 -07:00
Wesley Wigham 05716a74a5
Add support for configuration inheritance via packages (#27348)
* Add support for configuration inheritance via packages

* Fix lint

* Propagate trace into config parse hosts
2018-10-25 10:19:57 -07:00
Sheetal Nandi 91bb32ade4
Merge pull request #27560 from Microsoft/transitiveReferences
Resolve modules, type reference directives in context of referenced file
2018-10-18 13:03:10 -07:00
Wesley Wigham e58371e03a
Remove now unnessesary casts (#27954) 2018-10-17 15:17:21 -07:00
Sheetal Nandi b69622a114 Merge branch 'master' into transitiveReferences 2018-10-16 10:41:17 -07:00
Sheetal Nandi 92f3f1cde0 Allow files to be included by *.json pattern in include of tsconfig
Fixes #25636
2018-10-11 14:45:27 -07:00
Sheetal Nandi 94df5167b0 Handle resolution caching when referenced tsconfig changes 2018-10-04 15:04:12 -07:00
Sheetal Nandi 0ac96580d5 Resolve project references transitively 2018-10-04 15:04:10 -07:00
Sheetal Nandi 6e8027e95e
Merge pull request #27395 from Microsoft/noFilesError
Refactoring to unify updating no input files error
2018-10-01 15:03:44 -07:00
Sheetal Nandi 0245c2d35e Only copy non error values in array when converting the json
Fixes #27432
2018-09-28 13:49:00 -07:00
Wesley Wigham 7bf382e73f
Allow empty files lists in tsconfigs with an extends member (#27383) 2018-09-27 12:40:29 -07:00
Sheetal Nandi aed876dfb4 Refactoring to unify updating no input files error 2018-09-27 11:58:15 -07:00
Anders Hejlsberg 5510e0755e Merge branch 'master' into typedBindCallApply
# Conflicts:
#	tests/baselines/reference/tsxTypeArgumentPartialDefinitionStillErrors.errors.txt
#	tests/baselines/reference/wrappedAndRecursiveConstraints4.errors.txt
2018-09-24 16:38:39 -07:00
Sheetal Nandi b6d90841c9 Add traceResolution option to build options 2018-09-17 18:48:57 -07:00
Ryan Cavanaugh 577ee49106
Merge pull request #27139 from ajafff/config-extends
fix getExtendedConfig in commandLineParser
2018-09-17 16:29:16 -07:00
Klaus Meinhardt f71030f011 Simply override extendedSourceFiles array 2018-09-17 21:24:26 +02:00
Andy a57467a317
Fix bugs: Replace SourceFile if '--noUnusedLabels' changed (#27060)
* Fix bugs: Replace SourceFile if '--noUnusedLabels' changed

* Use properties on CommandLineOptionBase

* Handle "alwaysStrict" and better categorize options

* Properly handle "strict"

* Code review

* fix test
2018-09-17 10:53:48 -07:00
Klaus Meinhardt 78d221993b fix getExtendedConfig in commandLineParser
* remove invalid assertion
* fix invalid array spread on possibly undefined value
* only add unique files to extendedSourceFiles, preventing the array from growing infinitely
2018-09-17 14:41:48 +02:00
Sheetal Nandi 513a16264b Make parseCommandLineWorker non generic 2018-09-14 10:05:14 -07:00
Sheetal Nandi 4cf746cdc4 Enable listFiles and listEmittedFiles as build option 2018-09-13 11:17:03 -07:00
Sheetal Nandi 0d60348e45 Unify the commandline parsing worker 2018-09-13 10:30:45 -07:00
Anders Hejlsberg 9414fbe30b Merge branch 'master' into typedBindCallApply
# Conflicts:
#	src/compiler/diagnosticMessages.json
2018-09-12 13:31:59 -07:00
Sheetal Nandi ec38ca4fcb Merge branch 'master' into tsbuildWatchImprovements 2018-09-11 11:45:57 -07:00
Anders Hejlsberg 22a384d786 New --strictBindCallApply flag in compiler 2018-09-10 15:12:16 -07:00
Sheetal Nandi 59060a1b90 Remove unnecessary projectReferences from ExpandResult and referenceSpecs from ConfigFileSpecs 2018-09-10 12:33:10 -07:00
christian 16477b6506 Take into account undefined nodeValue when recording diagnostic 2018-09-08 00:06:07 -04:00
christian ec72f4751d Add location info to empty lists diagnostics when tsconfig file exists 2018-09-06 20:40:02 -04:00
christian ea984d7b64 Centralize diagnostic reporting for empty files diagnostic 2018-09-05 23:18:39 -04:00
Kagami Sascha Rosylight 26d6d7d16e Merge remote-tracking branch 'upstream/master' into async-es2018 2018-09-06 09:55:41 +09:00
christian c87ca2f1ab Fix diagnostic reporting for empty files in tsconfig 2018-09-03 22:57:26 -04:00
Sheetal Nandi d6ff1a7241 Move parsing of build options to commandLineParsing so it can be tested and it lines with other commandline parsing 2018-08-29 12:52:27 -07:00
Sheetal Nandi 071d790dec Unify tsbuild option parsing with command line options parsing 2018-08-21 13:41:30 -07:00
Sheetal Nandi 796302294f Review feedback 2018-08-10 14:44:44 -07:00
Sheetal Nandi 4475d81b9c Add flags on commandLineOption to indicate strictFlag or option affecting semanticDiagnostics 2018-08-06 14:54:57 -07:00
Kagami Sascha Rosylight 76ae12d143 Change esnext.asynciterable to es2018.asynciterable 2018-08-06 16:30:08 +09:00
Sheetal Nandi 3c971ed685 Handle when property name turns out to be non string literal computed name because of errors in tsconfig file
Fixes #26076
2018-07-31 17:23:55 -07:00
dangoo b7f5f2a92b Add missing references in clparser and libs.json 2018-06-19 22:24:32 +02:00
Ryan Cavanaugh 1bbe6610a4 Merge branch 'master' into esau-squash 2018-06-13 15:35:18 -07:00
Ryan Cavanaugh 066b191982 Collapse core/compiler/parser into parser 2018-06-11 17:07:58 -07:00
Ryan Cavanaugh 336c37662d Projzilla phase 1 2018-06-09 16:48:08 -07:00
Ryan Cavanaugh cf87bd446d Merge branch 'master' into tsbuild 2018-06-05 14:55:51 -07:00
Ron Buckton 666841264c Merge branch 'master' into libReference 2018-06-04 14:38:56 -07:00
Andy d671c7ae96
getEditsForFileRename: Support directory rename (#24305)
* getEditsForFileRename: Support directory rename

* Code review

* Handle imports inside the new file/directory

* Document path updaters

* Shorten relative paths where possible

* Reduce duplicate code

* Rewrite, use moduleSpecifiers.ts to get module specifiers from scratch instead of updating relative paths

* Update additional tsconfig.json fields

* Add test with '.js' extension

* Handle case-insensitive paths

* Better tsconfig handling

* Handle properties inside compilerOptions

* Use getOptionFromName
2018-06-01 08:23:37 -07:00
Ron Buckton 7de55fbb7e PR Feedback 2018-05-31 09:50:51 -07:00
王文璐 7910bbdccb add esnext symbol proposal 2018-05-31 13:30:31 +08:00
Ryan Cavanaugh f8c4301f14 Add more errors; commandline help for --build; invalid flag combo detection 2018-05-30 10:00:35 -07:00
Ron Buckton ec0af20f5a Merge branch 'master' into libReference 2018-05-29 14:13:00 -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
Ron Buckton 8548fb835a Merge branch 'master' into libReference 2018-05-11 20:05:26 -07:00
Alexader 60d39d7f18 add tests 2018-05-11 21:27:40 +03:00
Alexander T bb615ac3f9 Add declarationDir to excludeSpec 2018-05-11 13:47:44 +03:00
Ron Buckton 698f229bb4 Merge branch 'master' into libReference 2018-05-09 11:41:13 -07:00
Ryan Cavanaugh ffa0ccba2a Project References Core support 2018-05-07 15:12:50 -07:00
Ron Buckton 68c0e524a6 Accept new symbol baselines, ensure expected ordering for default libs 2018-05-04 17:23:56 -07:00
Ron Buckton c05923b152 add libMap and libs exports 2018-05-04 15:51:12 -07:00
Sheetal Nandi c4143ae0c1 Update the message for resolveJsonModule as per PR feedback 2018-05-04 11:14:39 -07:00
Sheetal Nandi 4e6586deb8 PR feedback 2018-05-04 10:45:46 -07:00
Sheetal Nandi 15f9ea3d14 Merge branch 'master' into requireJson 2018-05-03 15:35:54 -07:00
Ron Buckton 56648ad0f1
Merge pull request #20763 from Microsoft/vfs
Update harness to use single robust virtual file system for tests.
2018-05-03 10:25:20 -07:00
Armando Aguirre 1d593fd81e
Merge pull request #23191 from armanio123/AddVueSupport
Added deferred ScriptKind and renamed JsFileExtensionInfo to FileExte…
2018-05-02 18:13:34 -07:00
Ron Buckton d62a11ffc0 Merge branch 'master' into vfs 2018-05-01 18:58:31 -07:00
Ron Buckton 1dff0af646 More path cleanup 2018-05-01 18:53:54 -07:00
Derek P Sifford cc0c82c014 add lib.es2018.intl + fix lib.es2017.intl
closes #23691
2018-04-30 15:17:00 -04:00
Sheetal Nandi 579748bc2b Merge branch 'master' into requireJson 2018-04-30 11:44:09 -07:00
Anders Hejlsberg 16cd5580a6 Merge branch 'master' into improveIndexTypes
# Conflicts:
#	src/compiler/checker.ts
#	src/server/utilities.ts
2018-04-16 16:18:29 -07:00
Armando Aguirre 9923003ee6 Merge branch 'master' into AddVueSupport 2018-04-16 13:45:34 -07:00
Sheetal Nandi ce08af4dfe Merge branch 'master' into requireJson 2018-04-13 15:26:16 -07:00
Ryan Cavanaugh 8294259ec2 Remove all reference comments from compiler/ 2018-04-11 15:38:26 -07:00
Anders Hejlsberg ff20f38405 Add support for numbers and symbols in keyof (but keep it disabled) 2018-04-09 07:45:13 -10:00
Armando Aguirre 50eb512566 Added deferred ScriptKind and renamed JsFileExtensionInfo to FileExtensionInfo 2018-04-05 17:30:04 -07:00
Sheetal Nandi a14396320b Resolve json modules only when --resolveJsonModule is specified 2018-04-05 15:37:13 -07:00
Sheetal Nandi 9f724156be Merge branch 'master' into requireJson 2018-04-05 15:18:21 -07:00
Alexander T 75df5456a2 Allow using Advanced_Options with --init. Exclude all possible Advanced_Options in tsconfig.json which were NOT defined in command line 2018-03-30 07:49:16 +03:00
Wesley Wigham 6af764c560
Declaration maps and transparent goto definition using them (#22658)
* Add compiler option to enable declaration sourcemaps

* Transparent goto definition for sourcemapped declaration files

* Post-rebase touchups

* Rename API methods

* Fix lints

* Fix typo in name XD

* Log sourcemap decode errors

* Share the cache more, but also invalidate it more

* Remove todo

* Enable mapping on go to implementation as well

* Allow fourslash to test declaration maps mroe easily

* more test

* Handle sourceRoot

* Add tests documenting current behavior with other sourcemapping flags

* Ignore inline options for declaration file maps, simplify dispatch in emitter

* Change program diagnostic

* Fix nit

* Use charCodeAt

* Rename internal methods + veriables

* Avoid filter

* span -> position

* Use character codes

* Dont parse our sourcemap names until we need to start using them

* zero-index parsed positions

* Handle sourceMappingURL comments, including base64 encoded ones

* Unittest b64 decoder, make mroe robust to handle unicode properly

* Fix lint

* declarationMaps -> declarationMap

* Even more feedback

* USE Mroe lenient combined regexp

* only match base64 characters

* Fix nit
2018-03-26 12:15:34 -07:00
Sheetal Nandi 2071466420 Merge branch 'master' into requireJson 2018-03-08 13:24:59 -08:00
Sheetal Nandi ae8637c99f Merge branch 'master' into watchOptions 2018-03-03 10:51:59 -08:00
Yuichi Nukiyama 25525bc9d6 Change esnext.promise to es2018.promise (#22292)
* change esnest.promise to es2018.promise

* modify unit tests

* resolve conflict

* resolve conflict
2018-03-02 17:08:36 -08:00
Andy a564912d9a
Apply 'no-unnecessary-qualifier' lint rule (#22009) 2018-03-01 14:20:18 -08:00
Yuichi Nukiyama c7f65e8725 support groups property (#22176)
* support groups property

* fix option unittests
2018-03-01 12:58:25 -08:00
Josh Goldberg 24d3035184 Added --preserveWatchOutput flag (#21303)
Description: "Whether to keep outdated console output in watch mode instead of clearing the screen."
Since the `pretty?` compiler options flag is marked as `@internal`, made this one too.
2018-03-01 09:55:58 -08:00
Sheetal Nandi 23a7e2f840 Report errors about correctness of the json file 2018-02-24 09:46:29 -08:00
Sheetal Nandi 4257c2fa04 Resolve the .json file only if module name contains the extension 2018-02-23 17:27:17 -08:00
Sheetal Nandi a790a92f7d Parse all json values at root 2018-02-23 14:00:30 -08:00
Sheetal Nandi ca590d6fed Need allowJs to be true to use the json module resolution 2018-02-23 14:00:23 -08:00
Sheetal Nandi ee2e267d38 Replace usage of jsonObject on JsonSourceFile 2018-02-23 13:59:47 -08:00
Sheetal Nandi 9a160f2079 Merge branch 'master' into watchOptions 2018-02-21 10:44:12 -08:00
Mohamed Hegazy 8f8fec433e
Rename switch --emitDeclarationsOnly to --emitDeclarationOnly (#21651)
* Rename `--emitDeclarationsOnly` to `--renameDeclarationOnly`

* Rename test files
2018-02-05 14:48:50 -08:00
Sheetal Nandi ca4af4f36c Merge branch 'master' into watchOptions 2018-02-05 13:07:12 -08:00
Armando Aguirre 6435d26510
Merge pull request #21505 from armanio123/SetNoEmitTrueJsConfig
Set noEmit = true  on jsconfig.json file
2018-01-31 11:08:04 -08:00
Wesley Wigham 6219be6144
Do no path canonicalization during config parsing (#20311)
* Do no canonicalization during config parsing

* Add test from issue

* Apply code review feedback
2018-01-30 14:16:44 -08:00
Manoj Patel afc588eb9e --emitDeclarationsOnly flag to enable declarations only output (#20735)
* Add emitOnlyDeclarations flag

* Fix name

* verifyOptions checking logic

* Passing tests

* doJsEmitBaseline

* Tests !!!
2018-01-25 15:35:18 -08:00
Armando Aguirre 4af47f1887 Added NoEmit=true when jsconfig is present 2018-01-25 14:06:11 -08:00
Sheetal Nandi 63a3a65ac7 Use toLowercase as utility function 2018-01-17 12:59:09 -08:00
Daniel 2ca688a87d Remove the colon from the message in tsconfig.json (#21174)
* Add additional diagnostic message for tsconfig.json

* Add a way to override description for tsconfig.json

* Modify reference tsconfig.json in tests

* Don't have to differentiate cmdline and tsconfig.json description

This reverts commit efe57733ca and 94f9e67a24.

* Remove colon from diagnostic message code 6079

* Remove colon from localized messages code 6079

* Revert "Remove colon from localized messages code 6079"

Not changing files on src/loc because they are managed using automated tools.

This reverts commit e91f52348e.
2018-01-17 09:42:40 -08:00
Wesley Wigham 7e6315075d
Synthesize namespace records for proper esm interop (#19675)
* Integrate importStar and importDefault helpers

* Accept baselines

* Support dynamic imports, write helpers for umd module (and amd is possible) kinds

* Accept baselines

* Support AMD, use same helper initialization as is normal

* update typechecker to have errors on called imported namespaces and good error recovery with a quickfix

* Overhaul allowSyntheticDefaultExports to be safer

* Put the new behavior behind a flag

* Rename strictESM to ESMInterop

* ESMInterop -> ESModuleInterop, make default for tsc --init

* Rename ESMInterop -> ESModuleInterop in module.ts, add emit test (since fourslash doesnt do that)

* Remove erroneous semicolons from helper

* Reword diagnostic

* Change style

* Edit followup diagnostic

* Add secondary quickfix for call sites, tests forthcoming

* Add synth default to namespace import type, enhance quickfix

* Pair of spare tests for good measure

* Fix typos in diagnostic message

* Improve comment clarity

* Actually accept the updated changes to the esmodule interop description

* ESModule -> esModule

* Use find and not forEach

* Use guard

* Rely on implicit falsiness of Result.False

* These should have been emit flags
2018-01-08 16:36:23 -08:00
Mohamed Hegazy c632e44350
Merge branch 'master' into issue20410 2018-01-08 13:28:59 -08:00
Andy 6f2ba15446
Start linting for double spaces (#20820)
* Start linting for double spaces

* Code review

* Fix cases that were excluded by countDoubleSpaces

* Remove extraneous closing parenthesis
2018-01-08 08:52:13 -08:00
benbraou b36d614b56 bug(esnext): add definition for promise.finally (#20511)
Fixes #20411
2018-01-04 15:31:59 -08:00
Oussama Ben Brahim 8c2eeb215f bug(esnext): add definitions for flatten and flatMap
Fixes #20410
2017-12-16 19:53:08 +01:00
Wesley Wigham 2c6501db52
Allow multiple star-star globs in one pattern (#20639)
* Allow multiple starglobs in one pattern

* Add extra test case
2017-12-13 12:57:16 -08:00
Andy d8142339f9
Use 'filter' array helper (#20452) 2017-12-04 13:36:01 -08:00
benbraou 49a48ffd4d fix(es2018): add a target and an initial lib (#20385)
* run Jake LKG before es2018 addition

Fixes #20342

* fix(es2018): add a target and an initial lib

Fixes #20342
2017-12-02 11:16:59 -08:00
Anders Hejlsberg 8cbff0159d Add --strictPropertyInitialization compiler option 2017-11-16 10:58:00 -08:00
Andy 592ee00906
Have CompletionEntryDetails source use a relative path (#19917)
* Have CompletionEntryDetails source use a relative path

* Use getCanonicalFileName from services Instead of creating a new one
2017-11-14 14:26:49 -08:00
Andy 40efd1b3bd
Apply 'object-literal-key-quotes' tslint rule (#19737)
* Apply 'object-literal-key-quotes' tslint rule

* Convert to "consistent-as-needed"
2017-11-06 18:13:20 -08:00
Eugene Timokhov 5b9905d5a4 Added empty constructors to TypedArrays from es2017 (#19680) 2017-11-06 13:00:05 -08:00
Klaus Meinhardt 4895d16645 convertToObject: handle negative numbers in JSON
Fixes: #19551
2017-10-28 20:06:33 +02:00
Andy 1f282f19e0 Fix "noStringLiteral" lint errors (#19310) 2017-10-19 08:15:48 -07:00
Andy 2b566b9a53 Add exported members of all project files in the global completion list (#19069)
* checker.ts: Remove null check on symbols

* tsserverProjectSystem.ts: add two tests

* client.ts, completions.ts, types.ts: Add codeActions member to CompletionEntryDetails

* protocol.ts, session.ts: Add codeActions member to CompletionEntryDetails protocol

* protocol.ts, session.ts, types.ts: add hasAction to CompletionEntry

* session.ts, services.ts, types.ts: Add formattingOptions parameter to getCompletionEntryDetails

* completions.ts: define SymbolOriginInfo type

* completions.ts, services.ts: Add allSourceFiles parameter to getCompletionsAtPosition

* completions.ts, services.ts: Plumb allSourceFiles into new function getSymbolsFromOtherSourceFileExports inside getCompletionData

* completions.ts: add symbolToOriginInfoMap parameter to getCompletionEntriesFromSymbols and to return value of getCompletionData

* utilities.ts: Add getOtherModuleSymbols, getUniqueSymbolIdAsString, getUniqueSymbolId

* completions.ts: Set CompletionEntry.hasAction when symbol is found in symbolToOriginInfoMap (meaning there's an import action)

* completions.ts: Populate list with possible exports (implement getSymbolsFromOtherSourceFileExports)

* completions.ts, services.ts: Plumb host and rulesProvider into getCompletionEntryDetails

* completions.ts: Add TODO comment

* importFixes.ts: Add types ImportDeclarationMap and ImportCodeFixContext

* Move getImportDeclarations into getCodeActionForImport, immediately after the implementation

* importFixes.ts: Move createChangeTracker into getCodeActionForImport, immediately after getImportDeclarations

* importFixes.ts: Add convertToImportCodeFixContext function and reference it from the getCodeActions lambda

* importFixes.ts: Add context: ImportCodeFixContext parameter to getCodeActionForImport, update call sites, destructure it, use compilerOptions in getModuleSpecifierForNewImport

* importFixes.ts: Remove moduleSymbol parameter from getImportDeclarations and use the ambient one

* importFixes.ts: Use cachedImportDeclarations from context in getCodeActionForImport

* importFixes.ts: Move createCodeAction out, immediately above convertToImportCodeFixContext

* Move the declaration for lastImportDeclaration out of the getCodeActions lambda into getCodeActionForImport

* importFixes.ts: Use symbolToken in getCodeActionForImport

* importFixes.ts: Remove useCaseSensitiveFileNames altogether from getCodeActions lambda

* importFixes.ts: Remove local getUniqueSymbolId function and add checker parameter to calls to it

* importFixes.ts: Move getCodeActionForImport out into an export, immediately below convertToImportCodeFixContext

* completions.ts: In getCompletionEntryDetails, if there's symbolOriginInfo, call getCodeActionForImport

* importFixes.ts: Create and use importFixContext within getCodeActions lambda

* importFixes.ts: Use local newLineCharacter instead of context.newLineCharacter in getCodeActionForImport

* importFixes.ts: Use local host instead of context.host in getCodeActionForImport

* importFixes.ts: Remove dummy getCanonicalFileName line

* Filter symbols after gathering exports instead of before

* Lint

* Test, fix bugs, refactor

* Suggestions from code review

* Update api baseline

* Fix bug if previousToken is not an Identifier

* Replace `startsWith` with `stringContainsCharactersInOrder`
2017-10-17 10:20:11 -07:00
Mohamed Hegazy ae3f29ade6 Accept baselines (#18903) 2017-10-02 19:08:13 -07:00
Sheetal Nandi 4bb4711eff Merge branch 'master' into watchImprovements 2017-10-02 16:34:43 -07:00
Sheetal Nandi 68d360585a PR feedback 2017-09-26 16:21:15 -07:00
Anders Hejlsberg 12f5dd85d7 Introduce --strictFunctionTypes mode 2017-09-18 06:33:47 -07:00
Sheetal Nandi fdb104b242 Merge branch 'master' into watchImprovements 2017-09-11 13:49:36 -07:00
Wesley Wigham 27f9cdb1ae Explicitly avoid canonicalizing paths during configuration handling (#18316)
* Explicitly avoid canonicalizing paths during configuration handling

* Extract usage of identity in commandLineParser into single function, use identity in checker
2017-09-07 15:54:24 -07:00
Wesley Wigham 72cbc12c9a Allow undefined/null to override all parameters (#18058) 2017-09-06 22:08:42 -07:00
Sheetal Nandi 60e2e68dfb Merge branch 'watchImprovements' into builder 2017-08-18 13:38:24 -07:00
Sheetal Nandi d217bec0e1 Merge branch 'master' into watchImprovements 2017-08-18 13:35:35 -07:00
Sheetal Nandi e639ceb038 Merge branch 'watchImprovements' into builder 2017-08-18 11:56:12 -07:00
Sheetal Nandi da0d374b30 Made updates to not expose methods/types that arent needed. 2017-08-18 11:55:47 -07:00
Sheetal Nandi 989508245b Updating according to feedback from PR 2017-08-14 12:52:29 -07:00
Sheetal Nandi d0a23bb876 Merge branch 'watchImprovements' into builder 2017-08-12 15:35:30 -07:00
Sheetal Nandi 594482d2c9 Merge branch 'master' into watchImprovements 2017-08-11 20:13:15 -07:00
Wesley Wigham d03d1074ee Make compiler options which map to a flag case-insensitive again (#17755) 2017-08-11 19:59:43 -07:00
Sheetal Nandi 8db05c2d85 More work on PR feedback update 2017-08-11 16:37:47 -07:00
Andy f64b8ad902 Add "preserveSymlinks" option (#16661)
* Add "preserveSymlinks" option

* Respond to PR comments
2017-08-11 10:03:21 -07:00
Sheetal Nandi 65521bc259 Feedback from the PR 2017-08-08 15:12:02 -07:00
Andy 85f59098d3 validateSpecs: Use array helpers (#17275)
* validateSpecs: Use array helpers

* Make filter predicate smaller

* forEach -> for-of
2017-08-08 11:38:41 -07:00
Sheetal Nandi ef5935b52c Initial refactoring so that watch from tsc follows the tsserver projects 2017-08-07 11:19:52 -07:00
Sheetal Nandi 273569f6fe Make the host cache store the fileName instead of undefined for the missing host files 2017-08-07 11:04:33 -07:00
Sheetal Nandi ae87838f45 Merge branch 'master' into watchImprovements 2017-08-07 11:04:11 -07:00
Ron Buckton b747c2dd96 exclude node_modules unless explicitly included 2017-08-03 18:48:27 -07:00
Andy e515151ba4 Remove unnecessary MapLikes in commandLineParser (#17324)
* Remove unnecessary `MapLike`s in commandLineParser

* Fix typo

* Inline knownKeysCount
2017-07-25 14:19:17 -07:00
Andy c1375d5422 generateTSConfig: Remove unnecessary variable (#17330) 2017-07-25 13:30:48 -07:00
Andy eadd084c82 Add 'name' property to Identifier (#17329)
* Add 'name' property to Identifier

* Rename to unescapedText

* Rename 'id.text' to 'id.escapedText'

* Rename 'id.unescapedText' to 'id.text'

* Make escapeIdentifier and unescapeIdentifier do nothing
2017-07-25 13:16:34 -07:00
Andy f0bd91c314 Convert Array to ReadonlyArray/Push in commandLineParser.ts (#17323) 2017-07-21 07:16:22 -07:00
Sheetal Nandi ff34a77ab6 Merge branch 'master' into watchImprovements 2017-07-17 16:54:28 -07:00
Andy Hanson 2ce23909b2 Fix error message 2017-07-17 12:39:01 -07:00
Andy Hanson 96d537bc54 readFile may return undefined 2017-07-14 15:57:23 -07:00
Sheetal Nandi 0365901381 use single instance of getCanonicalFileName 2017-07-13 15:32:11 -07:00
Sheetal Nandi 048e67c021 Merge branch 'master' into watchImprovements 2017-07-13 14:13:14 -07:00
Andy 08030c7d02 Convert most of core.ts to accept ReadonlyArray (#17092)
* Convert most of core.ts to accept ReadonlyArray

* Fix lint

* Fix isArray
2017-07-11 17:39:33 -07:00
Sheetal Nandi 62871cc0f9 Only update file list when there are changes in the watched directories 2017-07-11 14:10:48 -07:00
ikatyang a79240fbc6 Add missing docs for module: 'none' in tsc --init 2017-07-07 18:25:22 +08:00
Wesley Wigham 4e6b2f3c93 Created a branded type for identifier-escaped strings (#16915)
* Created a branded type for escaped strings

Then flowed it throughout the compiler, finding and fixing a handful of
bugs relating to underscore-prefixed identifiers in the process.
Includes a test for two cases noticed - diagnostics from conflicting
symbols from export *'s, and enum with underscore prefixed member emit.

* Correctly double underscores WRT mapped types

* Add fourslash tests for other fixed issues

* use function call over cast

* Update forEachEntry type accuracy

* Just use escaped names for ActiveLabel

* Remove casts from getPropertyNameForPropertyNameNode

* This pattern has occurred a few times, could use a helper function.

* Remove duplicated helper

* Remove unneeded check, use helper

* Identifiers list is no longer escaped strings

* Extract repeated string-getting code into helper

* Rename type and associated functions

* Make getName() return UnderscoreEscapedString, add getUnescapedName()

* Add list of internal symbol names to escaped string type to cut back on casting

* Remove outdated comments

* Reassign interned values to nodes, just in case

* Swap to string enum

* Add deprecated aliases to escapeIdentifier and unescapeIdentifier

* Add temp var

* Remove unsafe casts

* Rename escaped string type as per @sandersn's suggestion, fix string enum usages

* Reorganize double underscore tests

* Remove jfreeman from TODO

* Remove unneeded parenthesis
2017-07-06 14:45:50 -07:00
Nathan Shively-Sanders 2eec7f3565 Dedupe some utility code
1. convertToArray is a duplicate of arrayFrom
2. inferFromParameterTypes delegates immediately to inferFromTypes
3. One usage of arrayFrom instantiated a whole iterator only to take the
first element, which is the same as calling `next`.
2017-06-30 09:23:00 -07:00
Andy 179a3e10b5 Handle depth in all readDirectory implementations (#16646) 2017-06-29 11:04:33 -07:00
Oleg Mihailik b60f936b14 Enquote undefineds. 2017-06-20 22:54:50 +01:00
Sheetal Nandi 09f0b3471a Merge branch 'master' into ownJsonParsing 2017-06-15 09:59:37 -07:00
Anders Hejlsberg dc28aaa132 Add --noStrictGenericChecks compiler option 2017-06-12 13:09:01 -07:00
TravCav b57830f7f9 enforcing curly braces (#16315) 2017-06-07 11:58:25 -07:00
Sheetal Nandi 48189c883f Merge branch 'master' into ownJsonParsing 2017-06-06 11:03:21 -07:00
Yui T b9017795a0 Revert "Revert "[Master] wip-dynamic import" (#16264)"
This reverts commit ccc60c8b3b.
2017-06-05 17:16:29 -07:00
Sheetal Nandi c4ad151a46 Merge branch 'master' into ownJsonParsing 2017-06-05 17:01:09 -07:00
Mohamed Hegazy ccc60c8b3b Revert "[Master] wip-dynamic import" (#16264) 2017-06-05 10:49:20 -07:00
Sheetal Nandi d680720f6d Merge branch 'master' into ownJsonParsing 2017-06-05 10:28:23 -07:00
Yui T 1729ea8609 Update command line 2017-06-04 21:18:52 -07:00
Yui T e386d65ed6 Use ESNext instead of ES2018 2017-06-04 19:58:24 -07:00
Yui T 2f476bf22f Merge branch 'master' into master-dynamicImport 2017-06-02 09:10:20 -07:00
t_ 6e49237d31 Remove trailing whitespace from tsconfig.json (#16197)
* Remove trailing whitespace from tsconfig.json

* Simplify
2017-06-01 13:43:44 -07:00
Sheetal Nandi 8d771ca044 Merge branch 'master' into ownJsonParsing 2017-05-30 13:03:23 -07:00
Sheetal Nandi 7db76edbae Always return empty object when converting the json sourcefile into actual json object, allowing to continue compilation even if there are errors in the tsconfig files 2017-05-30 11:37:26 -07:00
Sheetal Nandi 7bd9e092ac Make configFile on compiler options as non enumerable 2017-05-26 17:15:57 -07:00
Andy d052bb83ca Add project telemetry (#16050)
* Add project telemetry

* Respond to some PR comments

* Wrap event in a TelemetryEvent payload

* Replace paths with empty string instead of removing them entirely

* Add "version" property to payload

* Add telemetry for typeAcquisition settings

* Add "files", "include", "exclude", and "compileOnSave"

* Convert typingsOptions include and exclude to booleanss

* Add "extends", "configFileName", and "projectType"

* configFileName: Use "other" instead of undefined

* Add "languageServiceEnabled" telemetry
2017-05-25 13:30:27 -07:00
Sheetal Nandi f1ea38d127 Merge branch 'master' into ownJsonParsing 2017-05-24 12:46:29 -07:00
Kanchalai Tanglertsampan faab927c8d Merge branch 'master' into master-dynamicImport
# Conflicts:
#	src/compiler/checker.ts
#	src/compiler/emitter.ts
#	src/compiler/parser.ts
#	src/compiler/transformers/module/module.ts
#	src/compiler/transformers/module/system.ts
2017-05-24 11:26:06 -07:00
Donald Pipowitch f309996b32 added es2017.intl (#15369) 2017-05-24 09:50:38 -07:00
Sheetal Nandi ea60e9966d Get configFiles as part of file names 2017-05-15 16:07:08 -07:00
Sheetal Nandi c97b389b07 Simplifying the json conversion notifier 2017-05-11 11:08:03 -07:00
Sheetal Nandi d7e9609ae5 Merge branch 'master' into ownJsonParsing 2017-05-11 09:10:35 -07:00
Andy Hanson a7457871a6 Merge branch 'master' into config-extension 2017-05-08 11:00:58 -07:00
Yui T feb41f7d7c Merge branch 'master' into master-dynamicImport
# Conflicts:
#	src/compiler/diagnosticMessages.json
#	src/compiler/program.ts
2017-04-26 15:35:30 -07:00
Sheetal Nandi 3f7b53e0cd Use base tsconfig's compileOnSave option if tsconfig.json doesnt have it specified
Fixes #13910
2017-04-18 14:10:58 -07:00
Sheetal Nandi 6f568b3f26 Merge branch 'master' into ownJsonParsing 2017-04-17 13:40:49 -07:00
Andy af64ef8b67 Merge pull request #15141 from Microsoft/getOwnKeys
Remove unnecessary use of getOwnKeys
2017-04-14 11:47:54 -07:00
Andy Hanson 8c559a4f08 Respond to PR comments 2017-04-12 15:11:16 -07:00
Andy Hanson 893e3242fb Don't access sys.newLine inside unit tests 2017-04-11 14:24:32 -07:00
Andy Hanson 4ae8df635a Remove unnecessary use of getOwnKeys
Also, fix a typo.
2017-04-11 14:19:11 -07:00
Andy Hanson 92bea77ad3 Tsconfig inheritance: Do not resolve included files in an inherited tsconfig 2017-04-11 14:05:57 -07:00
Andy Hanson ed5eca2b7b boolean-trivia lint rule: Enforce space between comment and argument 2017-04-11 09:44:58 -07:00
Ryan Cavanaugh d8a24e3a5b Merge pull request #15021 from RyanCavanaugh/lintFixes
Update linting to avoid typechecking for booleanTriviaRule
2017-04-05 12:26:58 -07:00
Ryan Cavanaugh e3bb5d3f28 Update linting to avoid typechecking for booleanTriviaRule 2017-04-04 22:34:51 -07:00
Andy Hanson 73cab09608 Enable jsdoc-format lint rule 2017-04-03 14:39:19 -07:00
Kanchalai Tanglertsampan 11f6eaec5b Merge branch 'master' into master-dynamicImport
# Conflicts:
#	src/compiler/commandLineParser.ts
2017-03-29 10:51:05 -07:00
Mohamed Hegazy e408cad618 Merge branch 'master' into checkJSFiles 2017-03-22 15:45:27 -07:00
Mohamed Hegazy 88b88e1055 Remove BOM 2017-03-22 12:41:11 -07:00
Mohamed Hegazy d906e91236 Code review comments 2017-03-22 12:01:08 -07:00
Mohamed Hegazy b6ccad4b54 Fix bad merge 2017-03-15 17:21:07 -07:00