Commit Graph
494 Commits
Author SHA1 Message Date
Daniel Rosenwasser bfe63cc4cb Merge pull request #1648 from Microsoft/contextualTypeParenthesizedExpressions
Contextually type parenthesized expressions
2015-01-14 14:52:07 -08:00
Jason Freeman 4a1851c7b8 Merge pull request #1562 from csnover/fix-1133
Ensure specialized signatures are always at the top when performing call candidate resolution
2015-01-13 17:33:57 -08:00
Vladimir Matveev 150720bd70 when formatting lists check if end list token still belongs to the parent node 2015-01-13 14:22:53 -08:00
Daniel Rosenwasser 6783e35f89 Removed probably-unnecessary statement from test. 2015-01-11 00:21:37 -08:00
Daniel Rosenwasser 22174a17c6 Contextually type parenthesized expressions. 2015-01-09 15:10:32 -08:00
Jason Freeman 7459c87265 Merge branch 'release-1.4'
Conflicts:
	bin/lib.core.es6.d.ts
	bin/lib.es6.d.ts
	bin/tsc.js
	bin/typescript.d.ts
	bin/typescriptServices.d.ts
	bin/typescriptServices.js
	bin/typescriptServices_internal.d.ts
	bin/typescript_internal.d.ts
2015-01-05 15:08:17 -08:00
Colin Snover 435b44ce57 Put specialized signatures at the top of the list of call candidates
Fixes #1133.
2014-12-26 01:01:41 +00:00
Cyrus Najmabadi 0707350c7b Update conflict marker formatting test. We now no longer format the second branch of hte merge. 2014-12-19 11:33:45 -08:00
Cyrus Najmabadi a6ea497ff1 Classify the '=' sign in variable/parameter/property as if it was an operator. 2014-12-18 19:38:19 -08:00
Cyrus Najmabadi 48bef4698b Provide better error recovery when we encounter merge markers in the source.
Previously we would just treat each merge marker as trivia and then continue
scanning and parsing like normal.  This worked well in some scenarios, but
fell down in others like:

```
class C {
    public foo() {
<<<<<<< HEAD
        this.bar();
    }
=======
        this.baz();
    }
>>>>>>> Branch

    public bar() { }
}
```

The problem stems from the previous approach trying to incorporate both branches of the merge into
the final tree.  In a case like this, that approach breaks down entirely.  The the parser ends up
seeing the close curly in both included sections, and it considers the class finished.  Then, it
starts erroring when it encounters "public bar()".

The fix is to only incorporate one of these sections into the tree.  Specifically, we only include
the first section.  The second sectoin is treated like trivia and does not affect the parse at all.
To make the experience more pleasant we do *lexically* classify the second section.  That way it
does not appear as just plain black text in the editor.  Instead, it will have appropriate lexicla
classifications for keywords, literals, comments, operators, punctuation, etc.  However, any syntactic
or semantic feature will not work in the second block due to this being trivia as far as any feature
is concerned.

This experience is still much better than what we had originally (where merge markers would absolutely)
destroy the parse tree.  And it is better than what we checked in last week, which could easily create
a borked tree for many types of merges.

Now, almost all merges should still leave the tree in good shape.  All LS features will work in the
first section, and lexical classification will work in the second.
2014-12-18 19:18:13 -08:00
Daniel Rosenwasser af9b56bdd9 Merge pull request #1528 from Microsoft/goToDefOnUnionMethod
Fix crash on go-to-def on union method
2014-12-18 12:11:05 -08:00
Daniel Rosenwasser 6fed3e2601 Merge pull request #1501 from Arnavion/no-emit
Add -noEmit compiler flag that skips the emit stage in ts.compile()
2014-12-17 18:00:33 -08:00
Daniel Rosenwasser b3ccb562fb Added test for goToDef on union types. 2014-12-17 15:11:43 -08:00
Daniel Rosenwasser 42babc52d3 Use 'definitionCountIs' in union property tests. 2014-12-17 15:11:40 -08:00
Daniel Rosenwasser 6c753496e7 Rename file. 2014-12-17 15:11:38 -08:00
Daniel Rosenwasser 7a1be3cc04 Added test using code from original issue. 2014-12-17 15:11:35 -08:00
Daniel Rosenwasser af4d7d3ff4 Added goToDef count verification in fourslash facilities. 2014-12-17 15:11:31 -08:00
Daniel Rosenwasser eaaf7ad468 Normalize a few fourslash line endings. 2014-12-17 15:11:29 -08:00
Arnavion cd6eb180c6 Don't emit outputs when -noEmit is specified. 2014-12-16 20:25:19 -08:00
Cyrus Najmabadi c9ee88e5c4 Adding incremental test. 2014-12-16 11:58:47 -08:00
Cyrus Najmabadi 8917e96663 Merge branch 'funcDeclsInBlocks' into sourceFileUpdate
Conflicts:
	src/compiler/parser.ts
	src/compiler/utilities.ts
2014-12-16 03:12:31 -08:00
Cyrus Najmabadi c7bb0a5ae6 Don't store variable statement flags on its variable declaration children. 2014-12-16 02:50:38 -08:00
Cyrus Najmabadi 41e59824fb Merge branch 'master' into funcDeclsInBlocks 2014-12-15 20:50:48 -08:00
Daniel Rosenwasser e68c53f708 Separated fourslash test to two files. 2014-12-15 14:55:46 -08:00
Daniel Rosenwasser b65a422c7a Fixed contextual typing for tagged template expressions. 2014-12-15 14:11:21 -08:00
Cyrus Najmabadi 14883cb18e Merge branch 'master' into typingHighFidelity 2014-12-14 23:46:05 -08:00
Cyrus Najmabadi 3478099a85 Add incremental parsing LS test. 2014-12-14 12:30:02 -08:00
Cyrus Najmabadi 872df4dda4 Merge branch 'noDebuggerInTests' into sourceFileUpdate 2014-12-14 12:23:05 -08:00
Cyrus Najmabadi b4a21686c1 Remove calls to "debugger;" in our fourslash tests. 2014-12-14 12:22:36 -08:00
Cyrus Najmabadi e1e5243335 Merge branch 'typingHighFidelity' into sourceFileUpdate
Conflicts:
	tests/cases/unittests/incrementalParser.ts
2014-12-14 12:06:26 -08:00
Cyrus Najmabadi 0e01e48d0e Always run all fourslash tests in high fidelity typing mode.
We want to verify after every edit that our incremental data is correct.
2014-12-14 11:34:15 -08:00
Cyrus Najmabadi ffdddd53af Merge branch 'master' into funcDeclsInBlocks
Conflicts:
	src/compiler/diagnosticInformationMap.generated.ts
	src/compiler/diagnosticMessages.json
	src/compiler/parser.ts
2014-12-12 14:05:09 -08:00
Vladimir Matveev ed9234ed32 do not indent leading comments that attached to tokens with errors 2014-12-12 09:00:20 -08:00
Vladimir Matveev 6b438c22fd added test for inherited indentation 2014-12-12 08:59:47 -08:00
Vladimir Matveev 59a31acca1 conditionals are now introduce indentation scope 2014-12-12 08:59:26 -08:00
Cyrus Najmabadi f218ce7684 Merge branch 'master' into sourceFileUpdate
Conflicts:
	src/compiler/diagnosticInformationMap.generated.ts
	src/compiler/diagnosticMessages.json
	src/compiler/parser.ts
	tests/baselines/reference/APISample_node_compile.js
	tests/baselines/reference/APISample_node_compile.types
	tests/baselines/reference/APISample_standalone_compile.js
	tests/baselines/reference/APISample_standalone_compile.types
2014-12-12 00:52:07 -08:00
Cyrus Najmabadi 7df3a407c2 Make the compiler resilient to encountering merge conflict markers in a source code file. 2014-12-11 16:56:10 -08:00
Cyrus Najmabadi 76df92cc78 Merge branch 'master' into funcDeclsInBlocks 2014-12-11 14:59:03 -08:00
Cyrus Najmabadi b692ea9b66 Remove TryBlock and FinallyBlock.
They break the rule that syntactically identical constructs use the same syntax kind.  This
prevents node reuse in incremental parsing.
2014-12-11 14:40:25 -08:00
Vladimir Matveev 997aadb902 Merge pull request #1437 from Microsoft/formatting_conditionals
conditionals are now introduce indentation scope
2014-12-10 23:28:54 -08:00
Vladimir Matveev d69ba56ece added test for inherited indentation 2014-12-10 22:01:34 -08:00
Vladimir Matveev 10d08b816e do not indent leading comments that attached to tokens with errors 2014-12-10 15:08:26 -08:00
Vladimir Matveev 30ada4cffe conditionals are now introduce indentation scope 2014-12-10 14:03:14 -08:00
Anders Hejlsberg bb70e9eb12 Merge pull request #1346 from Microsoft/destructuring
Destructuring
2014-12-09 11:39:23 -08:00
Anders Hejlsberg 7bc35b3ae0 Merge branch 'master' into destructuring
Conflicts:
	src/compiler/binder.ts
	src/compiler/checker.ts
	src/compiler/emitter.ts
	src/compiler/parser.ts
	src/services/services.ts
	tests/baselines/reference/parserCommaInTypeMemberList2.errors.txt
2014-12-09 11:26:43 -08:00
Vladimir Matveev 0871801352 inherit delta from nodes on the same line 2014-12-09 10:47:27 -08:00
Vladimir Matveev cd2016c48a Merge pull request #1416 from Microsoft/inherited_deltas
inherit delta from nodes on the same line
2014-12-09 10:46:41 -08:00
Vladimir Matveev 7ed4225413 inherit delta from nodes on the same line 2014-12-09 04:55:33 -08:00
Anders Hejlsberg 459dee0e84 Merge branch 'master' into destructuring
Move downlevel vs. ES6 emit branching into individual emit functions
2014-12-08 14:42:38 -08:00
Vladimir Matveev 929d359bdf fix formatting to add space after comma between arguments when arguments starts with open paren 2014-12-08 14:28:19 -08:00