Cyrus Najmabadi
f90f8e8061
CR feedback.
2015-02-23 15:41:43 -08:00
Cyrus Najmabadi
fd1b5875e2
Move NavigateTo over to using the new pattern matcher.
2015-02-22 21:25:43 -08:00
CyrusNajmabadi
b3a74ae32d
Merge pull request #2094 from Microsoft/patternMatcher
...
Add a PatternMatcher API (similar to the one in Roslyn) for more advanced matching with features like NavigateTo.
2015-02-21 14:56:11 -08:00
Cyrus Najmabadi
06a278458a
Merge branch 'master' into patternMatcher
...
Conflicts:
src/services/services.ts
2015-02-21 14:34:15 -08:00
Cyrus Najmabadi
fc229368d1
Include the binary expression's operator in the AST.
2015-02-20 18:56:42 -08:00
Jason Freeman
580d0a6331
More tests
2015-02-20 12:15:37 -08:00
Cyrus Najmabadi
33e1e5d905
Add a PatternMatcher API (similar to the one in Roslyn) for more advanced matching with features like NavigateTo.
2015-02-20 00:22:41 -08:00
Daniel Rosenwasser
67638cbc00
Make 'syntacticClassifierAbsent' non-optional.
2015-02-16 12:21:16 -08:00
Daniel Rosenwasser
ab79faef85
Added tests, fixed order of emptying templateStack, unconditionally perform template classification.
2015-02-12 16:28:45 -08:00
Mohamed Hegazy
08f51b9070
Respond to code review comments
2015-02-09 09:19:50 -08:00
Mohamed Hegazy
55aa240ade
Merge branch 'master' into LSAPICleanup
...
Conflicts:
src/services/services.ts
2015-02-06 17:17:23 -08:00
Cyrus Najmabadi
ea4e3de91c
Remove unnecessary diagnostics split on SourceFile.
2015-02-05 13:38:11 -08:00
Mohamed Hegazy
40a01a81b3
Merge branch 'master' into fourslashCleanup
...
Conflicts:
src/harness/fourslash.ts
src/harness/harnessLanguageService.ts
2015-02-04 20:22:00 -08:00
Mohamed Hegazy
5aca35e35f
Move unit tests to use the new adaptors
2015-02-03 17:28:33 -08:00
Cyrus Najmabadi
95702a89a7
Fix spelling of 'Filename' to be 'FileName'.
2015-02-03 16:08:46 -08:00
Vladimir Matveev
288e38fa36
merge with master
2015-02-03 11:26:39 -08:00
Mohamed Hegazy
d6bd9f74d2
Merge branch 'master' into LSAPICleanup
2015-02-02 18:49:13 -08:00
Cyrus Najmabadi
5343336763
Baseline updates now that we no longer have early errors.
2015-02-02 15:15:54 -08:00
Mohamed Hegazy
0257acebd3
Respond to code review comments
2015-01-26 16:45:34 -08:00
Mohamed Hegazy
1b1a45be6b
update unit test contents
2015-01-20 11:03:51 -08:00
Mohamed Hegazy
66f8257fc8
Remove isOpen from souceFile and LanugageServiceHost interfaces
2015-01-16 21:23:51 -08:00
Vladimir Matveev
c40977c5fb
move getSyntacticDiagnostics out of SourceFile
2015-01-16 12:32:37 -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
Cyrus Najmabadi
4545549e07
Disable incremental by default before merging into master.
2014-12-17 12:41:08 -08:00
Cyrus Najmabadi
bd76ebd02b
Enable incremental parsing by default.
...
Provide flag to disable incremental parsing if necessary.
2014-12-14 12:39:11 -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
f5d622f0c9
Move test helpers into the harness Utils module.
2014-12-14 10:57:34 -08:00
Cyrus Najmabadi
d5c6636854
Parse function and variable declarations uniformly, whether they're at teh top level, or inside a method.
...
This is necessary for incremental parsing correctness, as the incremental parser
will attempt to reuse these types of nodes in both contexts, and we much ensure
it creates the same trees you would get if you were parsing normally.
2014-12-12 03:52:01 -08:00
Cyrus Najmabadi
8820ca0596
Change the error-bit to be a node-flag and not a parser context flag.
...
Do not reuse nodes with errors in them. We need to reparse them to make
sure we produce the right errors the second time around.
2014-12-12 03:25:49 -08:00
Cyrus Najmabadi
60c62e5b6b
Don't consume nodes during calls to isListElement.
2014-12-12 03:06:05 -08:00
Cyrus Najmabadi
9c0e4211bc
Properly adjust nodes while walking down the tree.
2014-12-12 02:34:53 -08:00
Cyrus Najmabadi
2f833d5f97
Provide a way for tests to try out incremental parsing.
2014-12-12 02:21:45 -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
402c57cf7e
Adding classification test.
2014-12-11 17:04:21 -08:00
Cyrus Najmabadi
fbeb7dd75e
Merge branch 'funcDeclsInBlocks' into sourceFileUpdate
...
Conflicts:
src/services/outliningElementsCollector.ts
2014-12-11 15:16:46 -08:00
Cyrus Najmabadi
ba0fd4453d
Add additional incremental tests.
2014-12-10 23:04:13 -08:00
Cyrus Najmabadi
ee828dc1da
More incremental parser tests.
2014-12-10 19:15:44 -08:00
Cyrus Najmabadi
563b234240
Incremental parser tests should verify the same set of diagnostics are produced.
2014-12-10 19:07:36 -08:00
Cyrus Najmabadi
888b88ee43
Move textSpan and textChangeRange impls to the compiler layer.
2014-12-10 14:36:37 -08:00
Cyrus Najmabadi
c2d4cd5887
Move TextSpan into the compiler layer.
2014-12-10 13:45:08 -08:00
Cyrus Najmabadi
5bd49fec1d
Initial entrypoint in SourceFile for the LS to call to peform incremental parsing.
...
Right now the entrypoint just causes a full parse to happen. But the LS code is
cleaned up to take advantage of it appropriately.
2014-12-10 11:45:33 -08:00
Cyrus Najmabadi
1170a1c436
Only set parents for parse trees in the LS for the syntactic trees.
...
we don't need this for the semantic trees because the compiler will set them all during
the binding.
2014-12-10 10:09:40 -08:00
Cyrus Najmabadi
dd2c869d7b
Use chai asserts.
2014-12-09 19:49:40 -08:00
Cyrus Najmabadi
aa30ac8a9c
Add incremental test.
2014-12-09 19:37:26 -08:00
Cyrus Najmabadi
2a845726ab
Add incremental test.
2014-12-09 18:36:32 -08:00
Cyrus Najmabadi
3c35b9097f
Add incremental test.
2014-12-09 18:35:23 -08:00
Cyrus Najmabadi
58d36afbec
Add incremental test.
2014-12-09 18:32:43 -08:00
Cyrus Najmabadi
3928f743ac
Add incremental test.
2014-12-09 18:30:40 -08:00
Cyrus Najmabadi
01ead476cf
Add incremental test.
2014-12-09 18:29:18 -08:00
Cyrus Najmabadi
b8bb8e9998
Add incremental test.
2014-12-09 18:27:59 -08:00