Nathan Sobo
93910201b0
Re-tokenize buffer when its grammar is updated
...
This can happen if a grammar that the grammar includes is added or
removed from the syntax global.
2013-04-22 11:34:03 -06:00
Kevin Sawicki
62c94959e1
Move injections spec to TextMateGrammar spec
...
This spec was previously in the TokenizeBuffer spec which
required having a PHP fixture and setting up an edit session
to verify a line could be tokenized which was unnecessary.
2013-04-19 10:58:35 -07:00
Kevin Sawicki & Nathan Sobo
1dffb9237a
Use the earliest result when both injection and non-injection patterns match
2013-04-19 10:58:34 -07:00
Kevin Sawicki
c2eca1ff99
Add initial support for injection grammars
...
Build scope selectors and patterns when setting up the grammar
for all entries under the grammar's injection object.
Include the injection patterns in the scanner when the injection's
scope selector matches the current rule stack.
2013-04-19 10:58:34 -07:00
Corey Johnson & Nathan Sobo
8437f3ff7f
Only load TextMate packages as needed in specs
...
Also: when a TextMate package is deactivated, remove its grammars
2013-03-26 17:35:42 -06:00
Kevin Sawicki & Nathan Sobo
1d1ba5f6d1
Use node's require instead of internal require
2013-03-12 10:38:05 -07:00
Kevin Sawicki
2212222c47
Use underscore node module
2013-03-11 11:22:36 -07:00
Nathan Sobo
54fc9efdcb
Eliminate fixturesProject global. Use project global instead.
2013-03-07 09:30:27 -08:00
Nathan Sobo
beaeac4425
Rename buildEditSessionForPath
to buildEditSession
...
Since this is the more external method, having a shorter name
is more convenient. The former `buildEditSession` method took a
Buffer, and is now called `buildEditSessionForBuffer`.
2013-03-07 09:28:51 -08:00
Corey Johnson & Nathan Sobo
7372ae00cd
Resolve $base includes correctly in TextMate grammars
2013-01-08 10:50:23 -08:00
Kevin Sawicki
88ff5cac29
Add spec for string characters before escape character
2013-01-07 14:22:39 -08:00
Kevin Sawicki
0f71848b2b
Add spec for semicolon at end of line
2013-01-07 14:22:39 -08:00
Kevin Sawicki
15d7b2f159
Add failing spec
2013-01-07 14:22:39 -08:00
Nathan Sobo
0a08d03c68
Rename Buffer
, TokenizedBuffer
, and Selection
events
2013-01-04 13:59:11 -07:00
Kevin Sawicki
f592242737
Terminate when no more tokens and at end of line
...
This corrects a regression when pattern matching
to the newline was added.
If the newline is never matched the loop still needs to
terminated so now when the position is before the newline
and the last match had no tokens the loop is broken out of.
2012-12-26 11:44:15 -08:00
Kevin Sawicki
559b9132f9
Parse until position equals line length including trailing newline
2012-12-21 13:22:13 -08:00
Kevin Sawicki
8aba95191d
Append anchor characters when placeholder is not added
2012-12-21 13:22:13 -08:00
Kevin Sawicki
9f6d1f987f
Add initial support for replacing anchors
2012-12-21 13:22:08 -08:00
Corey Johnson & Nathan Sobo
dc60017c02
Async-tokenize remaining buffer changes that exceed chunk size
2012-12-11 16:51:05 -08:00
Nathan Sobo
a1ae819908
Only tokenize in background if when a buffer is visible in an editor
...
This will prevent running a bunch of background tokenization when Atom is reloaded. We only perform tokenization to support content that is actually on screen.
2012-11-23 12:41:08 -07:00
Nathan Sobo
f466a2eede
Un-F
2012-11-23 10:46:26 -07:00
Nathan Sobo
bcab21709b
Handle changes that straddle or are inside of the invalid regions
2012-11-22 11:02:14 -07:00
Nathan Sobo
48f9f70dd2
Handle changes in the valid region of a partially tokenized buffer
2012-11-22 10:07:24 -07:00
Nathan Sobo
893e7428c6
💄
2012-11-21 18:44:42 -07:00
Nathan Sobo
0fd921bb40
💄 and update specs for async tokenization of invalidated rows
2012-11-21 18:38:39 -07:00
Nathan Sobo
5acd1b6ee3
When a change invalidates subsequent lines, re-tokenize asynchronously
...
This can happen when inserting a quote at the top of the file. It switches all the strings to source and vice versa, throughout the file. This can be very laggy, so it's good to do it asynchronously.
2012-11-21 10:02:52 -07:00
Nathan Sobo
e92d9c5c9d
Reorganize TokenizedBuffer spec
...
It's going to have to cover edge cases in the async tokenization, and the previous structure wasn't going to cut it.
2012-11-21 09:09:08 -07:00
Nathan Sobo
5aba8596a9
Make tokenization synchronous in all specs
...
Disabled some specs that need to make it asynchronous again… will deal with those soon.
2012-11-21 08:22:13 -07:00
Corey Johnson & Nathan Sobo
53c7ccb297
WIP: Fleshing out specs for async tokenization
2012-11-19 17:11:20 -07:00
Corey Johnson & Nathan Sobo
e52dbb682e
WIP: Perform tokenization in chunks when edit session is shown
2012-11-19 16:50:49 -07:00
Nathan Sobo
a441ddec7c
Make TokenizedBuffer
emit row-oriented change events
2012-11-16 08:57:59 -07:00
Corey Johnson & Nathan Sobo
8184c0248b
Don't store tabLength on EditSession
2012-11-06 11:56:18 -08:00
Corey Johnson & Nathan Sobo
874af0f2bc
Eliminate reference to TokenizedBuffer on EditSession
2012-11-06 11:09:38 -08:00
Corey Johnson & Nathan Sobo
0e0f747764
TokenizedBuffer.setTabLength retokenizes the entire buffer
2012-11-06 10:44:50 -08:00
Corey Johnson & Nathan Sobo
2c14bc7ebd
Optimize breakOutAtomicTokens
2012-11-06 10:44:03 -08:00
Corey Johnson
a63f838cdb
Simplify breakOutAtomicTokens method
2012-11-06 09:39:44 -08:00
Corey Johnson
b85a95eaa1
Make leading spaces atomic (length based on tabLength)
2012-11-06 09:03:54 -08:00
Corey Johnson & Nathan Sobo
ed4c543a8d
Fix spec relying on wrong version of tab text
2012-10-26 12:21:20 -06:00
Corey Johnson & Nathan Sobo
b33bbbfc0d
Handle invisible character rendering when building HTML for lines.
...
Not during creation of tokens.
2012-10-18 11:43:17 -07:00
Corey Johnson
53534e61cf
Remove double comment
2012-10-18 11:33:19 -07:00
Corey Johnson
22e009a999
Set invisible values for spaces and tabs when initial tokenization occurs.
...
Also break whitespace into its own token just like tabs.
2012-10-18 11:33:19 -07:00
Corey Johnson
e2a917fcf3
Change tabText to tabLength
2012-10-18 11:31:39 -07:00
Corey Johnson
6171ea33e1
Add support for TextMate grammars with newlines in their regexes
2012-10-16 15:58:11 -07:00
Kevin Sawicki
38802ba287
Use javscript.tmbundle commit 2f95d9ae92
...
The commit after this one breaks syntax highlighting
for the lines after a single line comment
2012-10-12 11:34:44 -07:00
Kevin Sawicki
6dc5a05f35
Expect var to have modifier class instead of type
...
This changed in the underlying JavaScript bundle
2012-10-09 17:55:21 -07:00
Corey Johnson & Nathan Sobo
12b06ddf0c
Get spec suite running (lots of failures)
2012-08-27 17:36:36 -05:00
Nathan Sobo
c2c8724ad0
Initial commit
2012-08-10 13:32:19 -06:00
Corey Johnson & Nathan Sobo
0a97cb0590
Tokenized buffer uses TextMate grammar
2012-08-02 10:05:09 -07:00
Corey Johnson & Nathan Sobo
b50b8eacca
wip: hooking up tokenized buffer to textmate grammars
2012-08-01 17:54:08 -07:00
Nathan Sobo
3516dea210
Introduce LanguageMode wrapper for Ace modes as a foundation of our own modes
...
LanguageMode is the central point for all language-specific behavior associated with an EditSession. There is one LanguageMode instance per EditSession. LanguageMode has access to the EditSession and its TokenizedBuffer, and in reverse the EditSession, DisplayBuffer, and TokenizedBuffer also make use of LanguageMode. This is a bit incestuous, but I think it's okay because you can think of LanguageMode as a swappable strategy object that governs language-specific aspects of that constellation of objects.
2012-07-27 12:30:06 -06:00