Commit graph

622 commits

Author SHA1 Message Date
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