Commit graph

58 commits

Author SHA1 Message Date
Ryan Cavanaugh
61b71008d7 Remove obsolute AMD logic from reference preprocessing in services 2015-10-16 17:35:43 -07:00
Ryan Cavanaugh
1a36fce4c2 JavaScript LS scaffolding + JS module inference 2015-10-14 17:36:03 -07:00
Daniel Rosenwasser
ad8bcfabdc handeles -> handles 2015-09-15 15:18:24 -07:00
Mohamed Hegazy
7e1739604a Fix #4727: prerocess export import declarations correctelly 2015-09-10 13:24:45 -07:00
Vladimir Matveev
a69b04145d delete entry from the cache when referenced file is removed, added tests 2015-08-06 16:23:21 -07:00
Vladimir Matveev
544a7939f0 return ambient external modules as a results of preprocessing 2015-07-29 16:47:34 -07:00
Vladimir Matveev
c968b3653e addressed PR feedback 2015-06-24 17:40:04 -07:00
Daniel Rosenwasser
caf0939d50 Removed more 'debugger' statements from tests. 2015-06-09 16:47:43 -07:00
Cyrus Najmabadi
5ad7a593d4 Add a common, dense, format for classification operations to lower cost of processing on the host side.
We now just return an array of triples to represent classified results.  The triple contains:
1) the start of the classification.
2) the length of the classification.
3) the type of the clasification.

We also encode this into a comma separated string when passing over to the managed side
(as opposed to an JSON array).  That way we don't pay such a high JSON parsing cost.
Instead, we can just do a string.split(",") on the encoded triples and process each
element ourselves.
2015-04-30 14:26:46 -07:00
Mohamed Hegazy
70d5f9c8e7 Merge pull request #2140 from Microsoft/lsImportResolution
Support new import / export syntax in preProcessFile
2015-02-28 05:03:03 -08:00
Cyrus Najmabadi
3c78a0522b Add tests. 2015-02-27 16:29:12 -08:00
Cyrus Najmabadi
545fa20efd Add registry tests. 2015-02-27 16:26:15 -08:00
Mohamed Hegazy
30cc1cc478 Add support for new import syntax in preprocessFile 2015-02-25 14:00:44 -08:00
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
Cyrus Najmabadi
06a278458a Merge branch 'master' into patternMatcher
Conflicts:
	src/services/services.ts
2015-02-21 14:34:15 -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
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
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
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
402c57cf7e Adding classification test. 2014-12-11 17:04:21 -08:00
Daniel Rosenwasser
cef5062791 Fixed issue where classifier didn't check for backslash-newline. 2014-11-26 16:32:30 -08:00
Vladimir Matveev
ced8785bd3 eliminate usage of TypeScript module from services layer 2014-11-17 17:01:23 -08:00
Yui T
3c6d9c8173 Remove old commit and debugger flag 2014-10-29 14:27:43 -07:00
Yui T
4f6ccab5e9 Move Convert FileReference to the shim 2014-10-28 14:45:32 -07:00
Yui T
acbc28d3e1 Add tests case for invalid syntax in import statement and triple slash reference 2014-10-27 17:09:59 -07:00
Yui T
300c059d1f Remove diagnostic from pre-processing of files 2014-10-27 17:03:06 -07:00
Yui T
7f8b24c6cc Fix getTokenPos for scanning import statement 2014-10-27 10:09:57 -07:00
Yui T
95f6cbe760 Add unittests for preProcessFile 2014-10-24 16:03:59 -07:00
Yui T
54bc1da5d0 Address code review 2014-10-20 14:39:31 -07:00
Yui T
ba77284485 Fix colorization unittest 2014-10-20 13:11:08 -07:00
Yui T
30fe3f7221 Fix runtests for unittests 2014-10-20 13:08:33 -07:00
Cyrus Najmabadi
e751c34fcb Add some heuristics in the lexical classifier to make it play better with the syntactic classifier when classifying expressions involving generics. 2014-10-03 01:54:43 -07:00
Cyrus Najmabadi
f09971f10b Tweak classification so it does not classify things as keywords that could not actually be keywords according to the grammar. 2014-09-30 14:35:07 -07:00
Daniel Rosenwasser
4ed6a80c9c Limited identifying identifiers after dots to keywords. 2014-09-26 09:46:14 -07:00
Daniel Rosenwasser
a3b59f88c1 Fix issue where trivia is incorrectly identified as an identifier following a dot.
Fixes #753
2014-09-25 22:28:02 -07:00
Daniel Rosenwasser
25170ef5dd Changed wording for unit tests. 2014-09-23 14:14:27 -07:00
Daniel Rosenwasser
c719100f69 Added test cases for multiline comments in line classification. 2014-09-23 14:13:43 -07:00
Daniel Rosenwasser
4493aa60eb Added unit test for property access colorization. 2014-09-23 13:59:55 -07:00
Daniel Rosenwasser
b2372c9e7b Fixed up colorization tests. 2014-09-23 12:23:33 -07:00
Mohamed Hegazy
4e17787cb5 Do not colorize a keyword following an identifier.<newLine> as it is likely an error scenario as the user is typing 2014-09-15 13:55:50 -07:00
Mohamed Hegazy
be47b94c8f clean up tests 2014-08-08 16:45:10 -07:00