Commit graph

30 commits

Author SHA1 Message Date
Nathan Shively-Sanders
3d841b20a7 Lint unit tests via harnessSources in Jakefile.js 2016-05-24 10:17:16 -07:00
Josh Soref
bb85817d7d spelling fixes for src
Fixes:
* actual
* algorithm
* analyze
* applies
* collapse
* contrast
* definition
* diagnostic
* different
* displayed
* display
* documentation
* finite
* function
* highlight
* initialize
* intentional
* interface
* invariants
* items
* keystroke
* language
* literal
* original
* output
* position
* receive
* recorder
* response
* sequence
* simplicity
* statement

Changing a \ to a /
2016-02-25 20:08:44 +00:00
Vladimir Matveev
a69b04145d delete entry from the cache when referenced file is removed, added tests 2015-08-06 16:23:21 -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
Jason Freeman
580d0a6331 More tests 2015-02-20 12:15:37 -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
5aca35e35f Move unit tests to use the new adaptors 2015-02-03 17:28:33 -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
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
Mohamed Hegazy
17c45ed986 revert changes to classify a keyword as an identifier if the last token is keyword 2014-08-08 16:43:31 -07:00
Mohamed Hegazy
ad9a87dfb6 Add some huristic optimization to not colorize a keyword if precceded by a dot or a keyword. this should handel cases for "a.var" or "module string { }" 2014-08-08 10:37:10 -07:00
Mohamed Hegazy
bae6ddd1b5 add unterminated multiline comment classification tests 2014-08-07 23:51:15 -07:00
Mohamed Hegazy
3fcd33ec32 Enable clorizer unit tests 2014-08-07 23:45:03 -07:00
Mohamed Hegazy
214df64e28 Add snapshot of compiler sources 2014-07-12 17:30:19 -07:00