Commit graph

1542 commits

Author SHA1 Message Date
Daniel Rosenwasser ffa1ea72c1 Just always print out modifiers for global augmentations.
Apparently, they don't always need them!
2017-09-22 00:12:37 -07:00
Daniel Rosenwasser 979295b21b Force 'declare' modifiers and correct global augmentation emit. 2017-09-21 12:20:14 -07:00
Andy 79e12eb48b Ensure that emitter calls callbacks for empty blocks (#18547) 2017-09-18 10:05:44 -07:00
Andy 0747b33038 Fixes to emit / format for codeFix (#18484) 2017-09-14 14:30:50 -07:00
Andy 4ee7d3aeb2 Remove unnecessary check in emitNodeList (#18327) 2017-09-08 07:18:37 -07:00
Andy ed4e2e6e3b Ensure that emitter calls callbacks (#18284)
* Ensure that emitter calls calbacks

* Move new parameter to end of parameters

* Fix for ConditionalExpression

* Make suggested changes to emitter

* Fix parameter ordering

* Respond to minor comments

* Remove potentially expensive assertion

* More emitter cleanup
2017-09-07 14:30:19 -07:00
Wesley Wigham 72884b8f27 Emit comments on system export default expressions on the surrounding export call epxression instead (#17970) 2017-09-06 21:59:06 -07:00
Andy 08fbcd8b80 Fix many no-object-literal-type-assertion lint errors (#17278)
* Fix many no-object-literal-type-assertion lint errors

* Simple fixes

* Use a union for FlowNode

* PR feedback and remove remaining `id()` uses

* Use a union for CodeBlock

* Discriminate CodeBlock by CodeBlockKind
2017-08-10 12:52:15 -07:00
Wesley Wigham a6f37f55e4 Add a leading space on binary operator token trailing comments (#17691)
* Add a leading space on token trailing comments

* Demystify comment
2017-08-09 14:27:37 -07:00
Wesley Wigham c399230767 Retain comments inside return statements (#17557)
* Retain comments inside return statements by including the return keyword in the parse tree

* Revert "Retain comments inside return statements by including the return keyword in the parse tree"

This reverts commit 5d2142edb1.

* Readd test

* Function for handling printing comments on a token
2017-08-08 19:53:53 -07:00
Ron Buckton 75c8ecb2f1 Merge pull request #17517 from tinganho/IgnoredCatchParameter
Ignored catch parameter
2017-08-08 16:15:18 -07:00
Yui d7fff8ebe9 [Master] fix 12985 emit leading and trailing comment around binary operator (#16584)
* Emit leading and trailing on binary operator

* Add tests and baselines

* Update baselines
2017-08-04 19:12:13 -07:00
Tingan Ho d5c24f3cd3 Addresses CR comment 2017-08-02 20:13:43 +02:00
Tingan Ho b917eb0225 Adds optional catch parameter into the compiler 2017-07-30 23:26:47 +02: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 194c2bc2ca Make NodeArray readonly (#17213)
* Make NodeArray readonly

* Fix bug: use emptyArray instead of undefined

* Fix bug: Don't expose MutableNodeArray

* Undo trailing whitespace changes
2017-07-18 10:38:21 -07:00
Andy 17578e8a5d Use Map<true> for sets (#16972) 2017-07-07 10:34:36 -07: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
Sheetal Nandi 09f0b3471a Merge branch 'master' into ownJsonParsing 2017-06-15 09:59:37 -07:00
Ron Buckton 00a926cc4e Fix parameter emit for synthetic function types 2017-06-07 15:34:10 -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 2f476bf22f Merge branch 'master' into master-dynamicImport 2017-06-02 09:10:20 -07:00
Sheetal Nandi 16fd947ac3 Reorganized code to keep createBundle and updateBundle in factory.ts 2017-05-26 15:37:41 -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
Kanchalai Tanglertsampan a2ba649ddd Fix emit duplicate comment 2017-05-24 10:54:08 -07:00
Arthur Ozga b4ee6b19aa Object literal formatting (#16007)
* consolidate object literal formatting

* accept baselines
2017-05-23 14:22:01 -07:00
Ika f9a1fca388 Add missing emitter for NamespaceExportDeclaration (#16025) 2017-05-23 11:07:34 -07:00
Ika 49638ab2eb Add missing questionToken in emitMethod/PropertyDeclaration (#16020) 2017-05-23 10:37:21 -07:00
Yui e4aa515191 [Master] Fix 15179 missing comment in switch case clause (#16033)
* Fix emit comments after switch case clause

* Update baselines

* Add new tests and baselines
2017-05-23 10:24:46 -07:00
Ryan Cavanaugh f6fbe61718 Refactoring support (squash) 2017-05-19 10:45:49 -07:00
Anders Hejlsberg 947abf5d6b Merge branch 'master' into literalEnumTypes
# Conflicts:
#	src/compiler/checker.ts
#	src/compiler/diagnosticMessages.json
#	src/compiler/types.ts
#	src/compiler/utilities.ts
#	src/services/completions.ts
2017-05-17 11:59:12 -07:00
Arthur Ozga 11019e4a4a Merge branch 'master' into typeToStringViaTypeNode 2017-05-16 15:35:31 -07:00
Arthur Ozga 0820f69270 respond to comments 2017-05-16 15:28:32 -07:00
Arthur Ozga bba41a8a0c avoid ascii escaping literal text 2017-05-15 18:42:49 -07:00
Arthur Ozga 9e9054bd2b handle todo 2017-05-12 17:42:10 -07:00
Arthur Ozga a32bc985bf respond to comments 2017-05-12 16:27:35 -07:00
Arthur Ozga 62dbf12825 Merge branch 'master' into typeToStringViaTypeNode 2017-05-12 13:09:43 -07:00
Ron Buckton 22cf036ed9 Clean up naming, add documentation, flatten (some) nested commas 2017-05-12 09:57:39 -07:00
Ron Buckton f45f7579fc Adds CommaList to avoid large deeply nested comma expressions 2017-05-11 23:51:20 -07:00
Arthur Ozga 0432257949 use EmitFlags.SingleLine 2017-05-11 18:39:40 -07:00
Arthur Ozga a5e93c427b remove souceFile checks 2017-05-11 16:44:05 -07:00
Arthur Ozga 41452a5b21 add typeArguments to identifier 2017-05-09 18:20:46 -07:00
Arthur Ozga ad58572edb trailing comma 2017-05-09 13:50:14 -07:00
Arthur Ozga 89f8cca488 mapped type indent 2017-05-09 13:14:39 -07:00
Arthur Ozga d9b68e9213 Type Literal and Binding Name formatting 2017-05-08 16:26:57 -07:00
Arthur Ozga b8bb0c22f3 emit type parameter's default 2017-05-05 14:47:57 -07:00