Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

Commit

Permalink
Merge pull request #16290 from atom/mb-rename-tokenized-buffer
Browse files Browse the repository at this point in the history
Rename TokenizedBuffer to TextMateLanguageMode
  • Loading branch information
Max Brunsfeld committed Nov 29, 2017
2 parents 31e20d3 + 607ed74 commit c318d01
Show file tree
Hide file tree
Showing 12 changed files with 1,187 additions and 1,194 deletions.
6 changes: 3 additions & 3 deletions spec/spec-helper.coffee
Expand Up @@ -11,7 +11,7 @@ FindParentDir = require 'find-parent-dir'

TextEditor = require '../src/text-editor'
TextEditorElement = require '../src/text-editor-element'
TokenizedBuffer = require '../src/tokenized-buffer'
TextMateLanguageMode = require '../src/text-mate-language-mode'
clipboard = require '../src/safe-clipboard'

jasmineStyle = document.createElement('style')
Expand Down Expand Up @@ -100,8 +100,8 @@ beforeEach ->
spyOn(TextEditor.prototype, "shouldPromptToSave").andReturn false

# make tokenization synchronous
TokenizedBuffer.prototype.chunkSize = Infinity
spyOn(TokenizedBuffer.prototype, "tokenizeInBackground").andCallFake -> @tokenizeNextChunk()
TextMateLanguageMode.prototype.chunkSize = Infinity
spyOn(TextMateLanguageMode.prototype, "tokenizeInBackground").andCallFake -> @tokenizeNextChunk()

# Without this spy, TextEditor.onDidTokenize callbacks would not be called
# after the buffer's language mode changed, because by the time the editor
Expand Down
10 changes: 5 additions & 5 deletions spec/text-editor-registry-spec.js
Expand Up @@ -230,15 +230,15 @@ describe('TextEditorRegistry', function () {
hello;
}
`)
editor.tokenizedBuffer.retokenizeLines()
editor.getBuffer().getLanguageMode().retokenizeLines()
expect(editor.getSoftTabs()).toBe(true)

editor.setText(dedent`
{
hello;
}
`)
editor.tokenizedBuffer.retokenizeLines()
editor.getBuffer().getLanguageMode().retokenizeLines()
expect(editor.getSoftTabs()).toBe(false)

editor.setText(dedent`
Expand All @@ -249,7 +249,7 @@ describe('TextEditorRegistry', function () {
${'\t'}hello;
}
` + editor.getText())
editor.tokenizedBuffer.retokenizeLines()
editor.getBuffer().getLanguageMode().retokenizeLines()
expect(editor.getSoftTabs()).toBe(false)

editor.setText(dedent`
Expand All @@ -262,7 +262,7 @@ describe('TextEditorRegistry', function () {
}
`)

editor.tokenizedBuffer.retokenizeLines()
editor.getBuffer().getLanguageMode().retokenizeLines()
expect(editor.getSoftTabs()).toBe(false)

editor.setText(dedent`
Expand All @@ -274,7 +274,7 @@ describe('TextEditorRegistry', function () {
hello;
}
`)
editor.tokenizedBuffer.retokenizeLines()
editor.getBuffer().getLanguageMode().retokenizeLines()
expect(editor.getSoftTabs()).toBe(true)
})
})
Expand Down
4 changes: 2 additions & 2 deletions spec/text-editor-spec.js
Expand Up @@ -7,7 +7,7 @@ const dedent = require('dedent')
const clipboard = require('../src/safe-clipboard')
const TextEditor = require('../src/text-editor')
const TextBuffer = require('text-buffer')
const TokenizedBuffer = require('../src/tokenized-buffer')
const TextMateLanguageMode = require('../src/text-mate-language-mode')

describe('TextEditor', () => {
let buffer, editor, lineLengths
Expand Down Expand Up @@ -5610,7 +5610,7 @@ describe('TextEditor', () => {
it('notifies onDidTokenize observers when retokenization is finished', async () => {
// Exercise the full `tokenizeInBackground` code path, which bails out early if
// `.setVisible` has not been called with `true`.
jasmine.unspy(TokenizedBuffer.prototype, 'tokenizeInBackground')
jasmine.unspy(TextMateLanguageMode.prototype, 'tokenizeInBackground')
jasmine.attachToDOM(editor.getElement())

const events = []
Expand Down

0 comments on commit c318d01

Please sign in to comment.