Commit Graph

34 Commits

Author SHA1 Message Date
Benjamin Gray
9e1e647ec7 fix lint 2019-06-21 16:32:16 +10:00
Benjamin Gray
166d968daa adjust specs 2019-06-21 16:11:50 +10:00
Rafael Oleza
66f7f1746a Reformat all JS files using prettier 2019-05-31 20:26:19 +02:00
Rafael Oleza
41840abdc2 Merge commit '1d9a4cafcf6cc288d675512db8fd984e13aab869' into pr18738 2019-05-31 20:25:41 +02:00
Rafael Oleza
0580aa11d1 Merge commit '677bbb7f0b8754787ff9e7bfab4602ba82e13b0b' into pr18738 2019-05-31 20:19:05 +02:00
Rafael Oleza
7f3f040628 Reformat all JS files using prettier 2019-05-31 18:33:56 +02:00
Nathan Sobo
5a6f93d1c3 Fix lint errors 2019-04-19 12:03:40 -06:00
Nathan Sobo
51d97a16d8 Add test for content regexes in first-mate grammars 2019-04-19 10:55:34 -06:00
Benjamin Gray
8a488b2bd1 fix lint 2019-03-04 23:44:57 +11:00
Benjamin Gray
0312f5347c fix specs 2019-03-04 22:52:32 +11:00
Rafael Oleza
a93808d1a8 Always use global it, beforeEach and afterEach methods 2019-02-28 20:39:21 +01:00
Rafael Oleza
d7d6d0838f Remove unused vars from specs 2019-02-28 19:30:03 +01:00
Rafael Oleza
c35ec012b4 Run prettier on spec/ folder 2019-02-28 19:30:03 +01:00
Max Brunsfeld
245472734b Allow tree-sitter setting to be set for specific languages 2018-09-21 09:34:13 -07:00
Max Brunsfeld
760b38c54b Support a single scope name field on Tree-sitter grammars
* Remove the `legacyScopeName` field
* Remove the legacy scope name concept from the Config class
* Handle tree-sitter grammars and textmate grammars having the same 
scope names
2018-08-20 09:58:37 -07:00
Max Brunsfeld
6f41353e9f Support two different content-matching regexes for tree-sitter grammars
* firstLineRegex is only tested against the first line of the file, and
  if it matches, it allows the grammar to be used for the file.
* contentRegex is only tested if the grammar matched the file name
  or the grammar's firstLineRegex matched. It is used to break ties
  between grammars like C and C++, Flow and JS
2018-08-09 17:19:32 -07:00
Max Brunsfeld
4d3916f74e Add tests and docs for addInjectionPoint
Also, replace `addInjectionPattern` API with a single `injectionRegExp` 
field on the grammar.

Co-Authored-By: Ashi Krishnan <queerviolet@github.com>
2018-06-27 12:39:29 -07:00
Max Brunsfeld
6346f5ec9e Grammar scoring, weigh grammar type higher than content regex match
This fixes another regression introduces in #17468
2018-06-07 16:17:23 -07:00
Max Brunsfeld
31f511aae7 Don't boost tree-sitter grammars' score unless they match in some way 2018-06-05 16:00:03 -07:00
Max Brunsfeld
4dbfadd0d5 Make Tree-sitter grammars' contentRegExp work as intended 2018-06-04 17:17:37 -07:00
Max Brunsfeld
7c6312b277 Update assertions about lack of memory-leak in GrammarRegistry specs 2018-04-25 13:17:33 -07:00
Max Brunsfeld
adbd540029 Only return overridden language ids in .getGrammarOverride 2018-02-15 12:29:48 -08:00
Max Brunsfeld
4adfba47cc Support legacyScopeName field on tree-sitter grammars
* Use the field for mapping scope names in GrammarRegistry.grammarForId
* Use the field for adapting legacy scoped settings to work with tree-sitter parsers

Signed-off-by: Nathan Sobo <nathan@github.com>
2017-12-15 16:57:36 -08:00
Max Brunsfeld
f3715779e5 Support contentRegExp field on grammars, to match more than one line
Signed-off-by: Nathan Sobo <nathan@github.com>
2017-12-05 16:26:24 -08:00
Max Brunsfeld
273d708a48 Add preference for using Tree-sitter parsers 2017-11-30 14:21:53 -08:00
Max Brunsfeld
894ce56821 Don't use JS as an example in removeGrammar test 2017-11-30 09:39:30 -08:00
Max Brunsfeld
9762685106 Start work on loading tree-sitter grammars in GrammarRegistry 2017-11-30 09:31:08 -08:00
Max Brunsfeld
e08091f193 Make assignLanguageMode take a language id instead of a language name 2017-11-28 11:14:29 -08:00
Max Brunsfeld
4810d13094 Fix memory leak in .maintainLanguageMode 2017-11-22 11:41:55 -08:00
Max Brunsfeld
be3010e8f7 Use atom's null grammar when assignLanguageMode is called w/ null 2017-11-21 14:59:42 -08:00
Max Brunsfeld
d52c4bc33b Serialize the grammar registry 2017-11-20 14:50:00 -08:00
Max Brunsfeld
b2fcb0cbe2 Integrate the 2 grammar registry specs 2017-11-20 13:53:19 -08:00
Max Brunsfeld
f6c2e0eba4 Allow setting the null language mode w/ assignLanguageMode(buffer, null) 2017-11-20 09:48:00 -08:00
Max Brunsfeld
351f96d5dd Iterate on GrammarRegistry APIs
Signed-off-by: Nathan Sobo <nathan@github.com>
2017-11-06 09:36:06 -08:00