574 Commits

Author SHA1 Message Date
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
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
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 efe57733cac305533c61c7bea3d51b302bbb4d19 and 94f9e67a247f2d73ddff6935083f76812efd2a21.

* 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 e91f52348e17bf829db2418020c4281203d03e05.
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