From 6c4eb7439a76c4f422bb3e61f9829f5405f0863b Mon Sep 17 00:00:00 2001 From: Matt Colyer Date: Wed, 18 Dec 2013 12:11:27 -0800 Subject: [PATCH 01/68] Turn up debugging for atom-shell downloads --- script/cibuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/cibuild b/script/cibuild index f79fe7f40..627e5967a 100755 --- a/script/cibuild +++ b/script/cibuild @@ -33,7 +33,7 @@ cp.safeExec.bind(global, 'node script/bootstrap', function(error) { var tasks = [ require('rimraf').bind(global, path.join(homeDir, '.atom')), cp.safeExec.bind(global, 'git clean -dff'), - cp.safeExec.bind(global, gruntPath + ' ci --stack --no-color'), + cp.safeExec.bind(global, gruntPath + ' ci --stack --no-color --verbose'), ] if (process.platform === 'darwin') { tasks.push(cp.safeExec.bind(global, 'node_modules/.bin/coffee script/upload-release')) From c9aa082e63a1854008c77e6bbad97d65d8a0c7df Mon Sep 17 00:00:00 2001 From: Matt Colyer Date: Wed, 18 Dec 2013 14:22:17 -0800 Subject: [PATCH 02/68] Revert "Turn up debugging for atom-shell downloads" This reverts commit 6c4eb7439a76c4f422bb3e61f9829f5405f0863b. --- script/cibuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/cibuild b/script/cibuild index 627e5967a..f79fe7f40 100755 --- a/script/cibuild +++ b/script/cibuild @@ -33,7 +33,7 @@ cp.safeExec.bind(global, 'node script/bootstrap', function(error) { var tasks = [ require('rimraf').bind(global, path.join(homeDir, '.atom')), cp.safeExec.bind(global, 'git clean -dff'), - cp.safeExec.bind(global, gruntPath + ' ci --stack --no-color --verbose'), + cp.safeExec.bind(global, gruntPath + ' ci --stack --no-color'), ] if (process.platform === 'darwin') { tasks.push(cp.safeExec.bind(global, 'node_modules/.bin/coffee script/upload-release')) From bda8397d3d6ac226697bdcb90369bacb0291270e Mon Sep 17 00:00:00 2001 From: Matt Colyer Date: Wed, 18 Dec 2013 14:23:28 -0800 Subject: [PATCH 03/68] Revert "Switch to git for cloning apm" This reverts commit fd929364d1401c68b069c57179cc7c3702e264e5. --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 363ee63b2..e4335ef79 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "vendor/apm"] path = vendor/apm - url = git@github.com:atom/apm.git + url = https://github.com/atom/apm.git From 171c3e018b590ca65dae275210f4c526e1eee962 Mon Sep 17 00:00:00 2001 From: Matt Colyer Date: Wed, 18 Dec 2013 14:57:13 -0800 Subject: [PATCH 04/68] Attempt to fix truncated log messages --- spec/jasmine-helper.coffee | 1 + 1 file changed, 1 insertion(+) diff --git a/spec/jasmine-helper.coffee b/spec/jasmine-helper.coffee index 88249e867..613e07604 100644 --- a/spec/jasmine-helper.coffee +++ b/spec/jasmine-helper.coffee @@ -25,6 +25,7 @@ module.exports.runSpecSuite = (specSuite, logFile, logErrors=true) -> timeReporter.logLongestSuites 10, (line) -> process.stdout.write("#{line}\n") process.stdout.write('\n') timeReporter.logLongestSpecs 10, (line) -> process.stdout.write("#{line}\n") + fs.closeSync(logStream) atom.exit(runner.results().failedCount > 0 ? 1 : 0) else AtomReporter = require './atom-reporter' From 91d1c2914ee1fca6e14d202318ef29cde85166af Mon Sep 17 00:00:00 2001 From: Matt Colyer Date: Wed, 18 Dec 2013 15:12:30 -0800 Subject: [PATCH 05/68] Write to stderr instead, for quicker flushing --- tasks/spec-task.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/spec-task.coffee b/tasks/spec-task.coffee index 8123dad3d..13ef31852 100644 --- a/tasks/spec-task.coffee +++ b/tasks/spec-task.coffee @@ -39,7 +39,7 @@ module.exports = (grunt) -> grunt.verbose.writeln "Launching #{path.basename(packagePath)} specs." spawn options, (error, results, code) -> if process.platform is 'win32' - process.stdout.write(fs.readFileSync(path.join(packagePath, 'ci.log'))) + process.stderr.write(fs.readFileSync(path.join(packagePath, 'ci.log'))) fs.unlinkSync(path.join(packagePath, 'ci.log')) failedPackages.push path.basename(packagePath) if error @@ -77,7 +77,7 @@ module.exports = (grunt) -> spawn options, (error, results, code) -> if process.platform is 'win32' - process.stdout.write(fs.readFileSync('ci.log')) + process.stderr.write(fs.readFileSync('ci.log')) fs.unlinkSync('ci.log') else # TODO: Restore concurrency on Windows From 8597951f0c1148a8fdc045b8b27f8d362283102f Mon Sep 17 00:00:00 2001 From: Matt Colyer Date: Wed, 18 Dec 2013 15:24:18 -0800 Subject: [PATCH 06/68] Make sure logStream exists --- spec/jasmine-helper.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/jasmine-helper.coffee b/spec/jasmine-helper.coffee index 613e07604..2e9cfae50 100644 --- a/spec/jasmine-helper.coffee +++ b/spec/jasmine-helper.coffee @@ -25,7 +25,7 @@ module.exports.runSpecSuite = (specSuite, logFile, logErrors=true) -> timeReporter.logLongestSuites 10, (line) -> process.stdout.write("#{line}\n") process.stdout.write('\n') timeReporter.logLongestSpecs 10, (line) -> process.stdout.write("#{line}\n") - fs.closeSync(logStream) + fs.closeSync(logStream) if logStream? atom.exit(runner.results().failedCount > 0 ? 1 : 0) else AtomReporter = require './atom-reporter' From 9c7747efbfe63de6807703eba443711174b1263d Mon Sep 17 00:00:00 2001 From: Matt Colyer Date: Wed, 18 Dec 2013 16:38:03 -0800 Subject: [PATCH 07/68] Don't close ci output, as it's hanging --- tasks/spec-task.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/spec-task.coffee b/tasks/spec-task.coffee index 13ef31852..522c65b59 100644 --- a/tasks/spec-task.coffee +++ b/tasks/spec-task.coffee @@ -40,7 +40,7 @@ module.exports = (grunt) -> spawn options, (error, results, code) -> if process.platform is 'win32' process.stderr.write(fs.readFileSync(path.join(packagePath, 'ci.log'))) - fs.unlinkSync(path.join(packagePath, 'ci.log')) + #fs.unlinkSync(path.join(packagePath, 'ci.log')) failedPackages.push path.basename(packagePath) if error callback() @@ -78,7 +78,7 @@ module.exports = (grunt) -> spawn options, (error, results, code) -> if process.platform is 'win32' process.stderr.write(fs.readFileSync('ci.log')) - fs.unlinkSync('ci.log') + #fs.unlinkSync('ci.log') else # TODO: Restore concurrency on Windows packageSpecQueue.concurrency = 2 From 6736b6af3e0d70f43ec7ca9a7031f8726e2b23e4 Mon Sep 17 00:00:00 2001 From: Matt Colyer Date: Wed, 18 Dec 2013 16:38:14 -0800 Subject: [PATCH 08/68] Don't remove ci.log files for debugging --- spec/jasmine-helper.coffee | 1 - 1 file changed, 1 deletion(-) diff --git a/spec/jasmine-helper.coffee b/spec/jasmine-helper.coffee index 2e9cfae50..88249e867 100644 --- a/spec/jasmine-helper.coffee +++ b/spec/jasmine-helper.coffee @@ -25,7 +25,6 @@ module.exports.runSpecSuite = (specSuite, logFile, logErrors=true) -> timeReporter.logLongestSuites 10, (line) -> process.stdout.write("#{line}\n") process.stdout.write('\n') timeReporter.logLongestSpecs 10, (line) -> process.stdout.write("#{line}\n") - fs.closeSync(logStream) if logStream? atom.exit(runner.results().failedCount > 0 ? 1 : 0) else AtomReporter = require './atom-reporter' From 40630114e773bc9de9f2ba281550d4ccac0f46bb Mon Sep 17 00:00:00 2001 From: Matt Colyer Date: Wed, 18 Dec 2013 17:12:12 -0800 Subject: [PATCH 09/68] Another attempt at preventing clipping --- spec/jasmine-helper.coffee | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/spec/jasmine-helper.coffee b/spec/jasmine-helper.coffee index 88249e867..0abc17244 100644 --- a/spec/jasmine-helper.coffee +++ b/spec/jasmine-helper.coffee @@ -10,21 +10,23 @@ module.exports.runSpecSuite = (specSuite, logFile, logErrors=true) -> TimeReporter = require './time-reporter' timeReporter = new TimeReporter() - if logFile? - logStream = fs.createWriteStream(logFile, flags: 'w') - process.__defineGetter__ 'stdout', -> logStream - process.__defineGetter__ 'stderr', -> logStream + logStream = fs.openSync(logFile, 'w') if logFile? + log = (args...) -> + if logStream? + fs.writeSync(args...) + else + process.stderr.write(args...) if atom.getLoadSettings().exitWhenDone {jasmineNode} = require 'jasmine-node/lib/jasmine-node/reporter' reporter = new jasmineNode.TerminalReporter print: (args...) -> - process.stderr.write(args...) + log(args...) onComplete: (runner) -> - process.stdout.write('\n') - timeReporter.logLongestSuites 10, (line) -> process.stdout.write("#{line}\n") - process.stdout.write('\n') - timeReporter.logLongestSpecs 10, (line) -> process.stdout.write("#{line}\n") + log('\n') + timeReporter.logLongestSuites 10, (line) -> log("#{line}\n") + log('\n') + timeReporter.logLongestSpecs 10, (line) -> log("#{line}\n") atom.exit(runner.results().failedCount > 0 ? 1 : 0) else AtomReporter = require './atom-reporter' From 1da6bca2ae47c1b5020bd7fe3bd00911fed8e736 Mon Sep 17 00:00:00 2001 From: Matt Colyer Date: Wed, 18 Dec 2013 18:35:20 -0800 Subject: [PATCH 10/68] Properly use writeSync --- spec/jasmine-helper.coffee | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/spec/jasmine-helper.coffee b/spec/jasmine-helper.coffee index 0abc17244..c57a5dc37 100644 --- a/spec/jasmine-helper.coffee +++ b/spec/jasmine-helper.coffee @@ -11,22 +11,23 @@ module.exports.runSpecSuite = (specSuite, logFile, logErrors=true) -> timeReporter = new TimeReporter() logStream = fs.openSync(logFile, 'w') if logFile? - log = (args...) -> + log = (str) -> if logStream? - fs.writeSync(args...) + fs.writeSync(logStream, str) else - process.stderr.write(args...) + process.stderr.write(str) if atom.getLoadSettings().exitWhenDone {jasmineNode} = require 'jasmine-node/lib/jasmine-node/reporter' reporter = new jasmineNode.TerminalReporter - print: (args...) -> - log(args...) + print: (str) -> + log(str) onComplete: (runner) -> log('\n') timeReporter.logLongestSuites 10, (line) -> log("#{line}\n") log('\n') timeReporter.logLongestSpecs 10, (line) -> log("#{line}\n") + fs.closeSync(logStream) if logStream? atom.exit(runner.results().failedCount > 0 ? 1 : 0) else AtomReporter = require './atom-reporter' From fd6e5e7a13153e0b3e069fef828d7853888ec587 Mon Sep 17 00:00:00 2001 From: Matt Colyer Date: Wed, 18 Dec 2013 18:36:40 -0800 Subject: [PATCH 11/68] Don't run package specs --- tasks/spec-task.coffee | 1 + 1 file changed, 1 insertion(+) diff --git a/tasks/spec-task.coffee b/tasks/spec-task.coffee index 522c65b59..dd9a524a2 100644 --- a/tasks/spec-task.coffee +++ b/tasks/spec-task.coffee @@ -47,6 +47,7 @@ module.exports = (grunt) -> modulesDirectory = path.resolve('node_modules') for packageDirectory in fs.readdirSync(modulesDirectory) + return callback(null, []) packagePath = path.join(modulesDirectory, packageDirectory) continue unless grunt.file.isDir(path.join(packagePath, 'spec')) continue unless isAtomPackage(packagePath) From d8374eb2518b87b18b0bf9b64dd43f289fcee9e4 Mon Sep 17 00:00:00 2001 From: Matt Colyer Date: Wed, 18 Dec 2013 18:45:17 -0800 Subject: [PATCH 12/68] Revert "Don't run package specs" This reverts commit fd6e5e7a13153e0b3e069fef828d7853888ec587. --- tasks/spec-task.coffee | 1 - 1 file changed, 1 deletion(-) diff --git a/tasks/spec-task.coffee b/tasks/spec-task.coffee index dd9a524a2..522c65b59 100644 --- a/tasks/spec-task.coffee +++ b/tasks/spec-task.coffee @@ -47,7 +47,6 @@ module.exports = (grunt) -> modulesDirectory = path.resolve('node_modules') for packageDirectory in fs.readdirSync(modulesDirectory) - return callback(null, []) packagePath = path.join(modulesDirectory, packageDirectory) continue unless grunt.file.isDir(path.join(packagePath, 'spec')) continue unless isAtomPackage(packagePath) From 9e3648c22f138c36086733203c6aa2d0f40631d9 Mon Sep 17 00:00:00 2001 From: Matt Colyer Date: Wed, 18 Dec 2013 18:45:41 -0800 Subject: [PATCH 13/68] Remove ci.log files --- tasks/spec-task.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/spec-task.coffee b/tasks/spec-task.coffee index 522c65b59..13ef31852 100644 --- a/tasks/spec-task.coffee +++ b/tasks/spec-task.coffee @@ -40,7 +40,7 @@ module.exports = (grunt) -> spawn options, (error, results, code) -> if process.platform is 'win32' process.stderr.write(fs.readFileSync(path.join(packagePath, 'ci.log'))) - #fs.unlinkSync(path.join(packagePath, 'ci.log')) + fs.unlinkSync(path.join(packagePath, 'ci.log')) failedPackages.push path.basename(packagePath) if error callback() @@ -78,7 +78,7 @@ module.exports = (grunt) -> spawn options, (error, results, code) -> if process.platform is 'win32' process.stderr.write(fs.readFileSync('ci.log')) - #fs.unlinkSync('ci.log') + fs.unlinkSync('ci.log') else # TODO: Restore concurrency on Windows packageSpecQueue.concurrency = 2 From fa18a5cb33f9a27a13f7b42e29b89a0201f4d3ee Mon Sep 17 00:00:00 2001 From: Matt Colyer Date: Thu, 19 Dec 2013 10:36:19 -0800 Subject: [PATCH 14/68] Parallelize package specs --- tasks/spec-task.coffee | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/tasks/spec-task.coffee b/tasks/spec-task.coffee index 13ef31852..89fcd7089 100644 --- a/tasks/spec-task.coffee +++ b/tasks/spec-task.coffee @@ -52,9 +52,7 @@ module.exports = (grunt) -> continue unless isAtomPackage(packagePath) packageSpecQueue.push(packagePath) - # TODO: Restore concurrency on Windows - packageSpecQueue.concurrency = 1 unless process.platform is 'win32' - + packageSpecQueue.concurrency = 1 packageSpecQueue.drain = -> callback(null, failedPackages) runCoreSpecs = (callback) -> @@ -79,10 +77,8 @@ module.exports = (grunt) -> if process.platform is 'win32' process.stderr.write(fs.readFileSync('ci.log')) fs.unlinkSync('ci.log') - else - # TODO: Restore concurrency on Windows - packageSpecQueue.concurrency = 2 + packageSpecQueue.concurrency = 2 callback(null, error) grunt.registerTask 'run-specs', 'Run the specs', -> From 7cb1ea038ce6192890757a65921d0fe281370fec Mon Sep 17 00:00:00 2001 From: Matt Colyer Date: Thu, 19 Dec 2013 10:56:18 -0800 Subject: [PATCH 15/68] Parallelize core specs as well --- tasks/spec-task.coffee | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/tasks/spec-task.coffee b/tasks/spec-task.coffee index 89fcd7089..7750d08c4 100644 --- a/tasks/spec-task.coffee +++ b/tasks/spec-task.coffee @@ -85,14 +85,7 @@ module.exports = (grunt) -> done = @async() startTime = Date.now() - # TODO: This should really be parallel on both platforms, however our - # fixtures step on each others toes currently. - if process.platform is 'darwin' - method = async.parallel - else if process.platform is 'win32' - method = async.series - - method [runCoreSpecs, runPackageSpecs], (error, results) -> + async.parallel [runCoreSpecs, runPackageSpecs], (error, results) -> [coreSpecFailed, failedPackages] = results elapsedTime = Math.round((Date.now() - startTime) / 100) / 10 grunt.verbose.writeln("Total spec time: #{elapsedTime}s") From a76cda45640f07251714e308688ebddd6e834f20 Mon Sep 17 00:00:00 2001 From: Matt Colyer Date: Thu, 19 Dec 2013 11:28:42 -0800 Subject: [PATCH 16/68] Revert "Parallelize core specs as well" This reverts commit 7cb1ea038ce6192890757a65921d0fe281370fec. --- tasks/spec-task.coffee | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tasks/spec-task.coffee b/tasks/spec-task.coffee index 7750d08c4..89fcd7089 100644 --- a/tasks/spec-task.coffee +++ b/tasks/spec-task.coffee @@ -85,7 +85,14 @@ module.exports = (grunt) -> done = @async() startTime = Date.now() - async.parallel [runCoreSpecs, runPackageSpecs], (error, results) -> + # TODO: This should really be parallel on both platforms, however our + # fixtures step on each others toes currently. + if process.platform is 'darwin' + method = async.parallel + else if process.platform is 'win32' + method = async.series + + method [runCoreSpecs, runPackageSpecs], (error, results) -> [coreSpecFailed, failedPackages] = results elapsedTime = Math.round((Date.now() - startTime) / 100) / 10 grunt.verbose.writeln("Total spec time: #{elapsedTime}s") From 91778cb566550031dcf34ee4ab3133c6387b4e7d Mon Sep 17 00:00:00 2001 From: Matt Colyer Date: Thu, 19 Dec 2013 11:29:32 -0800 Subject: [PATCH 17/68] Revert "Parallelize package specs" This reverts commit fa18a5cb33f9a27a13f7b42e29b89a0201f4d3ee. --- tasks/spec-task.coffee | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tasks/spec-task.coffee b/tasks/spec-task.coffee index 89fcd7089..13ef31852 100644 --- a/tasks/spec-task.coffee +++ b/tasks/spec-task.coffee @@ -52,7 +52,9 @@ module.exports = (grunt) -> continue unless isAtomPackage(packagePath) packageSpecQueue.push(packagePath) - packageSpecQueue.concurrency = 1 + # TODO: Restore concurrency on Windows + packageSpecQueue.concurrency = 1 unless process.platform is 'win32' + packageSpecQueue.drain = -> callback(null, failedPackages) runCoreSpecs = (callback) -> @@ -77,8 +79,10 @@ module.exports = (grunt) -> if process.platform is 'win32' process.stderr.write(fs.readFileSync('ci.log')) fs.unlinkSync('ci.log') + else + # TODO: Restore concurrency on Windows + packageSpecQueue.concurrency = 2 - packageSpecQueue.concurrency = 2 callback(null, error) grunt.registerTask 'run-specs', 'Run the specs', -> From 2ad9fb52aeacb5a8e974777d8c357bb1f630b9f2 Mon Sep 17 00:00:00 2001 From: Matt Colyer Date: Thu, 19 Dec 2013 11:33:42 -0800 Subject: [PATCH 18/68] Restore package concurrency --- tasks/spec-task.coffee | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/tasks/spec-task.coffee b/tasks/spec-task.coffee index 13ef31852..4237bfd06 100644 --- a/tasks/spec-task.coffee +++ b/tasks/spec-task.coffee @@ -52,9 +52,7 @@ module.exports = (grunt) -> continue unless isAtomPackage(packagePath) packageSpecQueue.push(packagePath) - # TODO: Restore concurrency on Windows - packageSpecQueue.concurrency = 1 unless process.platform is 'win32' - + packageSpecQueue.concurrency = if process.platform is 'win32' then 2 else 1 packageSpecQueue.drain = -> callback(null, failedPackages) runCoreSpecs = (callback) -> @@ -79,10 +77,8 @@ module.exports = (grunt) -> if process.platform is 'win32' process.stderr.write(fs.readFileSync('ci.log')) fs.unlinkSync('ci.log') - else - # TODO: Restore concurrency on Windows - packageSpecQueue.concurrency = 2 + packageSpecQueue.concurrency = 2 callback(null, error) grunt.registerTask 'run-specs', 'Run the specs', -> From 8fb729d0003a3f8a702670fed1a9e9f49c4aab83 Mon Sep 17 00:00:00 2001 From: Matt Colyer Date: Thu, 19 Dec 2013 11:43:28 -0800 Subject: [PATCH 19/68] Check for existence --- tasks/spec-task.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/spec-task.coffee b/tasks/spec-task.coffee index 4237bfd06..5b48d37ad 100644 --- a/tasks/spec-task.coffee +++ b/tasks/spec-task.coffee @@ -78,7 +78,7 @@ module.exports = (grunt) -> process.stderr.write(fs.readFileSync('ci.log')) fs.unlinkSync('ci.log') - packageSpecQueue.concurrency = 2 + packageSpecQueue.concurrency = 2 if packageSpecQueue? callback(null, error) grunt.registerTask 'run-specs', 'Run the specs', -> From 1d70e12594e25f4ba8ae85cc39d4b3fb9be3b11f Mon Sep 17 00:00:00 2001 From: Matt Colyer Date: Thu, 19 Dec 2013 12:02:12 -0800 Subject: [PATCH 20/68] Revert "Check for existence" This reverts commit 8fb729d0003a3f8a702670fed1a9e9f49c4aab83. --- tasks/spec-task.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/spec-task.coffee b/tasks/spec-task.coffee index 5b48d37ad..4237bfd06 100644 --- a/tasks/spec-task.coffee +++ b/tasks/spec-task.coffee @@ -78,7 +78,7 @@ module.exports = (grunt) -> process.stderr.write(fs.readFileSync('ci.log')) fs.unlinkSync('ci.log') - packageSpecQueue.concurrency = 2 if packageSpecQueue? + packageSpecQueue.concurrency = 2 callback(null, error) grunt.registerTask 'run-specs', 'Run the specs', -> From 2d17ffc792edc383e39a8d673109cdc629100b7e Mon Sep 17 00:00:00 2001 From: Matt Colyer Date: Thu, 19 Dec 2013 12:02:18 -0800 Subject: [PATCH 21/68] Revert "Restore package concurrency" This reverts commit 2ad9fb52aeacb5a8e974777d8c357bb1f630b9f2. --- tasks/spec-task.coffee | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tasks/spec-task.coffee b/tasks/spec-task.coffee index 4237bfd06..13ef31852 100644 --- a/tasks/spec-task.coffee +++ b/tasks/spec-task.coffee @@ -52,7 +52,9 @@ module.exports = (grunt) -> continue unless isAtomPackage(packagePath) packageSpecQueue.push(packagePath) - packageSpecQueue.concurrency = if process.platform is 'win32' then 2 else 1 + # TODO: Restore concurrency on Windows + packageSpecQueue.concurrency = 1 unless process.platform is 'win32' + packageSpecQueue.drain = -> callback(null, failedPackages) runCoreSpecs = (callback) -> @@ -77,8 +79,10 @@ module.exports = (grunt) -> if process.platform is 'win32' process.stderr.write(fs.readFileSync('ci.log')) fs.unlinkSync('ci.log') + else + # TODO: Restore concurrency on Windows + packageSpecQueue.concurrency = 2 - packageSpecQueue.concurrency = 2 callback(null, error) grunt.registerTask 'run-specs', 'Run the specs', -> From aba1900d13328f3cf8ec068be42a08e0defa3c2a Mon Sep 17 00:00:00 2001 From: Matt Colyer Date: Fri, 20 Dec 2013 11:58:38 -0600 Subject: [PATCH 22/68] Upgrade link@0.12.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 926102c09..18fcdf8e3 100644 --- a/package.json +++ b/package.json @@ -102,7 +102,7 @@ "grammar-selector": "0.13.0", "image-view": "0.11.0", "keybinding-resolver": "0.6.0", - "link": "0.11.0", + "link": "0.12.0", "markdown-preview": "0.22.0", "metrics": "0.20.0", "package-generator": "0.23.0", From e14019e2dde7a054211530464efa5af3847a2e2d Mon Sep 17 00:00:00 2001 From: Matt Colyer Date: Fri, 20 Dec 2013 12:25:40 -0600 Subject: [PATCH 23/68] Upgrade settings-view@0.53.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index dcf68926a..609ac3313 100644 --- a/package.json +++ b/package.json @@ -107,7 +107,7 @@ "metrics": "0.20.0", "package-generator": "0.23.0", "release-notes": "0.15.0", - "settings-view": "0.52.0", + "settings-view": "0.53.0", "snippets": "0.17.0", "spell-check": "0.17.0", "status-bar": "0.27.0", From dd2c6d2f24072b6abb74f1b5fce9d9b1941b76fc Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 30 Dec 2013 19:13:52 -0700 Subject: [PATCH 24/68] Eliminate TextBuffer's dependence on telepath Atom's TextBuffer now relies on the text-buffer npm for its core functionality. --- package.json | 2 + spec/text-buffer-spec.coffee | 22 ++---- src/cursor-view.coffee | 3 - src/display-buffer-marker.coffee | 9 --- src/editor-view.coffee | 4 +- src/editor.coffee | 55 +------------- src/fold.coffee | 1 + src/git.coffee | 2 +- src/project.coffee | 27 ++++--- src/selection-view.coffee | 3 - src/selection.coffee | 8 -- src/text-buffer.coffee | 123 +++++++++++++++++-------------- 12 files changed, 101 insertions(+), 158 deletions(-) diff --git a/package.json b/package.json index 41e637599..488d07921 100644 --- a/package.json +++ b/package.json @@ -34,6 +34,7 @@ "mkdirp": "0.3.5", "keytar": "0.13.0", "less-cache": "0.10.0", + "nostalgia": "0.2.0", "nslog": "0.1.0", "oniguruma": "0.24.0", "optimist": "0.4.0", @@ -46,6 +47,7 @@ "space-pen": "2.0.2", "telepath": "0.80.0", "temp": "0.5.0", + "text-buffer": "0.2.0", "underscore-plus": "0.6.1" }, "devDependencies": { diff --git a/spec/text-buffer-spec.coffee b/spec/text-buffer-spec.coffee index 502c1af39..1d1d75cd8 100644 --- a/spec/text-buffer-spec.coffee +++ b/spec/text-buffer-spec.coffee @@ -971,7 +971,7 @@ describe 'TextBuffer', -> expect(buffer.getText()).toBe "\ninitialtexthello\n1\n2\n" describe "serialization", -> - [buffer2, project2] = [] + buffer2 = null beforeEach -> buffer.destroy() @@ -981,13 +981,12 @@ describe 'TextBuffer', -> buffer = atom.project.bufferForPathSync(filePath).retain() afterEach -> - buffer2?.release() - project2?.destroy() + buffer2?.destroy() describe "when the serialized buffer had no unsaved changes", -> it "loads the current contents of the file at the serialized path", -> expect(buffer.isModified()).toBeFalsy() - buffer2 = buffer.testPersistence() + buffer2 = buffer.testSerialization() waitsForPromise -> buffer2.load() @@ -1003,8 +1002,7 @@ describe 'TextBuffer', -> buffer.setText("BUFFER CHANGE") fs.writeFileSync(filePath, "DISK CHANGE") - project2 = atom.project.testPersistence() - buffer2 = project2.getBuffers()[0] + buffer2 = buffer.testSerialization() waitsFor -> buffer2.cachedDiskContents @@ -1020,9 +1018,7 @@ describe 'TextBuffer', -> buffer.setText("abc") buffer.retain() - buffer.getState().serializeForPersistence() - project2 = atom.project.testPersistence() - buffer2 = project2.getBuffers()[0] + buffer2 = buffer.testSerialization() waitsForPromise -> buffer2.load() @@ -1036,15 +1032,11 @@ describe 'TextBuffer', -> describe "when the serialized buffer was unsaved and had no path", -> it "restores the previous unsaved state of the buffer", -> - buffer.release() + buffer.destroy() buffer = atom.project.bufferForPathSync() buffer.setText("abc") - state = buffer.getState().clone() - expect(state.get('path')).toBeUndefined() - expect(state.getObject('text')).toBe 'abc' - - buffer2 = atom.project.addBuffer(new TextBuffer(state)) + buffer2 = buffer.testSerialization() expect(buffer2.getPath()).toBeUndefined() expect(buffer2.getText()).toBe("abc") diff --git a/src/cursor-view.coffee b/src/cursor-view.coffee index 1af9e2204..6eca35342 100644 --- a/src/cursor-view.coffee +++ b/src/cursor-view.coffee @@ -30,9 +30,6 @@ class CursorView extends View @cursor.on 'destroyed.cursor-view', => @needsRemoval = true - if @cursor.marker.isRemote() - @addClass("site-#{@cursor.marker.getOriginSiteId()}") - beforeRemove: -> @editorView.removeCursorView(this) @cursor.off('.cursor-view') diff --git a/src/display-buffer-marker.coffee b/src/display-buffer-marker.coffee index 1420cadbc..dbc1bc677 100644 --- a/src/display-buffer-marker.coffee +++ b/src/display-buffer-marker.coffee @@ -144,15 +144,6 @@ class DisplayBufferMarker isDestroyed: -> @bufferMarker.isDestroyed() - getOriginSiteId: -> - @bufferMarker.getOriginSiteId() - - isLocal: -> - @bufferMarker.isLocal() - - isRemote: -> - @bufferMarker.isRemote() - getAttributes: -> @bufferMarker.getAttributes() diff --git a/src/editor-view.coffee b/src/editor-view.coffee index 67a5d3ce7..04a35951e 100644 --- a/src/editor-view.coffee +++ b/src/editor-view.coffee @@ -1215,8 +1215,8 @@ class EditorView extends View @scrollTop(editorScrollTop) @scrollLeft(editorScrollLeft) @setSoftWrap(@editor.getSoftWrap()) - @newCursors = @editor.getAllCursors() - @newSelections = @editor.getAllSelections() + @newCursors = @editor.getCursors() + @newSelections = @editor.getSelections() @updateDisplay(suppressAutoScroll: true) requestDisplayUpdate: -> diff --git a/src/editor.coffee b/src/editor.coffee index f0ec6dcf5..3bc0ade3f 100644 --- a/src/editor.coffee +++ b/src/editor.coffee @@ -27,11 +27,6 @@ TextMateScopeSelector = require('first-mate').ScopeSelector # atom.workspaceView.eachEditorView (editorView) -> # editorView.insertText('Hello World') # ``` -# -# ## Collaboration builtin -# -# FIXME: Describe how there are both local and remote cursors and selections and -# why that is. module.exports = class Editor extends Model @@ -47,9 +42,7 @@ class Editor extends Model buffer: null languageMode: null cursors: null - remoteCursors: null selections: null - remoteSelections: null suppressSelectionMerging: false constructor: -> @@ -64,9 +57,7 @@ class Editor extends Model return @cursors = [] - @remoteCursors = [] @selections = [] - @remoteSelections = [] unless @displayBuffer? @displayBuffer = new DisplayBuffer({@buffer, @tabLength, @softWrap}) @@ -86,7 +77,7 @@ class Editor extends Model if @initialLine position = [@initialLine, 0] else - position = _.last(@getRemoteCursors())?.getBufferPosition() ? [0, 0] + position = [0, 0] @addCursorAtBufferPosition(position) @languageMode = new LanguageMode(this, @buffer.getExtension()) @@ -825,11 +816,6 @@ class Editor extends Model hasMultipleCursors: -> @getCursors().length > 1 - # Public: Returns an Array of all {Cursor}s, including cursors representing - # remote users. - getAllCursors: -> - @getCursors().concat(@getRemoteCursors()) - # Public: Returns an Array of all local {Cursor}s. getCursors: -> new Array(@cursors...) @@ -837,9 +823,6 @@ class Editor extends Model getCursor: -> _.last(@cursors) - # Public: Returns an Array of all remove {Cursor}s. - getRemoteCursors: -> new Array(@remoteCursors...) - # Public: Adds and returns a cursor at the given screen position. addCursorAtScreenPosition: (screenPosition) -> @markScreenPosition(screenPosition, @getSelectionMarkerAttributes()) @@ -854,10 +837,7 @@ class Editor extends Model # position. addCursor: (marker) -> cursor = new Cursor(editor: this, marker: marker) - if marker.isLocal() - @cursors.push(cursor) - else - @remoteCursors.push(cursor) + @cursors.push(cursor) @emit 'cursor-added', cursor cursor @@ -878,12 +858,7 @@ class Editor extends Model @destroyFoldsIntersectingBufferRange(marker.getBufferRange()) cursor = @addCursor(marker) selection = new Selection(_.extend({editor: this, marker, cursor}, options)) - - if marker.isLocal() - @selections.push(selection) - else - @remoteSelections.push(selection) - + @selections.push(selection) selectionBufferRange = selection.getBufferRange() @mergeIntersectingSelections() if selection.destroyed @@ -941,10 +916,7 @@ class Editor extends Model # # * selection - The {Selection} to remove. removeSelection: (selection) -> - if selection.isLocal() - _.remove(@selections, selection) - else - _.remove(@remoteSelections, selection) + _.remove(@selections, selection) # Public: Clears every selection. # @@ -964,10 +936,6 @@ class Editor extends Model else false - # Public: Returns all selections, including remote selections. - getAllSelections: -> - @getSelections().concat(@getRemoteSelections()) - # Public: Gets all local selections. # # Returns an {Array} of {Selection}s. @@ -982,21 +950,12 @@ class Editor extends Model getLastSelection: -> _.last(@selections) - # Public: Returns all remote selections. - getRemoteSelections: -> new Array(@remoteSelections...) - # Public: Gets all local selections, ordered by their position in the buffer. # # Returns an {Array} of {Selection}s. getSelectionsOrderedByBufferPosition: -> @getSelections().sort (a, b) -> a.compare(b) - # Public: Gets all remote selections, ordered by their position in the buffer. - # - # Returns an {Array} of {Selection}s. - getRemoteSelectionsOrderedByBufferPosition: -> - @getRemoteSelections().sort (a, b) -> a.compare(b) - # Public: Gets the very last local selection in the buffer. # # Returns a {Selection}. @@ -1066,12 +1025,6 @@ class Editor extends Model getSelectedBufferRanges: -> selection.getBufferRange() for selection in @getSelectionsOrderedByBufferPosition() - # Public: Gets an Array of buffer {Range}s of all the remote {Selection}s. - # - # Sorted by their position in the file itself. - getRemoteSelectedBufferRanges: -> - selection.getBufferRange() for selection in @getRemoteSelectionsOrderedByBufferPosition() - # Public: Returns the selected text of the most recently added local {Selection}. getSelectedText: -> @getLastSelection().getText() diff --git a/src/fold.coffee b/src/fold.coffee index 07ce988ec..ba03126e3 100644 --- a/src/fold.coffee +++ b/src/fold.coffee @@ -38,6 +38,7 @@ class Fold getBufferRange: ({includeNewline}={}) -> range = @marker.getRange() if includeNewline + range = range.copy() range.end.row++ range.end.column = 0 range diff --git a/src/git.coffee b/src/git.coffee index 0137a6b6d..a88d0618f 100644 --- a/src/git.coffee +++ b/src/git.coffee @@ -71,7 +71,7 @@ class Git @refreshStatus() if @project? - @subscribe @project.buffers.onEach (buffer) => @subscribeToBuffer(buffer) + @subscribe @project.eachBuffer (buffer) => @subscribeToBuffer(buffer) # Private: Subscribes to buffer events. subscribeToBuffer: (buffer) -> diff --git a/src/project.coffee b/src/project.coffee index 49effe0bb..01aea45f9 100644 --- a/src/project.coffee +++ b/src/project.coffee @@ -20,7 +20,6 @@ module.exports = class Project extends Model @properties - buffers: [] path: null # Public: Find the local path for the given repository URL. @@ -29,10 +28,18 @@ class Project extends Model repoName = repoName.replace(/\.git$/, '') path.join(atom.config.get('core.projectHome'), repoName) + constructor: -> + super + if @state? + @buffers = @state.get('buffers').map (state) -> atom.deserializers.deserialize(state) + # Private: Called by telepath. created: -> - for buffer in @buffers.getValues() - buffer.once 'destroyed', (buffer) => @removeBuffer(buffer) if @isAlive() + @buffers ?= [] + + for buffer in @buffers + do (buffer) => + buffer.once 'destroyed', => @removeBuffer(buffer) if @isAlive() @openers = [] @editors = [] @@ -40,6 +47,7 @@ class Project extends Model # Private: Called by telepath. willBePersisted: -> + @state.set('buffers', @buffers.map (buffer) -> buffer.serialize()) @destroyUnretainedBuffers() # Public: Register an opener for project files. @@ -177,7 +185,7 @@ class Project extends Model # # Returns an {Array} of {TextBuffer}s. getBuffers: -> - new Array(@buffers.getValues()...) + @buffers.slice() # Private: Is the buffer for the given path modified? isPathModified: (filePath) -> @@ -185,7 +193,7 @@ class Project extends Model # Private: findBufferForPath: (filePath) -> - _.find @buffers.getValues(), (buffer) -> buffer.getPath() == filePath + _.find @buffers, (buffer) -> buffer.getPath() == filePath # Private: Only to be used in specs bufferForPathSync: (filePath) -> @@ -233,10 +241,11 @@ class Project extends Model # Private: addBuffer: (buffer, options={}) -> @addBufferAtIndex(buffer, @buffers.length, options) + buffer.once 'destroyed', => @removeBuffer(buffer) # Private: addBufferAtIndex: (buffer, index, options={}) -> - buffer = @buffers.insert(index, buffer) + @buffers.splice(index, 0, buffer) buffer.once 'destroyed', => @removeBuffer(buffer) if @isAlive() @emit 'buffer-created', buffer buffer @@ -285,7 +294,7 @@ class Project extends Model task.on 'scan:paths-searched', (numberOfPathsSearched) -> options.onPathsSearched(numberOfPathsSearched) - for buffer in @buffers.getValues() when buffer.isModified() + for buffer in @getBuffers() when buffer.isModified() filePath = buffer.getPath() matches = [] buffer.scan regex, (match) -> matches.push match @@ -306,7 +315,7 @@ class Project extends Model replace: (regex, replacementText, filePaths, iterator) -> deferred = Q.defer() - openPaths = (buffer.getPath() for buffer in @buffers.getValues()) + openPaths = (buffer.getPath() for buffer in @getBuffers()) outOfProcessPaths = _.difference(filePaths, openPaths) inProcessFinished = !openPaths.length @@ -324,7 +333,7 @@ class Project extends Model task.on 'replace:path-replaced', iterator - for buffer in @buffers.getValues() + for buffer in @getBuffers() continue unless buffer.getPath() in filePaths replacements = buffer.replace(regex, replacementText, iterator) iterator({filePath: buffer.getPath(), replacements}) if replacements diff --git a/src/selection-view.coffee b/src/selection-view.coffee index 6dc301bab..a5089a0b2 100644 --- a/src/selection-view.coffee +++ b/src/selection-view.coffee @@ -18,9 +18,6 @@ class SelectionView extends View @needsRemoval = true @editorView.requestDisplayUpdate() - if @selection.marker.isRemote() - @addClass("site-#{@selection.marker.getOriginSiteId()}") - updateDisplay: -> @clearRegions() range = @getScreenRange() diff --git a/src/selection.coffee b/src/selection.coffee index 984d29849..e18e8b343 100644 --- a/src/selection.coffee +++ b/src/selection.coffee @@ -601,14 +601,6 @@ class Selection compare: (otherSelection) -> @getBufferRange().compare(otherSelection.getBufferRange()) - # Public: Returns true if it was locally created. - isLocal: -> - @marker.isLocal() - - # Public: Returns true if it was created remotely. - isRemote: -> - @marker.isRemote() - # Private: screenRangeChanged: -> screenRange = @getScreenRange() diff --git a/src/text-buffer.coffee b/src/text-buffer.coffee index 8ea770bcc..c98353f23 100644 --- a/src/text-buffer.coffee +++ b/src/text-buffer.coffee @@ -2,24 +2,24 @@ _ = require 'underscore-plus' diff = require 'diff' Q = require 'q' {P} = require 'scandal' -telepath = require 'telepath' +Serializable = require 'nostalgia' +TextBufferCore = require 'text-buffer' +{Point, Range} = TextBufferCore +{Subscriber, Emitter} = require 'emissary' File = require './file' -{Point, Range} = telepath - # Private: Represents the contents of a file. # # The `TextBuffer` is often associated with a {File}. However, this is not always # the case, as a `TextBuffer` could be an unsaved chunk of text. module.exports = -class TextBuffer extends telepath.Model - @properties - text: -> new telepath.String('', replicated: false) - filePath: null - relativePath: null - modifiedWhenLastPersisted: false - digestWhenLastPersisted: null +class TextBuffer + atom.deserializers.add(this) + + Serializable.includeInto(this) + Subscriber.includeInto(this) + Emitter.includeInto(this) stoppedChangingDelay: 300 stoppedChangingTimeout: null @@ -29,28 +29,33 @@ class TextBuffer extends telepath.Model file: null refcount: 0 - constructor: -> - super - - @loadWhenAttached = @getState()? - - # Private: Called by telepath. - created: -> + constructor: ({@core, text, filePath, @modifiedWhenLastPersisted, @digestWhenLastPersisted, loadWhenAttached}={}) -> + @core ?= new TextBufferCore(text: text ? '') @loaded = false + @modifiedWhenLastPersisted ?= false + @useSerializedText = @modifiedWhenLastPersisted != false - @subscribe @text, 'changed', @handleTextChange - @subscribe @text, 'marker-created', (marker) => @emit 'marker-created', marker - @subscribe @text, 'markers-updated', => @emit 'markers-updated' + @subscribe @core, 'changed', @handleTextChange + @subscribe @core, 'marker-created', (marker) => @emit 'marker-created', marker + @subscribe @core, 'markers-updated', => @emit 'markers-updated' - @setPath(@filePath) + @setPath(filePath) - @load() if @loadWhenAttached + @load() if loadWhenAttached - # Private: Called by telepath. - willBePersisted: -> - @modifiedWhenLastPersisted = @isModified() - @digestWhenLastPersisted = @file?.getDigest() + # Private: + serializeParams: -> + core: @core.serialize() + filePath: @getPath() + modifiedWhenLastPersisted: @isModified() + digestWhenLastPersisted: @file?.getDigest() + + # Private: + deserializeParams: (params) -> + params.loadWhenAttached = true + params.core = TextBufferCore.deserialize(params.core) + params loadSync: -> @updateCachedDiskContentsSync() @@ -66,7 +71,7 @@ class TextBuffer extends telepath.Model @emitModifiedStatusChanged(true) else @reload() - @text.clearUndoStack() + @core.clearUndoStack() this ### Internal ### @@ -74,16 +79,20 @@ class TextBuffer extends telepath.Model handleTextChange: (event) => @cachedMemoryContents = null @conflict = false if @conflict and !@isModified() - bufferChangeEvent = _.pick(event, 'oldRange', 'newRange', 'oldText', 'newText') - @emit 'changed', bufferChangeEvent + @emit 'changed', event @scheduleModifiedEvents() - destroyed: -> - unless @alreadyDestroyed + destroy: -> + unless @destroyed @cancelStoppedChangingTimeout() @file?.off() @unsubscribe() - @alreadyDestroyed = true + @destroyed = true + @emit 'destroyed' + + isAlive: -> not @destroyed + + isDestroyed: -> @destroyed isRetained: -> @refcount > 0 @@ -261,13 +270,13 @@ class TextBuffer extends telepath.Model # # Returns a {String} of the combined lines. getTextInRange: (range) -> - @text.getTextInRange(@clipRange(range)) + @core.getTextInRange(@clipRange(range)) # Gets all the lines in a file. # # Returns an {Array} of {String}s. getLines: -> - @text.getLines() + @core.getLines() # Given a row, returns the line of text. # @@ -275,7 +284,7 @@ class TextBuffer extends telepath.Model # # Returns a {String}. lineForRow: (row) -> - @text.lineForRow(row) + @core.lineForRow(row) # Given a row, returns its line ending. # @@ -283,7 +292,7 @@ class TextBuffer extends telepath.Model # # Returns a {String}, or `undefined` if `row` is the final row. lineEndingForRow: (row) -> - @text.lineEndingForRow(row) + @core.lineEndingForRow(row) suggestedLineEndingForRow: (row) -> if row is @getLastRow() @@ -297,7 +306,7 @@ class TextBuffer extends telepath.Model # # Returns a {Number}. lineLengthForRow: (row) -> - @text.lineLengthForRow(row) + @core.lineLengthForRow(row) # Given a row, returns the length of the line ending # @@ -324,13 +333,13 @@ class TextBuffer extends telepath.Model # # Returns a {Number}. getLineCount: -> - @text.getLineCount() + @core.getLineCount() # Gets the row number of the last line. # # Returns a {Number}. getLastRow: -> - @getLineCount() - 1 + @core.getLastRow() # Finds the last line in the current buffer. # @@ -346,10 +355,10 @@ class TextBuffer extends telepath.Model new Point(lastRow, @lineLengthForRow(lastRow)) characterIndexForPosition: (position) -> - @text.indexForPoint(@clipPosition(position)) + @core.offsetForPosition(@clipPosition(position)) positionForCharacterIndex: (index) -> - @text.pointForIndex(index) + @core.positionForOffset(index) # Given a row, this deletes it from the buffer. # @@ -402,7 +411,7 @@ class TextBuffer extends telepath.Model # # Returns the new, clipped {Point}. Note that this could be the same as `position` if no clipping was performed. clipPosition: (position) -> - @text.clipPosition(position) + @core.clipPosition(position) # Given a range, this clips it to a real range. # @@ -418,10 +427,10 @@ class TextBuffer extends telepath.Model new Range(@clipPosition(range.start), @clipPosition(range.end)) undo: -> - @text.undo() + @core.undo() redo: -> - @text.redo() + @core.redo() # Saves the buffer. save: -> @@ -461,15 +470,15 @@ class TextBuffer extends telepath.Model # Identifies if a buffer is empty. # # Returns a {Boolean}. - isEmpty: -> @text.isEmpty() + isEmpty: -> @core.isEmpty() # Returns all valid {StringMarker}s on the buffer. getMarkers: -> - @text.getMarkers() + @core.getMarkers() # Returns the {StringMarker} with the given id. getMarker: (id) -> - @text.getMarker(id) + @core.getMarker(id) destroyMarker: (id) -> @getMarker(id)?.destroy() @@ -478,7 +487,7 @@ class TextBuffer extends telepath.Model # # Returns a {String} marker-identifier findMarker: (attributes) -> - @text.findMarker(attributes) + @core.findMarker(attributes) # Public: Finds all markers satisfying the given attributes # @@ -489,13 +498,13 @@ class TextBuffer extends telepath.Model # # Returns an {Array} of {StringMarker}s findMarkers: (attributes) -> - @text.findMarkers(attributes) + @core.findMarkers(attributes) # Retrieves the quantity of markers in a buffer. # # Returns a {Number}. getMarkerCount: -> - @text.getMarkers().length + @core.getMarkers().length # Constructs a new marker at a given range. # @@ -509,7 +518,7 @@ class TextBuffer extends telepath.Model # # Returns a {Number} representing the new marker's ID. markRange: (range, options={}) -> - @text.markRange(range, options) + @core.markRange(range, options) # Constructs a new marker at a given position. # @@ -518,7 +527,7 @@ class TextBuffer extends telepath.Model # # Returns a {Number} representing the new marker's ID. markPosition: (position, options) -> - @text.markPosition(position, options) + @core.markPosition(position, options) # Identifies if a character sequence is within a certain range. # @@ -677,18 +686,18 @@ class TextBuffer extends telepath.Model ### Internal ### - transact: (fn) -> @text.transact fn + transact: (fn) -> @core.transact fn - beginTransaction: -> @text.beginTransaction() + beginTransaction: -> @core.beginTransaction() - commitTransaction: -> @text.commitTransaction() + commitTransaction: -> @core.commitTransaction() - abortTransaction: -> @text.abortTransaction() + abortTransaction: -> @core.abortTransaction() change: (oldRange, newText, options={}) -> oldRange = @clipRange(oldRange) newText = @normalizeLineEndings(oldRange.start.row, newText) if options.normalizeLineEndings ? true - @text.setTextInRange(oldRange, newText, options) + @core.setTextInRange(oldRange, newText, options) normalizeLineEndings: (startRow, text) -> if lineEnding = @suggestedLineEndingForRow(startRow) From 66831ce8b9113f0df404a71671b2b8847e8aba70 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Tue, 31 Dec 2013 12:46:47 -0700 Subject: [PATCH 25/68] Subclass the text-buffer npm TextBuffer --- package.json | 2 +- src/text-buffer.coffee | 92 +++++++++++++++--------------------------- 2 files changed, 33 insertions(+), 61 deletions(-) diff --git a/package.json b/package.json index 488d07921..f6caaf9c5 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "space-pen": "2.0.2", "telepath": "0.80.0", "temp": "0.5.0", - "text-buffer": "0.2.0", + "text-buffer": "0.3.0", "underscore-plus": "0.6.1" }, "devDependencies": { diff --git a/src/text-buffer.coffee b/src/text-buffer.coffee index c98353f23..b5e418bfa 100644 --- a/src/text-buffer.coffee +++ b/src/text-buffer.coffee @@ -14,7 +14,7 @@ File = require './file' # The `TextBuffer` is often associated with a {File}. However, this is not always # the case, as a `TextBuffer` could be an unsaved chunk of text. module.exports = -class TextBuffer +class TextBuffer extends TextBufferCore atom.deserializers.add(this) Serializable.includeInto(this) @@ -29,16 +29,14 @@ class TextBuffer file: null refcount: 0 - constructor: ({@core, text, filePath, @modifiedWhenLastPersisted, @digestWhenLastPersisted, loadWhenAttached}={}) -> - @core ?= new TextBufferCore(text: text ? '') + constructor: ({filePath, @modifiedWhenLastPersisted, @digestWhenLastPersisted, loadWhenAttached}={}) -> + super @loaded = false @modifiedWhenLastPersisted ?= false @useSerializedText = @modifiedWhenLastPersisted != false - @subscribe @core, 'changed', @handleTextChange - @subscribe @core, 'marker-created', (marker) => @emit 'marker-created', marker - @subscribe @core, 'markers-updated', => @emit 'markers-updated' + @subscribe this, 'changed', @handleTextChange @setPath(filePath) @@ -46,15 +44,16 @@ class TextBuffer # Private: serializeParams: -> - core: @core.serialize() - filePath: @getPath() - modifiedWhenLastPersisted: @isModified() - digestWhenLastPersisted: @file?.getDigest() + params = super + _.extend params, + filePath: @getPath() + modifiedWhenLastPersisted: @isModified() + digestWhenLastPersisted: @file?.getDigest() # Private: deserializeParams: (params) -> + params = super(params) params.loadWhenAttached = true - params.core = TextBufferCore.deserialize(params.core) params loadSync: -> @@ -71,7 +70,7 @@ class TextBuffer @emitModifiedStatusChanged(true) else @reload() - @core.clearUndoStack() + @clearUndoStack() this ### Internal ### @@ -79,7 +78,6 @@ class TextBuffer handleTextChange: (event) => @cachedMemoryContents = null @conflict = false if @conflict and !@isModified() - @emit 'changed', event @scheduleModifiedEvents() destroy: -> @@ -269,30 +267,26 @@ class TextBuffer # range - A {Range} object specifying your points of interest # # Returns a {String} of the combined lines. - getTextInRange: (range) -> - @core.getTextInRange(@clipRange(range)) + getTextInRange: (range) -> super # Gets all the lines in a file. # # Returns an {Array} of {String}s. - getLines: -> - @core.getLines() + getLines: -> super # Given a row, returns the line of text. # # row - A {Number} indicating the row. # # Returns a {String}. - lineForRow: (row) -> - @core.lineForRow(row) + lineForRow: (row) -> super # Given a row, returns its line ending. # # row - A {Number} indicating the row. # # Returns a {String}, or `undefined` if `row` is the final row. - lineEndingForRow: (row) -> - @core.lineEndingForRow(row) + lineEndingForRow: (row) -> super suggestedLineEndingForRow: (row) -> if row is @getLastRow() @@ -305,8 +299,7 @@ class TextBuffer # row - A {Number} indicating the row. # # Returns a {Number}. - lineLengthForRow: (row) -> - @core.lineLengthForRow(row) + lineLengthForRow: (row) -> super # Given a row, returns the length of the line ending # @@ -332,14 +325,12 @@ class TextBuffer # Gets the number of lines in a file. # # Returns a {Number}. - getLineCount: -> - @core.getLineCount() + getLineCount: -> super # Gets the row number of the last line. # # Returns a {Number}. - getLastRow: -> - @core.getLastRow() + getLastRow: -> super # Finds the last line in the current buffer. # @@ -354,11 +345,9 @@ class TextBuffer lastRow = @getLastRow() new Point(lastRow, @lineLengthForRow(lastRow)) - characterIndexForPosition: (position) -> - @core.offsetForPosition(@clipPosition(position)) + characterIndexForPosition: (position) -> super - positionForCharacterIndex: (index) -> - @core.positionForOffset(index) + positionForCharacterIndex: (index) -> super # Given a row, this deletes it from the buffer. # @@ -410,8 +399,7 @@ class TextBuffer # to a real position. # # Returns the new, clipped {Point}. Note that this could be the same as `position` if no clipping was performed. - clipPosition: (position) -> - @core.clipPosition(position) + clipPosition: (position) -> super # Given a range, this clips it to a real range. # @@ -426,11 +414,9 @@ class TextBuffer range = Range.fromObject(range) new Range(@clipPosition(range.start), @clipPosition(range.end)) - undo: -> - @core.undo() + undo: -> super - redo: -> - @core.redo() + redo: -> super # Saves the buffer. save: -> @@ -470,15 +456,13 @@ class TextBuffer # Identifies if a buffer is empty. # # Returns a {Boolean}. - isEmpty: -> @core.isEmpty() + isEmpty: -> super # Returns all valid {StringMarker}s on the buffer. - getMarkers: -> - @core.getMarkers() + getMarkers: -> super # Returns the {StringMarker} with the given id. - getMarker: (id) -> - @core.getMarker(id) + getMarker: (id) -> super destroyMarker: (id) -> @getMarker(id)?.destroy() @@ -486,8 +470,7 @@ class TextBuffer # Public: Finds the first marker satisfying the given attributes # # Returns a {String} marker-identifier - findMarker: (attributes) -> - @core.findMarker(attributes) + findMarker: (attributes) -> super # Public: Finds all markers satisfying the given attributes # @@ -497,14 +480,13 @@ class TextBuffer # endRow - The row at which the marker ends # # Returns an {Array} of {StringMarker}s - findMarkers: (attributes) -> - @core.findMarkers(attributes) + findMarkers: (attributes) -> super # Retrieves the quantity of markers in a buffer. # # Returns a {Number}. getMarkerCount: -> - @core.getMarkers().length + @getMarkers().length # Constructs a new marker at a given range. # @@ -517,8 +499,7 @@ class TextBuffer # hasTail - if `false`, the marker is created without a tail # # Returns a {Number} representing the new marker's ID. - markRange: (range, options={}) -> - @core.markRange(range, options) + markRange: (range, options={}) -> super # Constructs a new marker at a given position. # @@ -526,8 +507,7 @@ class TextBuffer # options - Options to pass to the {StringMarker} constructor # # Returns a {Number} representing the new marker's ID. - markPosition: (position, options) -> - @core.markPosition(position, options) + markPosition: (position, options) -> super # Identifies if a character sequence is within a certain range. # @@ -686,18 +666,10 @@ class TextBuffer ### Internal ### - transact: (fn) -> @core.transact fn - - beginTransaction: -> @core.beginTransaction() - - commitTransaction: -> @core.commitTransaction() - - abortTransaction: -> @core.abortTransaction() - change: (oldRange, newText, options={}) -> oldRange = @clipRange(oldRange) newText = @normalizeLineEndings(oldRange.start.row, newText) if options.normalizeLineEndings ? true - @core.setTextInRange(oldRange, newText, options) + @setTextInRange(oldRange, newText, options) normalizeLineEndings: (startRow, text) -> if lineEnding = @suggestedLineEndingForRow(startRow) From 821debcb855660ebd85a95bd85d18989793093cf Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Tue, 31 Dec 2013 18:18:39 -0700 Subject: [PATCH 26/68] Make Editor, DisplayBuffer, TokenizedBuffer to not use telepath This commit introduces dependency on a new npm called [reactionary](https://github.com/atom/reactionary). It will serve as a *much* lighter weight model framework to provide the reactive features of telepath without the replication logic. Specs are still failing for panes and workspace. I plan to just roll forward and remove the telepath dependency from them as well. --- package.json | 3 +- spec/editor-spec.coffee | 5 +--- spec/tokenized-buffer-spec.coffee | 2 +- src/display-buffer.coffee | 41 ++++++++++++++------------- src/editor.coffee | 47 +++++++++++++++---------------- src/tokenized-buffer.coffee | 37 +++++++++--------------- 6 files changed, 62 insertions(+), 73 deletions(-) diff --git a/package.json b/package.json index f6caaf9c5..76f589e7a 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,8 @@ "telepath": "0.80.0", "temp": "0.5.0", "text-buffer": "0.3.0", - "underscore-plus": "0.6.1" + "underscore-plus": "0.6.1", + "reactionary": "~0.1.0" }, "devDependencies": { "biscotto": "0.0.17", diff --git a/spec/editor-spec.coffee b/spec/editor-spec.coffee index 48116684d..30bcf8f36 100644 --- a/spec/editor-spec.coffee +++ b/spec/editor-spec.coffee @@ -28,10 +28,7 @@ describe "Editor", -> editor.foldBufferRow(4) expect(editor.isFoldedAtBufferRow(4)).toBeTruthy() - # Simulate serialization with replicate - editor2 = editor.testPersistence() - # FIXME: The created hook is called manually on deserialization because globals aren't ready otherwise - editor2.created() + editor2 = editor.testSerialization() expect(editor2.id).toBe editor.id expect(editor2.getBuffer().getPath()).toBe editor.getBuffer().getPath() diff --git a/spec/tokenized-buffer-spec.coffee b/spec/tokenized-buffer-spec.coffee index 654205c0e..087f1a03a 100644 --- a/spec/tokenized-buffer-spec.coffee +++ b/spec/tokenized-buffer-spec.coffee @@ -25,7 +25,7 @@ describe "TokenizedBuffer", -> startTokenizing(tokenizedBuffer) it "stops tokenization", -> - tokenizedBuffer.state.destroy() + tokenizedBuffer.destroy() spyOn(tokenizedBuffer, 'tokenizeNextChunk') advanceClock() expect(tokenizedBuffer.tokenizeNextChunk).not.toHaveBeenCalled() diff --git a/src/display-buffer.coffee b/src/display-buffer.coffee index 3e7d64383..0c477db7f 100644 --- a/src/display-buffer.coffee +++ b/src/display-buffer.coffee @@ -1,7 +1,9 @@ _ = require 'underscore-plus' {Emitter, Subscriber} = require 'emissary' guid = require 'guid' -{Model, Point, Range} = require 'telepath' +Serializable = require 'nostalgia' +{Model} = require 'reactionary' +{Point, Range} = require 'text-buffer' TokenizedBuffer = require './tokenized-buffer' RowMap = require './row-map' Fold = require './fold' @@ -12,28 +14,18 @@ ConfigObserver = require './config-observer' # Private: module.exports = class DisplayBuffer extends Model + Serializable.includeInto(this) _.extend @prototype, ConfigObserver @properties - tokenizedBuffer: null - softWrap: -> atom.config.get('editor.softWrap') ? false + softWrap: null editorWidthInChars: null - constructor: -> + constructor: ({tabLength, @editorWidthInChars, @tokenizedBuffer, buffer}={}) -> super - @deserializing = @state? - - created: -> - if @deserializing - @deserializing = false - return - - if @tokenizedBuffer? - @tokenizedBuffer?.created() - else - @tokenizedBuffer = new TokenizedBuffer({@tabLength, @buffer, project: atom.project}) + @softWrap ?= atom.config.get('editor.softWrap') ? false + @tokenizedBuffer ?= new TokenizedBuffer({tabLength, buffer}) @buffer = @tokenizedBuffer.buffer - @markers = {} @foldsByMarkerId = {} @updateAllScreenLines() @@ -43,10 +35,9 @@ class DisplayBuffer extends Model @subscribe @buffer, 'markers-updated', @handleBufferMarkersUpdated @subscribe @buffer, 'marker-created', @handleBufferMarkerCreated - @subscribe @state, 'changed', ({newValues}) => - if newValues.softWrap? - @emit 'soft-wrap-changed', newValues.softWrap - @updateWrappedScreenLines() + @subscribe @$softWrap, 'value', (softWrap) => + @emit 'soft-wrap-changed', softWrap + @updateWrappedScreenLines() @observeConfig 'editor.preferredLineLength', callNow: false, => @updateWrappedScreenLines() if @softWrap and atom.config.get('editor.softWrapAtPreferredLineLength') @@ -54,6 +45,16 @@ class DisplayBuffer extends Model @observeConfig 'editor.softWrapAtPreferredLineLength', callNow: false, => @updateWrappedScreenLines() if @softWrap + serializeParams: -> + id: @id + softWrap: @softWrap + editorWidthInChars: @editorWidthInChars + tokenizedBuffer: @tokenizedBuffer.serialize() + + deserializeParams: (params) -> + params.tokenizedBuffer = TokenizedBuffer.deserialize(params.tokenizedBuffer) + params + copy: -> newDisplayBuffer = atom.create(new DisplayBuffer({@buffer, tabLength: @getTabLength()})) for marker in @findMarkers(displayBufferId: @id) diff --git a/src/editor.coffee b/src/editor.coffee index 3bc0ade3f..52c77d28a 100644 --- a/src/editor.coffee +++ b/src/editor.coffee @@ -1,6 +1,8 @@ _ = require 'underscore-plus' path = require 'path' -{Model, Point, Range} = require 'telepath' +Serializable = require 'nostalgia' +{Model} = require 'reactionary' +{Point, Range} = require 'text-buffer' LanguageMode = require './language-mode' DisplayBuffer = require './display-buffer' Cursor = require './cursor' @@ -29,10 +31,9 @@ TextMateScopeSelector = require('first-mate').ScopeSelector # ``` module.exports = class Editor extends Model + Serializable.includeInto(this) @properties - displayBuffer: null - softTabs: null scrollTop: 0 scrollLeft: 0 @@ -45,26 +46,15 @@ class Editor extends Model selections: null suppressSelectionMerging: false - constructor: -> + constructor: ({@softTabs, initialLine, tabLength, softWrap, @displayBuffer, buffer, registerEditor, suppressCursorCreation}) -> super - @deserializing = @state? - - created: -> - if @deserializing - @deserializing = false - @callDisplayBufferCreatedHook = true - @registerEditor = true - return @cursors = [] @selections = [] - unless @displayBuffer? - @displayBuffer = new DisplayBuffer({@buffer, @tabLength, @softWrap}) - @softTabs = @buffer.usesSoftTabs() ? @softTabs ? atom.config.get('editor.softTabs') ? true - - @displayBuffer.created() if @callDisplayBufferCreatedHook + @displayBuffer ?= new DisplayBuffer({buffer, tabLength, softWrap}) @buffer = @displayBuffer.buffer + @softTabs = @buffer.usesSoftTabs() ? @softTabs ? atom.config.get('editor.softTabs') ? true for marker in @findMarkers(@getSelectionMarkerAttributes()) marker.setAttributes(preserveFolds: true) @@ -73,9 +63,9 @@ class Editor extends Model @subscribeToBuffer() @subscribeToDisplayBuffer() - if @getCursors().length is 0 and not @suppressCursorCreation - if @initialLine - position = [@initialLine, 0] + if @getCursors().length is 0 and not suppressCursorCreation + if initialLine + position = [initialLine, 0] else position = [0, 0] @addCursorAtBufferPosition(position) @@ -85,10 +75,19 @@ class Editor extends Model @subscribe @$scrollTop, 'value', (scrollTop) => @emit 'scroll-top-changed', scrollTop @subscribe @$scrollLeft, 'value', (scrollLeft) => @emit 'scroll-left-changed', scrollLeft - atom.project.addEditor(this) if @registerEditor + atom.project.addEditor(this) if registerEditor - # Deprecated: The goal is a world where we don't call serialize explicitly - serialize: -> this + serializeParams: -> + id: @id + softTabs: @softTabs + scrollTop: @scrollTop + scrollLeft: @scrollLeft + displayBuffer: @displayBuffer.serialize() + + deserializeParams: (params) -> + params.displayBuffer = DisplayBuffer.deserialize(params.displayBuffer) + params.registerEditor = true + params # Private: subscribeToBuffer: -> @@ -134,7 +133,7 @@ class Editor extends Model tabLength = @getTabLength() displayBuffer = @displayBuffer.copy() softTabs = @getSoftTabs() - newEditor = @create(new Editor({@buffer, displayBuffer, tabLength, softTabs, suppressCursorCreation: true})) + newEditor = new Editor({@buffer, displayBuffer, tabLength, softTabs, suppressCursorCreation: true}) newEditor.setScrollTop(@getScrollTop()) newEditor.setScrollLeft(@getScrollLeft()) for marker in @findMarkers(editorId: @id) diff --git a/src/tokenized-buffer.coffee b/src/tokenized-buffer.coffee index ac3cf01b9..57d94e203 100644 --- a/src/tokenized-buffer.coffee +++ b/src/tokenized-buffer.coffee @@ -1,5 +1,7 @@ _ = require 'underscore-plus' -{Model, Point, Range} = require 'telepath' +{Model} = require 'reactionary' +{Point, Range} = require 'text-buffer' +Serializable = require 'nostalgia' TokenizedLine = require './tokenized-line' Token = require './token' @@ -7,10 +9,9 @@ Token = require './token' module.exports = class TokenizedBuffer extends Model - @properties - bufferPath: null - tabLength: -> atom.config.get('editor.tabLength') ? 2 - project: null + Serializable.includeInto(this) + + @property 'tabLength' grammar: null currentGrammarScore: null @@ -20,19 +21,8 @@ class TokenizedBuffer extends Model invalidRows: null visible: false - constructor: -> - super - @deserializing = @state? - - created: -> - if @deserializing - @deserializing = false - return - - if @buffer? and @buffer.isAlive() - @bufferPath = @buffer.getPath() - else - @buffer = @project.bufferForPathSync(@bufferPath) + constructor: ({@buffer, @tabLength}) -> + @tabLength ?= atom.config.get('editor.tabLength') ? 2 @subscribe atom.syntax, 'grammar-added grammar-updated', (grammar) => if grammar.injectionSelector? @@ -56,12 +46,13 @@ class TokenizedBuffer extends Model @reloadGrammar() - # TODO: Remove when everything is a telepath model - destroy: -> - @destroyed() + serializeParams: -> + bufferPath: @buffer.getPath() + tabLength: @tabLength - destroyed: -> - @unsubscribe() + deserializeParams: (params) -> + params.buffer = atom.project.bufferForPathSync(params.bufferPath) + params setGrammar: (grammar, score) -> return if grammar is @grammar From e8f4da54a60bb47cd04251955576bc6c6e028e2f Mon Sep 17 00:00:00 2001 From: Matt Colyer Date: Thu, 2 Jan 2014 11:33:20 -0800 Subject: [PATCH 27/68] Upgrade find-and-replace@0.64.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7d3d5fe4c..f3f83bb2f 100644 --- a/package.json +++ b/package.json @@ -95,7 +95,7 @@ "editor-stats": "0.9.0", "exception-reporting": "0.9.0", "feedback": "0.21.0", - "find-and-replace": "0.63.0", + "find-and-replace": "0.64.0", "fuzzy-finder": "0.28.0", "gists": "0.13.0", "git-diff": "0.21.0", From 92ef8f22e4bf9a540319784f4f550672bc983026 Mon Sep 17 00:00:00 2001 From: Matt Colyer Date: Thu, 2 Jan 2014 15:34:36 -0800 Subject: [PATCH 28/68] Upgrade scandal@0.10.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f3f83bb2f..34352447a 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "pathwatcher": "0.11.0", "pegjs": "0.7.0", "q": "0.9.7", - "scandal": "0.9.0", + "scandal": "0.10.1", "season": "0.14.0", "semver": "1.1.4", "space-pen": "2.0.2", From 2c58d1a2b71c7d7d080c5f6ec826c270d8f1bd81 Mon Sep 17 00:00:00 2001 From: Matt Colyer Date: Fri, 3 Jan 2014 09:31:44 -0800 Subject: [PATCH 29/68] Upgrade scandal@0.11.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 34352447a..47403a99e 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "pathwatcher": "0.11.0", "pegjs": "0.7.0", "q": "0.9.7", - "scandal": "0.10.1", + "scandal": "0.11.0", "season": "0.14.0", "semver": "1.1.4", "space-pen": "2.0.2", From bc65137911bf606d8d9bc5a5ea87d90ce612e35d Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Fri, 3 Jan 2014 16:23:23 -0700 Subject: [PATCH 30/68] Remove telepath from Project, WorkspaceView, and Pane* --- spec/git-spec.coffee | 2 +- spec/pane-spec.coffee | 10 ++--- spec/project-spec.coffee | 10 ++--- spec/spec-helper.coffee | 2 +- spec/text-buffer-spec.coffee | 1 - spec/window-spec.coffee | 2 +- spec/workspace-view-spec.coffee | 6 ++- src/atom.coffee | 4 +- src/cursor-view.coffee | 2 +- src/cursor.coffee | 2 +- src/editor.coffee | 1 + src/pane-axis.coffee | 57 ++++++------------------- src/pane-container.coffee | 37 ++++------------ src/pane.coffee | 76 +++++++++++---------------------- src/project.coffee | 37 ++++++++-------- src/workspace-view.coffee | 38 ++++++----------- 16 files changed, 97 insertions(+), 190 deletions(-) diff --git a/spec/git-spec.coffee b/spec/git-spec.coffee index c6ef5dde2..50e5f5cce 100644 --- a/spec/git-spec.coffee +++ b/spec/git-spec.coffee @@ -257,7 +257,7 @@ describe "Git", -> it "subscribes to all the serialized buffers in the project", -> atom.project.openSync('sample.js') - project2 = atom.project.testPersistence() + project2 = atom.project.testSerialization() buffer = project2.getBuffers()[0] waitsFor -> diff --git a/spec/pane-spec.coffee b/spec/pane-spec.coffee index 356013b4b..a4a669b23 100644 --- a/spec/pane-spec.coffee +++ b/spec/pane-spec.coffee @@ -677,12 +677,12 @@ describe "Pane", -> describe "serialization", -> it "can serialize and deserialize the pane and all its items", -> - newPane = atom.deserializers.deserialize(pane.serialize().testPersistence()) + newPane = pane.testSerialization() expect(newPane.getItems()).toEqual [view1, editor1, view2, editor2] it "restores the active item on deserialization", -> pane.showItem(editor2) - newPane = atom.deserializers.deserialize(pane.serialize().testPersistence()) + newPane = pane.testSerialization() expect(newPane.activeItem).toEqual editor2 it "does not show items that cannot be deserialized", -> @@ -693,7 +693,7 @@ describe "Pane", -> pane.showItem(new Unserializable) - state = pane.serialize().testPersistence() + state = pane.testSerialization() newPane = atom.deserializers.deserialize(state) expect(newPane.activeItem).toEqual pane.items[0] expect(newPane.items.length).toBe pane.items.length - 1 @@ -702,13 +702,13 @@ describe "Pane", -> container.attachToDom() pane.focus() - container2 = atom.deserializers.deserialize(container.serialize().testPersistence()) + container2 = container.testSerialization() pane2 = container2.getRoot() container2.attachToDom() expect(pane2).toMatchSelector(':has(:focus)') $(document.activeElement).blur() - container3 = atom.deserializers.deserialize(container.serialize().testPersistence()) + container3 = container.testSerialization() pane3 = container3.getRoot() container3.attachToDom() expect(pane3).not.toMatchSelector(':has(:focus)') diff --git a/spec/project-spec.coffee b/spec/project-spec.coffee index 5f199b575..da710f724 100644 --- a/spec/project-spec.coffee +++ b/spec/project-spec.coffee @@ -16,21 +16,17 @@ describe "Project", -> afterEach -> deserializedProject?.destroy() - it "destroys unretained buffers and does not include them in the serialized state", -> + it "does not include unretained buffers in the serialized state", -> atom.project.bufferForPathSync('a') expect(atom.project.getBuffers().length).toBe 1 - atom.project.getState().serializeForPersistence() - deserializedProject = atom.project.testPersistence() - + deserializedProject = atom.project.testSerialization() expect(deserializedProject.getBuffers().length).toBe 0 - expect(atom.project.getBuffers().length).toBe 0 it "listens for destroyed events on deserialized buffers and removes them when they are destroyed", -> atom.project.openSync('a') expect(atom.project.getBuffers().length).toBe 1 - atom.project.getState().serializeForPersistence() - deserializedProject = atom.project.testPersistence() + deserializedProject = atom.project.testSerialization() expect(deserializedProject.getBuffers().length).toBe 1 deserializedProject.getBuffers()[0].destroy() diff --git a/spec/spec-helper.coffee b/spec/spec-helper.coffee index 618f81503..8555bea4b 100644 --- a/spec/spec-helper.coffee +++ b/spec/spec-helper.coffee @@ -7,7 +7,7 @@ path = require 'path' {_, $, File, WorkspaceView, fs} = require 'atom' Keymap = require '../src/keymap' Config = require '../src/config' -{Point} = require 'telepath' +{Point} = require 'text-buffer' Project = require '../src/project' Editor = require '../src/editor' EditorView = require '../src/editor-view' diff --git a/spec/text-buffer-spec.coffee b/spec/text-buffer-spec.coffee index 1d1d75cd8..7f26c663b 100644 --- a/spec/text-buffer-spec.coffee +++ b/spec/text-buffer-spec.coffee @@ -1,7 +1,6 @@ {_, fs} = require 'atom' path = require 'path' temp = require 'temp' -{Site} = require 'telepath' TextBuffer = require '../src/text-buffer' describe 'TextBuffer', -> diff --git a/spec/window-spec.coffee b/spec/window-spec.coffee index de01bf375..e83f7c43c 100644 --- a/spec/window-spec.coffee +++ b/spec/window-spec.coffee @@ -93,7 +93,7 @@ describe "Window", -> atom.unloadEditorWindow() - expect(atom.state.getObject('workspaceView')).toEqual workspaceViewState.toObject() + expect(atom.state.getObject('workspaceView')).toEqual workspaceViewState expect(atom.state.getObject('syntax')).toEqual syntaxState expect(atom.saveSync).toHaveBeenCalled() diff --git a/spec/workspace-view-spec.coffee b/spec/workspace-view-spec.coffee index 3147ee13a..1b77bd2d8 100644 --- a/spec/workspace-view-spec.coffee +++ b/spec/workspace-view-spec.coffee @@ -19,9 +19,11 @@ describe "WorkspaceView", -> viewState = null simulateReload = -> - state = atom.workspaceView.serialize().testPersistence() + workspaceState = atom.workspaceView.serialize() + projectState = atom.project.serialize() atom.workspaceView.remove() - atom.workspaceView = WorkspaceView.deserialize(state) + atom.project = atom.deserializers.deserialize(projectState) + atom.workspaceView = WorkspaceView.deserialize(workspaceState) atom.workspaceView.attachToDom() describe "when the serialized WorkspaceView has an unsaved buffer", -> diff --git a/src/atom.coffee b/src/atom.coffee index 90c7049c1..b2a12d071 100644 --- a/src/atom.coffee +++ b/src/atom.coffee @@ -223,7 +223,7 @@ class Atom extends Model # Private: deserializeProject: -> Project = require './project' - @project ?= new Project(path: @getLoadSettings().initialPath) + @project ?= @deserializers.deserialize(@project) ? new Project(path: @getLoadSettings().initialPath) # Private: deserializeWorkspaceView: -> @@ -231,7 +231,7 @@ class Atom extends Model @workspaceView = @deserializers.deserialize(@state.get('workspaceView')) unless @workspaceView? @workspaceView = new WorkspaceView() - @state.set('workspaceView', @workspaceView.getState()) + @state.set('workspaceView', @workspaceView.serialize()) $(@workspaceViewParentSelector).append(@workspaceView) # Private: diff --git a/src/cursor-view.coffee b/src/cursor-view.coffee index 6eca35342..5a5bff89f 100644 --- a/src/cursor-view.coffee +++ b/src/cursor-view.coffee @@ -1,5 +1,5 @@ {View} = require './space-pen-extensions' -{Point, Range} = require 'telepath' +{Point, Range} = require 'text-buffer' _ = require 'underscore-plus' ### Internal ### diff --git a/src/cursor.coffee b/src/cursor.coffee index 46ba11619..95a83450b 100644 --- a/src/cursor.coffee +++ b/src/cursor.coffee @@ -1,4 +1,4 @@ -{Point, Range} = require 'telepath' +{Point, Range} = require 'text-buffer' {Emitter} = require 'emissary' _ = require 'underscore-plus' diff --git a/src/editor.coffee b/src/editor.coffee index 52c77d28a..873be4f38 100644 --- a/src/editor.coffee +++ b/src/editor.coffee @@ -32,6 +32,7 @@ TextMateScopeSelector = require('first-mate').ScopeSelector module.exports = class Editor extends Model Serializable.includeInto(this) + atom.deserializers.add(this) @properties scrollTop: 0 diff --git a/src/pane-axis.coffee b/src/pane-axis.coffee index f8ed436a3..eecf3ee17 100644 --- a/src/pane-axis.coffee +++ b/src/pane-axis.coffee @@ -1,39 +1,26 @@ +Serializable = require 'nostalgia' {$, View} = require './space-pen-extensions' -{TelepathicObject} = require 'telepath' ### Internal ### module.exports = class PaneAxis extends View - @acceptsDocuments: true + Serializable.includeInto(this) - @deserialize: (state) -> - new this(state) + initialize: ({children}={}) -> + @addChild(child) for child in children ? [] - initialize: (args...) -> - if args[0] instanceof TelepathicObject - @state = args[0] - @state.get('children').each (child, index) => - @addChild(atom.deserializers.deserialize(child), index, updateState: false) - else - @state = atom.create(deserializer: @className(), children: []) - @addChild(child) for child in args + serializeParams: -> + children: @children().views().map (child) -> child.serialize() - @state.get('children').on 'changed', ({index, insertedValues, removedValues, siteId}) => - return if siteId is @state.siteId - for childState in removedValues - @removeChild(@children(":eq(#{index})").view(), updateState: false) - for childState, i in insertedValues - @addChild(atom.deserializers.deserialize(childState), index + i, updateState: false) + deserializeParams: (params) -> + params.children = params.children.map (childState) -> atom.deserializers.deserialize(childState) + params - addChild: (child, index=@children().length, options={}) -> + addChild: (child, index=@children().length) -> @insertAt(index, child) - state = child.getState() - @state.get('children').insert(index, state) if options.updateState ? true @getContainer()?.adjustPaneDimensions() - removeChild: (child, options={}) -> - options.updateState ?= true - + removeChild: (child) -> parent = @parent().view() container = @getContainer() childWasInactive = not child.isActive?() @@ -54,11 +41,10 @@ class PaneAxis extends View if parent.setRoot? parent.setRoot(sibling, suppressPaneItemChangeEvents: childWasInactive) else - parent.insertChildBefore(this, sibling, options) - parent.removeChild(this, options) + parent.insertChildBefore(this, sibling) + parent.removeChild(this) sibling.focus() if siblingFocused else - @state.get('children').remove(@indexOf(child)) if options.updateState primitiveRemove(child) container.adjustPaneDimensions() @@ -66,7 +52,6 @@ class PaneAxis extends View container.trigger 'pane:removed', [child] if child instanceof Pane detachChild: (child) -> - @state.get('children').remove(@indexOf(child)) child.detach() getContainer: -> @@ -78,25 +63,11 @@ class PaneAxis extends View getActivePane: -> @find('.pane.active').view() ? @find('.pane:first').view() - insertChildBefore: (child, newChild, options={}) -> + insertChildBefore: (child, newChild) -> newChild.insertBefore(child) - if options.updateState ? true - children = @state.get('children') - childIndex = children.indexOf(child.getState()) - children.insert(childIndex, newChild.getState()) insertChildAfter: (child, newChild) -> newChild.insertAfter(child) - children = @state.get('children') - childIndex = children.indexOf(child.getState()) - children.insert(childIndex + 1, newChild.getState()) - - serialize: -> - state = @state.clone() - state.set('children', child.serialize() for child in @children().views()) - state - - getState: -> @state horizontalChildUnits: -> $(child).view().horizontalGridUnits() for child in @children() diff --git a/src/pane-container.coffee b/src/pane-container.coffee index 97818aef7..8db9b7b44 100644 --- a/src/pane-container.coffee +++ b/src/pane-container.coffee @@ -1,3 +1,4 @@ +Serializable = require 'nostalgia' {$, View} = require './space-pen-extensions' Pane = require './pane' {TelepathicObject} = require 'telepath' @@ -5,33 +6,14 @@ Pane = require './pane' # Private: Manages the list of panes within a {WorkspaceView} module.exports = class PaneContainer extends View + Serializable.includeInto(this) atom.deserializers.add(this) - ### Internal ### - @acceptsDocuments: true - - @deserialize: (state) -> - container = new PaneContainer(state) - container.removeEmptyPanes() - container - @content: -> @div class: 'panes' - initialize: (state) -> - if state instanceof TelepathicObject - @state = state - @setRoot(atom.deserializers.deserialize(@state.get('root'))) - else - @state = atom.create(deserializer: 'PaneContainer') - - @subscribe @state, 'changed', ({newValues, siteId}) => - return if siteId is @state.siteId - if newValues.hasOwnProperty('root') - if rootState = newValues.root - @setRoot(deserialize(rootState)) - else - @setRoot(null) + initialize: ({root}={}) -> + @setRoot(root) @subscribe this, 'pane:attached', (event, pane) => @triggerActiveItemChange() if @getActivePane() is pane @@ -48,12 +30,12 @@ class PaneContainer extends View triggerActiveItemChange: -> @trigger 'pane-container:active-pane-item-changed', [@getActivePaneItem()] - serialize: -> - state = @state.clone() - state.set('root', @getRoot()?.serialize()) - state + serializeParams: -> + root: @getRoot()?.serialize() - getState: -> @state + deserializeParams: (params) -> + params.root = atom.deserializers.deserialize(params.root) + params ### Public ### @@ -95,7 +77,6 @@ class PaneContainer extends View if root? @append(root) root.makeActive?() - @state.set(root: root?.getState()) removeChild: (child) -> throw new Error("Removing non-existant child") unless @getRoot() is child diff --git a/src/pane.coffee b/src/pane.coffee index 0133b134a..f52d8114c 100644 --- a/src/pane.coffee +++ b/src/pane.coffee @@ -1,7 +1,8 @@ {dirname} = require 'path' {$, View} = require './space-pen-extensions' _ = require 'underscore-plus' -{TelepathicObject} = require 'telepath' +Serializable = require 'nostalgia' + PaneRow = require './pane-row' PaneColumn = require './pane-column' @@ -13,51 +14,31 @@ PaneColumn = require './pane-column' # building a package that deals with switching between panes or tiems. module.exports = class Pane extends View + Serializable.includeInto(this) - @acceptsDocuments: true + @version: 1 @content: (wrappedView) -> @div class: 'pane', tabindex: -1, => @div class: 'item-views', outlet: 'itemViews' - @deserialize: (state) -> - pane = new Pane(state) - pane.focusOnAttach = true if state.get('focused') - pane - activeItem: null items: null viewsByItem: null # Views without a setModel() method are stored here # Private: initialize: (args...) -> - @items = [] - if args[0] instanceof TelepathicObject - @state = args[0] - @items = _.compact(@state.get('items').getValues()) - item?.created?() for item in @getItems() + if args[0]?.items # deserializing + {@items, activeItemUri, @focusOnAttach} = args[0] else @items = args - @state = atom.create - deserializer: 'Pane' - items: @items + + @items ?= [] @handleItemEvents(item) for item in @items - @subscribe @state.get('items'), 'changed', ({index, removedValues, insertedValues, siteId}) => - return if siteId is @state.siteId - for item in removedValues - @removeItemAtIndex(index, updateState: false) - for item, i in insertedValues - @addItem(itemState, index + i, updateState: false) - - @subscribe @state, 'changed', ({newValues, siteId}) => - return if siteId is @state.siteId - if newValues.activeItemUri - @showItemForUri(newValues.activeItemUri) - @viewsByItem = new WeakMap() - activeItemUri = @state.get('activeItemUri') + unless activeItemUri? and @showItemForUri(activeItemUri) @showItem(@items[0]) if @items.length > 0 @@ -84,6 +65,15 @@ class Pane extends View @on 'focus', => @activeView?.focus(); false @on 'focusin', => @makeActive() + deserializeParams: (params) -> + params.items = _.compact(params.items.map (itemState) -> atom.deserializers.deserialize(itemState)) + params + + serializeParams: -> + items: _.compact(@items.map (item) -> item.serialize?()) + focusOnAttach: @is(':has(:focus)') + activeItemUri: @getActivePaneItem()?.getUri?() + # Private: afterAttach: (onDom) -> if @focusOnAttach and onDom @@ -173,17 +163,14 @@ class Pane extends View @activeView = view @trigger 'pane:active-item-changed', [item] - @state.set('activeItemUri', item.getUri?()) - # Private: activeItemTitleChanged: => @trigger 'pane:active-item-title-changed' # Public: Add an additional item at the specified index. - addItem: (item, index=@getActiveItemIndex()+1, options={}) -> + addItem: (item, index=@getActiveItemIndex() + 1) -> return if _.include(@items, item) - @state.get('items').splice(index, 0, item) if options.updateState ? true @items.splice(index, 0, item) @trigger 'pane:item-added', [item, index] @handleItemEvents(item) @@ -191,8 +178,7 @@ class Pane extends View handleItemEvents: (item) -> if _.isFunction(item.on) - @subscribe item, 'destroyed', => - @destroyItem(item) if @state.isAlive() + @subscribe item, 'destroyed', => @destroyItem(item) # Public: Remove the currently active item. destroyActiveItem: => @@ -268,17 +254,16 @@ class Pane extends View @saveItem(item) for item in @getItems() # Public: - removeItem: (item, options) -> + removeItem: (item) -> index = @items.indexOf(item) - @removeItemAtIndex(index, options) if index >= 0 + @removeItemAtIndex(index) if index >= 0 # Public: Just remove the item at the given index. - removeItemAtIndex: (index, options={}) -> + removeItemAtIndex: (index) -> item = @items[index] @activeItem.off? 'title-changed', @activeItemTitleChanged if item is @activeItem @showNextItem() if item is @activeItem and @items.length > 1 _.remove(@items, item) - @state.get('items').splice(index, 1) if options.updateState ? true @cleanupItemView(item) @trigger 'pane:item-removed', [item, index] @@ -287,14 +272,13 @@ class Pane extends View oldIndex = @items.indexOf(item) @items.splice(oldIndex, 1) @items.splice(newIndex, 0, item) - @state.get('items').insert(newIndex, item) @trigger 'pane:item-moved', [item, newIndex] # Public: Moves the given item to another pane. moveItemToPane: (item, pane, index) -> @isMovingItem = true pane.addItem(item, index) - @removeItem(item, updateState: false) + @removeItem(item) @isMovingItem = false # Public: Finds the first item that matches the given uri. @@ -330,7 +314,7 @@ class Pane extends View else if @isMovingItem and viewToRemove?.setModel viewToRemove.setModel(null) # dont want to destroy the model, so set to null - @parent().view().removeChild(this, updateState: false) + @parent().view().removeChild(this) # Private: viewForItem: (item) -> @@ -348,16 +332,6 @@ class Pane extends View viewForActiveItem: -> @viewForItem(@activeItem) - # Private: - serialize: -> - state = @state.clone() - state.set('items', @items) - state.set('focused', @is(':has(:focus)')) - state - - # Private: - getState: -> @state - # Private: adjustDimensions: -> # do nothing diff --git a/src/project.coffee b/src/project.coffee index 01aea45f9..e435b3008 100644 --- a/src/project.coffee +++ b/src/project.coffee @@ -4,7 +4,9 @@ url = require 'url' _ = require 'underscore-plus' fs = require 'fs-plus' Q = require 'q' -{Model} = require 'telepath' +{Model} = require 'reactionary' +{Emitter, Subscriber} = require 'emissary' +Serializable = require 'nostalgia' TextBuffer = require './text-buffer' Editor = require './editor' @@ -18,9 +20,8 @@ Git = require './git' # of directories and files that you can operate on. module.exports = class Project extends Model - - @properties - path: null + atom.deserializers.add(this) + Serializable.includeInto(this) # Public: Find the local path for the given repository URL. @pathForRepositoryUrl: (repoUrl) -> @@ -28,27 +29,23 @@ class Project extends Model repoName = repoName.replace(/\.git$/, '') path.join(atom.config.get('core.projectHome'), repoName) - constructor: -> - super - if @state? - @buffers = @state.get('buffers').map (state) -> atom.deserializers.deserialize(state) - - # Private: Called by telepath. - created: -> + constructor: ({path, @buffers}={}) -> @buffers ?= [] - for buffer in @buffers do (buffer) => - buffer.once 'destroyed', => @removeBuffer(buffer) if @isAlive() + buffer.once 'destroyed', => @removeBuffer(buffer) @openers = [] @editors = [] - @setPath(@path) + @setPath(path) - # Private: Called by telepath. - willBePersisted: -> - @state.set('buffers', @buffers.map (buffer) -> buffer.serialize()) - @destroyUnretainedBuffers() + serializeParams: -> + path: @path + buffers: _.compact(@buffers.map (buffer) -> buffer.serialize() if buffer.isRetained()) + + deserializeParams: (params) -> + params.buffers = params.buffers.map (bufferState) -> atom.deserializers.deserialize(bufferState) + params # Public: Register an opener for project files. # @@ -246,7 +243,7 @@ class Project extends Model # Private: addBufferAtIndex: (buffer, index, options={}) -> @buffers.splice(index, 0, buffer) - buffer.once 'destroyed', => @removeBuffer(buffer) if @isAlive() + buffer.once 'destroyed', => @removeBuffer(buffer) @emit 'buffer-created', buffer buffer @@ -345,7 +342,7 @@ class Project extends Model # Private: buildEditorForBuffer: (buffer, editorOptions) -> - editor = @create(new Editor(_.extend({buffer}, editorOptions))) + editor = new Editor(_.extend({buffer}, editorOptions)) @addEditor(editor) editor diff --git a/src/workspace-view.coffee b/src/workspace-view.coffee index 98d05a91f..975113bb6 100644 --- a/src/workspace-view.coffee +++ b/src/workspace-view.coffee @@ -4,7 +4,7 @@ Q = require 'q' {$, $$, View} = require './space-pen-extensions' _ = require 'underscore-plus' fs = require 'fs-plus' -{TelepathicObject} = require 'telepath' +Serializable = require 'nostalgia' EditorView = require './editor-view' Pane = require './pane' PaneColumn = require './pane-column' @@ -38,9 +38,10 @@ Editor = require './editor' # module.exports = class WorkspaceView extends View + Serializable.includeInto(this) atom.deserializers.add(this, Pane, PaneRow, PaneColumn, EditorView) - @version: 1 + @version: 2 @configDefaults: ignoredNames: [".git", ".svn", ".DS_Store"] @@ -50,31 +51,16 @@ class WorkspaceView extends View projectHome: path.join(fs.getHomeDirectory(), 'github') audioBeep: true - @acceptsDocuments: true - # Private: - @content: (state) -> + @content: -> @div class: 'workspace', tabindex: -1, => @div class: 'horizontal', outlet: 'horizontal', => @div class: 'vertical', outlet: 'vertical', => @div class: 'panes', outlet: 'panes' # Private: - @deserialize: (state) -> - new WorkspaceView(state) - - # Private: - initialize: (state={}) -> - if state instanceof TelepathicObject - @state = state - panes = atom.deserializers.deserialize(state.get('panes')) - else - panes = new PaneContainer - @state = atom.create - deserializer: @constructor.name - version: @constructor.version - panes: panes.getState() - + initialize: ({panes}={}) -> + panes ?= new PaneContainer @panes.replaceWith(panes) @panes = panes @@ -131,14 +117,14 @@ class WorkspaceView extends View @command 'core:save-as', => @saveActivePaneItemAs() # Private: - serialize: -> - state = @state.clone() - state.set('panes', @panes.serialize()) - state.set('fullScreen', atom.isFullScreen()) - state + deserializeParams: (params) -> + params.panes = atom.deserializers.deserialize(params.panes) + params # Private: - getState: -> @state + serializeParams: -> + panes: @panes.serialize() + fullScreen: atom.isFullScreen() # Private: handleFocus: (e) -> From 112b8bfa29c3558b25f522c5f48d8311a59548eb Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Fri, 3 Jan 2014 16:36:08 -0700 Subject: [PATCH 31/68] Generate docs from text-buffer instead of telepath --- tasks/docs-task.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/docs-task.coffee b/tasks/docs-task.coffee index ac034818f..d9d17c2c2 100644 --- a/tasks/docs-task.coffee +++ b/tasks/docs-task.coffee @@ -9,7 +9,7 @@ module.exports = (grunt) -> grunt.registerTask 'build-docs', 'Builds the API docs in src/app', -> done = @async() - args = [commonArgs..., '--title', 'Atom API Documentation', '-o', 'docs/output/api', 'src/', '../telepath/src/range.coffee', '../telepath/src/point.coffee', '../telepath/src/string-marker.coffee'] + args = [commonArgs..., '--title', 'Atom API Documentation', '-o', 'docs/output/api', 'src/', '../text-buffer/src/range.coffee', '../text-buffer/src/point.coffee', '../text-buffer/src/marker.coffee'] grunt.util.spawn({cmd, args, opts}, done) grunt.registerTask 'lint-docs', 'Generate stats about the doc coverage', -> From 914a87290bd7b64d3cdc9053f9734b825f3ccd40 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Fri, 3 Jan 2014 16:36:26 -0700 Subject: [PATCH 32/68] Remove unnecessary telepath requires --- src/display-buffer-marker.coffee | 2 +- src/editor-view.coffee | 2 +- src/fold.coffee | 2 +- src/gutter.coffee | 2 +- src/language-mode.coffee | 2 +- src/pane-container.coffee | 1 - 6 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/display-buffer-marker.coffee b/src/display-buffer-marker.coffee index dbc1bc677..9a1e055f2 100644 --- a/src/display-buffer-marker.coffee +++ b/src/display-buffer-marker.coffee @@ -1,4 +1,4 @@ -{Range} = require 'telepath' +{Range} = require 'text-buffer' _ = require 'underscore-plus' {Emitter, Subscriber} = require 'emissary' diff --git a/src/editor-view.coffee b/src/editor-view.coffee index 04a35951e..d0d2e4f72 100644 --- a/src/editor-view.coffee +++ b/src/editor-view.coffee @@ -1,7 +1,7 @@ {View, $, $$$} = require './space-pen-extensions' TextBuffer = require './text-buffer' Gutter = require './gutter' -{Point, Range} = require 'telepath' +{Point, Range} = require 'text-buffer' Editor = require './editor' CursorView = require './cursor-view' SelectionView = require './selection-view' diff --git a/src/fold.coffee b/src/fold.coffee index ba03126e3..32de3f988 100644 --- a/src/fold.coffee +++ b/src/fold.coffee @@ -1,4 +1,4 @@ -{Point, Range} = require 'telepath' +{Point, Range} = require 'text-buffer' # Private: Represents a fold that collapses multiple buffer lines into a single # line on the screen. diff --git a/src/gutter.coffee b/src/gutter.coffee index 710200473..7b7ee15a1 100644 --- a/src/gutter.coffee +++ b/src/gutter.coffee @@ -1,5 +1,5 @@ {View, $, $$, $$$} = require './space-pen-extensions' -{Range} = require 'telepath' +{Range} = require 'text-buffer' _ = require 'underscore-plus' # Private: Represents the portion of the {EditorView} containing row numbers. diff --git a/src/language-mode.coffee b/src/language-mode.coffee index 28ee1dc70..8d1d2087f 100644 --- a/src/language-mode.coffee +++ b/src/language-mode.coffee @@ -1,4 +1,4 @@ -{Range} = require 'telepath' +{Range} = require 'text-buffer' _ = require 'underscore-plus' {OnigRegExp} = require 'oniguruma' {Emitter, Subscriber} = require 'emissary' diff --git a/src/pane-container.coffee b/src/pane-container.coffee index 8db9b7b44..601a49765 100644 --- a/src/pane-container.coffee +++ b/src/pane-container.coffee @@ -1,7 +1,6 @@ Serializable = require 'nostalgia' {$, View} = require './space-pen-extensions' Pane = require './pane' -{TelepathicObject} = require 'telepath' # Private: Manages the list of panes within a {WorkspaceView} module.exports = From e26d97d5ac82d11b4b44d39f5415ec6d63f25416 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Fri, 3 Jan 2014 17:42:11 -0700 Subject: [PATCH 33/68] Remove telepath as a core dependency --- exports/atom.coffee | 5 +-- package.json | 1 - spec/display-buffer-spec.coffee | 8 ++-- spec/selection-spec.coffee | 2 +- spec/spec-helper.coffee | 5 +-- spec/tokenized-buffer-spec.coffee | 16 +++---- spec/window-spec.coffee | 4 +- src/atom.coffee | 71 ++++++++++++++----------------- src/deserializer-manager.coffee | 7 --- src/display-buffer.coffee | 2 +- src/editor-view.coffee | 6 +-- src/selection-view.coffee | 2 +- src/selection.coffee | 2 +- src/site-shim.coffee | 8 ---- src/workspace-view.coffee | 2 +- 15 files changed, 59 insertions(+), 82 deletions(-) delete mode 100644 src/site-shim.coffee diff --git a/exports/atom.coffee b/exports/atom.coffee index 1b1927737..fac7165f1 100644 --- a/exports/atom.coffee +++ b/exports/atom.coffee @@ -1,12 +1,11 @@ -{TelepathicObject, Model, Point, Range} = require 'telepath' +{Model} = require 'reactionary' +{Point, Range} = require 'text-buffer' module.exports = _: require 'underscore-plus' BufferedNodeProcess: require '../src/buffered-node-process' BufferedProcess: require '../src/buffered-process' Directory: require '../src/directory' - TelepathicObject: TelepathicObject - Document: TelepathicObject # Deprecated Shim File: require '../src/file' fs: require 'fs-plus' Git: require '../src/git' diff --git a/package.json b/package.json index 76f589e7a..42bae8a51 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,6 @@ "season": "0.14.0", "semver": "1.1.4", "space-pen": "2.0.2", - "telepath": "0.80.0", "temp": "0.5.0", "text-buffer": "0.3.0", "underscore-plus": "0.6.1", diff --git a/spec/display-buffer-spec.coffee b/spec/display-buffer-spec.coffee index caed9092b..e85a05049 100644 --- a/spec/display-buffer-spec.coffee +++ b/spec/display-buffer-spec.coffee @@ -7,7 +7,7 @@ describe "DisplayBuffer", -> tabLength = 2 atom.packages.activatePackage('language-javascript', sync: true) buffer = atom.project.bufferForPathSync('sample.js') - displayBuffer = atom.create(new DisplayBuffer({buffer, tabLength})) + displayBuffer = new DisplayBuffer({buffer, tabLength}) changeHandler = jasmine.createSpy 'changeHandler' displayBuffer.on 'changed', changeHandler @@ -150,7 +150,7 @@ describe "DisplayBuffer", -> describe "when a newline is inserted, deleted, and re-inserted at the end of a wrapped line (regression)", -> it "correctly renders the original wrapped line", -> buffer = atom.project.buildBufferSync(null, '') - displayBuffer = atom.create(new DisplayBuffer({buffer, tabLength, editorWidthInChars: 30, softWrap: true})) + displayBuffer = new DisplayBuffer({buffer, tabLength, editorWidthInChars: 30, softWrap: true}) buffer.insert([0, 0], "the quick brown fox jumps over the lazy dog.") buffer.insert([0, Infinity], '\n') @@ -202,7 +202,7 @@ describe "DisplayBuffer", -> displayBuffer.destroy() buffer.release() buffer = atom.project.bufferForPathSync('two-hundred.txt') - displayBuffer = atom.create(new DisplayBuffer({buffer, tabLength})) + displayBuffer = new DisplayBuffer({buffer, tabLength}) displayBuffer.on 'changed', changeHandler describe "when folds are created and destroyed", -> @@ -308,7 +308,7 @@ describe "DisplayBuffer", -> describe "when there is another display buffer pointing to the same buffer", -> it "does not create folds in the other display buffer", -> - otherDisplayBuffer = atom.create(new DisplayBuffer({buffer, tabLength})) + otherDisplayBuffer = new DisplayBuffer({buffer, tabLength}) displayBuffer.createFold(2, 4) expect(otherDisplayBuffer.foldsStartingAtBufferRow(2).length).toBe 0 diff --git a/spec/selection-spec.coffee b/spec/selection-spec.coffee index cc6f26597..a9290c5e1 100644 --- a/spec/selection-spec.coffee +++ b/spec/selection-spec.coffee @@ -5,7 +5,7 @@ describe "Selection", -> beforeEach -> buffer = atom.project.bufferForPathSync('sample.js') - editor = atom.create(new Editor(buffer: buffer, tabLength: 2)) + editor = new Editor(buffer: buffer, tabLength: 2) selection = editor.getSelection() afterEach -> diff --git a/spec/spec-helper.coffee b/spec/spec-helper.coffee index 8555bea4b..2b74152fa 100644 --- a/spec/spec-helper.coffee +++ b/spec/spec-helper.coffee @@ -110,15 +110,14 @@ afterEach -> atom.workspaceView?.remove?() atom.workspaceView = null - atom.state.remove('workspaceView') + delete atom.state.workspaceView atom.project?.destroy?() atom.project = null - atom.state.remove('packageStates') + delete atom.state.packageStates $('#jasmine-content').empty() unless window.debugContent - atom.destroyOrphans() jasmine.unspy(atom, 'saveSync') ensureNoPathSubscriptions() diff --git a/spec/tokenized-buffer-spec.coffee b/spec/tokenized-buffer-spec.coffee index 087f1a03a..a9df78a56 100644 --- a/spec/tokenized-buffer-spec.coffee +++ b/spec/tokenized-buffer-spec.coffee @@ -21,7 +21,7 @@ describe "TokenizedBuffer", -> describe "when the buffer is destroyed", -> beforeEach -> buffer = atom.project.bufferForPathSync('sample.js') - tokenizedBuffer = atom.create(new TokenizedBuffer({buffer})) + tokenizedBuffer = new TokenizedBuffer({buffer}) startTokenizing(tokenizedBuffer) it "stops tokenization", -> @@ -33,7 +33,7 @@ describe "TokenizedBuffer", -> describe "when the buffer contains soft-tabs", -> beforeEach -> buffer = atom.project.bufferForPathSync('sample.js') - tokenizedBuffer = atom.create(new TokenizedBuffer({buffer})) + tokenizedBuffer = new TokenizedBuffer({buffer}) startTokenizing(tokenizedBuffer) tokenizedBuffer.on "changed", changeHandler = jasmine.createSpy('changeHandler') @@ -313,7 +313,7 @@ describe "TokenizedBuffer", -> beforeEach -> atom.packages.activatePackage('language-coffee-script', sync: true) buffer = atom.project.bufferForPathSync('sample-with-tabs.coffee') - tokenizedBuffer = atom.create(new TokenizedBuffer({buffer})) + tokenizedBuffer = new TokenizedBuffer({buffer}) startTokenizing(tokenizedBuffer) afterEach -> @@ -347,7 +347,7 @@ describe "TokenizedBuffer", -> 'abc\uD835\uDF97def' //\uD835\uDF97xyz """ - tokenizedBuffer = atom.create(new TokenizedBuffer({buffer})) + tokenizedBuffer = new TokenizedBuffer({buffer}) fullyTokenize(tokenizedBuffer) afterEach -> @@ -384,7 +384,7 @@ describe "TokenizedBuffer", -> buffer = atom.project.bufferForPathSync() buffer.setText "
<%= User.find(2).full_name %>
" - tokenizedBuffer = atom.create(new TokenizedBuffer({buffer})) + tokenizedBuffer = new TokenizedBuffer({buffer}) tokenizedBuffer.setGrammar(atom.syntax.selectGrammar('test.erb')) fullyTokenize(tokenizedBuffer) @@ -403,7 +403,7 @@ describe "TokenizedBuffer", -> it "returns the correct token (regression)", -> buffer = atom.project.bufferForPathSync('sample.js') - tokenizedBuffer = atom.create(new TokenizedBuffer({buffer})) + tokenizedBuffer = new TokenizedBuffer({buffer}) fullyTokenize(tokenizedBuffer) expect(tokenizedBuffer.tokenForPosition([1,0]).scopes).toEqual ["source.js"] expect(tokenizedBuffer.tokenForPosition([1,1]).scopes).toEqual ["source.js"] @@ -412,7 +412,7 @@ describe "TokenizedBuffer", -> describe ".bufferRangeForScopeAtPosition(selector, position)", -> beforeEach -> buffer = atom.project.bufferForPathSync('sample.js') - tokenizedBuffer = atom.create(new TokenizedBuffer({buffer})) + tokenizedBuffer = new TokenizedBuffer({buffer}) fullyTokenize(tokenizedBuffer) describe "when the selector does not match the token at the position", -> @@ -431,7 +431,7 @@ describe "TokenizedBuffer", -> it "updates the tab length of the tokenized lines", -> buffer = atom.project.bufferForPathSync('sample.js') buffer.setText('\ttest') - tokenizedBuffer = atom.create(new TokenizedBuffer({buffer})) + tokenizedBuffer = new TokenizedBuffer({buffer}) fullyTokenize(tokenizedBuffer) expect(tokenizedBuffer.tokenForPosition([0,0]).value).toBe ' ' atom.config.set('editor.tabLength', 6) diff --git a/spec/window-spec.coffee b/spec/window-spec.coffee index e83f7c43c..53f992555 100644 --- a/spec/window-spec.coffee +++ b/spec/window-spec.coffee @@ -93,8 +93,8 @@ describe "Window", -> atom.unloadEditorWindow() - expect(atom.state.getObject('workspaceView')).toEqual workspaceViewState - expect(atom.state.getObject('syntax')).toEqual syntaxState + expect(atom.state.workspaceView).toEqual workspaceViewState + expect(atom.state.syntax).toEqual syntaxState expect(atom.saveSync).toHaveBeenCalled() it "unsubscribes from all buffers", -> diff --git a/src/atom.coffee b/src/atom.coffee index b2a12d071..91e02f2d6 100644 --- a/src/atom.coffee +++ b/src/atom.coffee @@ -9,12 +9,10 @@ dialog = remote.require 'dialog' app = remote.require 'app' _ = require 'underscore-plus' -telepath = require 'telepath' -{Model} = telepath +{Model} = require 'reactionary' fs = require 'fs-plus' {$} = require './space-pen-extensions' -SiteShim = require './site-shim' WindowEventHandler = require './window-event-handler' # Public: Atom global for dealing with packages, themes, menus, and the window. @@ -35,6 +33,8 @@ WindowEventHandler = require './window-event-handler' # * `atom.themes` - A {ThemeManager} instance module.exports = class Atom extends Model + @version: 1 + # Public: Load or create the Atom environment in the given mode # # - mode: Pass 'editor' or 'spec' depending on the kind of environment you @@ -42,28 +42,27 @@ class Atom extends Model # # Returns an Atom instance, fully initialized @loadOrCreate: (mode) -> - telepath.devMode = not @isReleasedVersion() + @deserialize(@loadState(mode)) ? new this({mode, @version}) - if documentState = @loadDocumentState(mode) - environment = @deserialize(documentState) - - environment ? @createAsRoot({mode}) + # Private: Deserializes the Atom environment from a state object + @deserialize: (state) -> + new this(state) if state?.version is @version # Private: Loads and returns the serialized state corresponding to this window # if it exists; otherwise returns undefined. - @loadDocumentState: (mode) -> + @loadState: (mode) -> statePath = @getStatePath(mode) if fs.existsSync(statePath) try - documentStateString = fs.readFileSync(statePath, 'utf8') + stateString = fs.readFileSync(statePath, 'utf8') catch error console.warn "Error reading window state: #{statePath}", error.stack, error else - documentStateString = @getLoadSettings().windowState + stateString = @getLoadSettings().windowState try - JSON.parse(documentStateString) if documentStateString? + JSON.parse(stateString) if documentStateString? catch error console.warn "Error parsing window state: #{statePath} #{error.stack}", error @@ -112,14 +111,11 @@ class Atom extends Model @isReleasedVersion: -> not /\w{7}/.test(@getVersion()) # Check if the release is a 7-character SHA prefix - @properties - mode: null - project: null - workspaceViewParentSelector: 'body' - # Private: Called by telepath. I'd like this to be merged with initialize eventually. - created: -> + # Private: Call .loadOrCreate instead + constructor: (@state) -> + {@mode} = @state DeserializerManager = require './deserializer-manager' @deserializers = new DeserializerManager(this) @@ -150,8 +146,7 @@ class Atom extends Model @contextMenu = new ContextMenuManager(devMode) @menu = new MenuManager({resourcePath}) @pasteboard = new Pasteboard() - @syntax = @deserializers.deserialize(@state.get('syntax')) ? new Syntax() - @site = new SiteShim(this) + @syntax = @deserializers.deserialize(@state.syntax) ? new Syntax() @subscribe @packages, 'activated', => @watchThemes() @@ -160,11 +155,15 @@ class Atom extends Model TokenizedBuffer = require './tokenized-buffer' DisplayBuffer = require './display-buffer' Editor = require './editor' - @registerRepresentationClasses(Project, TextBuffer, TokenizedBuffer, DisplayBuffer, Editor) - @createRepresentations() @windowEventHandler = new WindowEventHandler + # Deprecated: Callers should be converted to use atom.deserializers + registerRepresentationClass: -> + + # Deprecated: Callers should be converted to use atom.deserializers + registerRepresentationClasses: -> + # Private: setBodyPlatformClass: -> document.body.classList.add("platform-#{process.platform}") @@ -204,7 +203,7 @@ class Atom extends Model # Private: restoreWindowDimensions: -> - windowDimensions = @state.getObject('windowDimensions') ? {} + windowDimensions = @state.windowDimensions ? {} {initialSize} = @getLoadSettings() windowDimensions.height ?= initialSize?.height ? global.screen.availHeight windowDimensions.width ?= initialSize?.width ? Math.min(global.screen.availWidth, 1024) @@ -212,7 +211,7 @@ class Atom extends Model # Private: storeWindowDimensions: -> - @state.set('windowDimensions', @getWindowDimensions()) + @state.windowDimensions = @getWindowDimensions() # Public: Get the load settings for the current window. # @@ -228,16 +227,13 @@ class Atom extends Model # Private: deserializeWorkspaceView: -> WorkspaceView = require './workspace-view' - @workspaceView = @deserializers.deserialize(@state.get('workspaceView')) - unless @workspaceView? - @workspaceView = new WorkspaceView() - @state.set('workspaceView', @workspaceView.serialize()) + @workspaceView = @deserializers.deserialize(@state.workspaceView) ? new WorkspaceView $(@workspaceViewParentSelector).append(@workspaceView) # Private: deserializePackageStates: -> - @packages.packageStates = @state.getObject('packageStates') ? {} - @state.remove('packageStates') + @packages.packageStates = @state.packageStates ? {} + delete @state.packageStates # Private: deserializeEditorWindow: -> @@ -259,7 +255,6 @@ class Atom extends Model @keymap.loadBundledKeymaps() @themes.loadBaseStylesheets() @packages.loadPackages() - @createRepresentations() @deserializeEditorWindow() @packages.activate() @keymap.loadUserKeymap() @@ -277,10 +272,10 @@ class Atom extends Model unloadEditorWindow: -> return if not @project and not @workspaceView - @state.set('syntax', @syntax.serialize()) - @state.set('workspaceView', @workspaceView.serialize()) + @state.syntax = @syntax.serialize() + @state.workspaceView = @workspaceView.serialize() @packages.deactivatePackages() - @state.set('packageStates', @packages.packageStates) + @state.packageStates = @packages.packageStates @saveSync() @workspaceView.remove() @workspaceView = null @@ -392,7 +387,7 @@ class Atom extends Model setImmediate => @show() @focus() - @setFullScreen(true) if @workspaceView.getState().get('fullScreen') + @setFullScreen(true) if @workspaceView.fullScreen # Public: Close the current window. close: -> @@ -448,11 +443,11 @@ class Atom extends Model # Private: saveSync: -> + stateString = JSON.stringify(@state) if statePath = @constructor.getStatePath(@mode) - super(statePath) + fs.writeFileSync(statePath, stateString, 'utf8') else - @getCurrentWindow().loadSettings.windowState = JSON.stringify(@serializeForPersistence()) - + @getCurrentWindow().loadSettings.windowState = stateString # Public: Get the time taken to completely load the current window. # diff --git a/src/deserializer-manager.coffee b/src/deserializer-manager.coffee index 6bcc332ce..60df24b0a 100644 --- a/src/deserializer-manager.coffee +++ b/src/deserializer-manager.coffee @@ -1,5 +1,3 @@ -{TelepathicObject, Model} = require 'telepath' - # Public: Manages the deserializers used for serialized state # # Should be accessed via `atom.deserializers` @@ -12,12 +10,10 @@ class DeserializerManager # Public: Register the given class(es) as deserializers. add: (klasses...) -> @deserializers[klass.name] = klass for klass in klasses - @environment?.registerRepresentationClasses(klasses...) # Public: Add a deferred deserializer for the given class name. addDeferred: (name, fn) -> @deferredDeserializers[name] = fn - @environment?.registerDeferredRepresentationClass(name, fn) # Public: Remove the given class(es) as deserializers. remove: (klasses...) -> @@ -26,13 +22,10 @@ class DeserializerManager # Public: Deserialize the state and params. deserialize: (state, params) -> return unless state? - return state unless state.constructor is Object or state instanceof TelepathicObject if deserializer = @get(state) stateVersion = state.get?('version') ? state.version return if deserializer.version? and deserializer.version isnt stateVersion - if (state instanceof TelepathicObject) and not deserializer.acceptsDocuments - state = state.toObject() deserializer.deserialize(state, params) else console.warn "No deserializer found for", state diff --git a/src/display-buffer.coffee b/src/display-buffer.coffee index 0c477db7f..5dfd9d60d 100644 --- a/src/display-buffer.coffee +++ b/src/display-buffer.coffee @@ -56,7 +56,7 @@ class DisplayBuffer extends Model params copy: -> - newDisplayBuffer = atom.create(new DisplayBuffer({@buffer, tabLength: @getTabLength()})) + newDisplayBuffer = new DisplayBuffer({@buffer, tabLength: @getTabLength()}) for marker in @findMarkers(displayBufferId: @id) marker.copy(displayBufferId: newDisplayBuffer.id) newDisplayBuffer diff --git a/src/editor-view.coffee b/src/editor-view.coffee index d0d2e4f72..6e1a4a894 100644 --- a/src/editor-view.coffee +++ b/src/editor-view.coffee @@ -105,12 +105,12 @@ class EditorView extends View if editor? @edit(editor) else if @mini - @edit(atom.create(new Editor - buffer: atom.create(new TextBuffer) + @edit(new Editor + buffer: new TextBuffer softWrap: false tabLength: 2 softTabs: true - )) + ) else throw new Error("Must supply an Editor or mini: true") diff --git a/src/selection-view.coffee b/src/selection-view.coffee index a5089a0b2..beea12f47 100644 --- a/src/selection-view.coffee +++ b/src/selection-view.coffee @@ -1,4 +1,4 @@ -{Point, Range} = require 'telepath' +{Point, Range} = require 'text-buffer' {View, $$} = require './space-pen-extensions' # Internal: diff --git a/src/selection.coffee b/src/selection.coffee index e18e8b343..f470c0d8b 100644 --- a/src/selection.coffee +++ b/src/selection.coffee @@ -1,4 +1,4 @@ -{Range} = require 'telepath' +{Range} = require 'text-buffer' {Emitter} = require 'emissary' {pick} = require 'underscore-plus' diff --git a/src/site-shim.coffee b/src/site-shim.coffee deleted file mode 100644 index 0f1751a01..000000000 --- a/src/site-shim.coffee +++ /dev/null @@ -1,8 +0,0 @@ -# Private: TODO remove once telepath upgrades are complete. -module.exports = -class SiteShim - constructor: (@environment) -> - {@id} = @environment.state.siteId - - createDocument: (values) -> - @environment.create(values) diff --git a/src/workspace-view.coffee b/src/workspace-view.coffee index 975113bb6..e5816927a 100644 --- a/src/workspace-view.coffee +++ b/src/workspace-view.coffee @@ -59,7 +59,7 @@ class WorkspaceView extends View @div class: 'panes', outlet: 'panes' # Private: - initialize: ({panes}={}) -> + initialize: ({panes, @fullScreen}={}) -> panes ?= new PaneContainer @panes.replaceWith(panes) @panes = panes From 0bbd9630f5dd6f56a6dce044507138d6e9366c06 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Fri, 3 Jan 2014 17:50:46 -0700 Subject: [PATCH 34/68] Fix pane spec --- spec/pane-spec.coffee | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/spec/pane-spec.coffee b/spec/pane-spec.coffee index 3a77c3892..6851bb8f4 100644 --- a/spec/pane-spec.coffee +++ b/spec/pane-spec.coffee @@ -693,8 +693,7 @@ describe "Pane", -> pane.showItem(new Unserializable) - state = pane.testSerialization() - newPane = atom.deserializers.deserialize(state) + newPane = pane.testSerialization() expect(newPane.activeItem).toEqual pane.items[0] expect(newPane.items.length).toBe pane.items.length - 1 From a68694e6e2cc18fdc65e99837678198ee444aadc Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Fri, 3 Jan 2014 17:54:59 -0700 Subject: [PATCH 35/68] Upgrade to nostalgia 0.3.0 for ability to override mixin properties --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 55d667b94..596fe8c6d 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "mkdirp": "0.3.5", "keytar": "0.13.0", "less-cache": "0.10.0", - "nostalgia": "0.2.0", + "nostalgia": "0.3.0", "nslog": "0.1.0", "oniguruma": "0.24.0", "optimist": "0.4.0", From 8da9e8ddc1ffb42a5f43602bc29b6432b80d8706 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Fri, 3 Jan 2014 18:32:44 -0700 Subject: [PATCH 36/68] Rename nostalgia to serializable This name was surprisingly available and better matches this module's utilitarian nature. --- package.json | 2 +- src/display-buffer.coffee | 2 +- src/editor.coffee | 2 +- src/pane-axis.coffee | 2 +- src/pane-container.coffee | 2 +- src/pane.coffee | 2 +- src/project.coffee | 2 +- src/text-buffer.coffee | 2 +- src/tokenized-buffer.coffee | 2 +- src/workspace-view.coffee | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 596fe8c6d..62d65ca6b 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "mkdirp": "0.3.5", "keytar": "0.13.0", "less-cache": "0.10.0", - "nostalgia": "0.3.0", + "serializable": "0.1.0", "nslog": "0.1.0", "oniguruma": "0.24.0", "optimist": "0.4.0", diff --git a/src/display-buffer.coffee b/src/display-buffer.coffee index fef2a7c4e..1968bd19e 100644 --- a/src/display-buffer.coffee +++ b/src/display-buffer.coffee @@ -1,7 +1,7 @@ _ = require 'underscore-plus' {Emitter, Subscriber} = require 'emissary' guid = require 'guid' -Serializable = require 'nostalgia' +Serializable = require 'serializable' {Model} = require 'reactionary' {Point, Range} = require 'text-buffer' TokenizedBuffer = require './tokenized-buffer' diff --git a/src/editor.coffee b/src/editor.coffee index 1def842e2..7130c61ed 100644 --- a/src/editor.coffee +++ b/src/editor.coffee @@ -1,6 +1,6 @@ _ = require 'underscore-plus' path = require 'path' -Serializable = require 'nostalgia' +Serializable = require 'serializable' {Model} = require 'reactionary' {Point, Range} = require 'text-buffer' LanguageMode = require './language-mode' diff --git a/src/pane-axis.coffee b/src/pane-axis.coffee index eecf3ee17..e256c58be 100644 --- a/src/pane-axis.coffee +++ b/src/pane-axis.coffee @@ -1,4 +1,4 @@ -Serializable = require 'nostalgia' +Serializable = require 'serializable' {$, View} = require './space-pen-extensions' ### Internal ### diff --git a/src/pane-container.coffee b/src/pane-container.coffee index 601a49765..4ecda8359 100644 --- a/src/pane-container.coffee +++ b/src/pane-container.coffee @@ -1,4 +1,4 @@ -Serializable = require 'nostalgia' +Serializable = require 'serializable' {$, View} = require './space-pen-extensions' Pane = require './pane' diff --git a/src/pane.coffee b/src/pane.coffee index 6ceb09ca6..d976a95f0 100644 --- a/src/pane.coffee +++ b/src/pane.coffee @@ -1,7 +1,7 @@ {dirname} = require 'path' {$, View} = require './space-pen-extensions' _ = require 'underscore-plus' -Serializable = require 'nostalgia' +Serializable = require 'serializable' PaneRow = require './pane-row' PaneColumn = require './pane-column' diff --git a/src/project.coffee b/src/project.coffee index e435b3008..ebbe2b1fe 100644 --- a/src/project.coffee +++ b/src/project.coffee @@ -6,7 +6,7 @@ fs = require 'fs-plus' Q = require 'q' {Model} = require 'reactionary' {Emitter, Subscriber} = require 'emissary' -Serializable = require 'nostalgia' +Serializable = require 'serializable' TextBuffer = require './text-buffer' Editor = require './editor' diff --git a/src/text-buffer.coffee b/src/text-buffer.coffee index b5e418bfa..52c007bff 100644 --- a/src/text-buffer.coffee +++ b/src/text-buffer.coffee @@ -2,7 +2,7 @@ _ = require 'underscore-plus' diff = require 'diff' Q = require 'q' {P} = require 'scandal' -Serializable = require 'nostalgia' +Serializable = require 'serializable' TextBufferCore = require 'text-buffer' {Point, Range} = TextBufferCore {Subscriber, Emitter} = require 'emissary' diff --git a/src/tokenized-buffer.coffee b/src/tokenized-buffer.coffee index 57d94e203..f3d5d487d 100644 --- a/src/tokenized-buffer.coffee +++ b/src/tokenized-buffer.coffee @@ -1,7 +1,7 @@ _ = require 'underscore-plus' {Model} = require 'reactionary' {Point, Range} = require 'text-buffer' -Serializable = require 'nostalgia' +Serializable = require 'serializable' TokenizedLine = require './tokenized-line' Token = require './token' diff --git a/src/workspace-view.coffee b/src/workspace-view.coffee index 7059516c4..e13dab341 100644 --- a/src/workspace-view.coffee +++ b/src/workspace-view.coffee @@ -4,7 +4,7 @@ Q = require 'q' {$, $$, View} = require './space-pen-extensions' _ = require 'underscore-plus' fs = require 'fs-plus' -Serializable = require 'nostalgia' +Serializable = require 'serializable' EditorView = require './editor-view' Pane = require './pane' PaneColumn = require './pane-column' From cb7471945ccdec6db30183157bd0704373c31677 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Fri, 3 Jan 2014 19:35:07 -0700 Subject: [PATCH 37/68] Remove redundant 'destroyed' event --- src/editor.coffee | 1 - 1 file changed, 1 deletion(-) diff --git a/src/editor.coffee b/src/editor.coffee index 7130c61ed..3a0729214 100644 --- a/src/editor.coffee +++ b/src/editor.coffee @@ -124,7 +124,6 @@ class Editor extends Model @displayBuffer.destroy() @languageMode.destroy() atom.project?.removeEditor(this) - @emit 'destroyed' @off() # Private: Creates an {Editor} with the same initial state From 289e7d56c334c998eb916203cf87d7a2c129d32b Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Sat, 4 Jan 2014 09:39:30 -0700 Subject: [PATCH 38/68] Upgrade to reactionary 0.2.0 for built-in property accessors mixin --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 62d65ca6b..cb57828a4 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "temp": "0.5.0", "text-buffer": "0.3.0", "underscore-plus": "0.6.1", - "reactionary": "~0.1.0" + "reactionary": "~0.2.0" }, "packageDependencies": { "atom-dark-syntax": "0.10.0", From 0292c66f93b747f243833d500d55f166d637b342 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Sat, 4 Jan 2014 10:08:04 -0700 Subject: [PATCH 39/68] Don't drop editor subscriptions in its destroyed hook Unsubscribing should be the responsibility of the subscribers and doing this was removing 'destroyed' subscriptions before the 'destroyed' event was emitted now that 'destroyed' is emitted by the default Model::destroy method. --- src/editor.coffee | 1 - 1 file changed, 1 deletion(-) diff --git a/src/editor.coffee b/src/editor.coffee index 3a0729214..ad685d5b1 100644 --- a/src/editor.coffee +++ b/src/editor.coffee @@ -124,7 +124,6 @@ class Editor extends Model @displayBuffer.destroy() @languageMode.destroy() atom.project?.removeEditor(this) - @off() # Private: Creates an {Editor} with the same initial state copy: -> From aa1ed1dfcc17329823ea08ce40844d650786aee5 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Sat, 4 Jan 2014 10:23:08 -0700 Subject: [PATCH 40/68] Upgrade to reactionary 0.3.0 to avoid double destruction --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6ffcfb5c1..423475844 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "temp": "0.5.0", "text-buffer": "0.3.0", "underscore-plus": "0.6.1", - "reactionary": "~0.2.0" + "reactionary": "~0.3.0" }, "packageDependencies": { "atom-dark-syntax": "0.10.0", From ebb5d38e1a47d7779f6e272005723e038b34c509 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Sat, 4 Jan 2014 10:49:30 -0700 Subject: [PATCH 41/68] Upgrade packages to remove telepath dependencies --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 423475844..6230f5755 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "base16-tomorrow-dark-theme": "0.8.0", "solarized-dark-syntax": "0.6.0", "solarized-light-syntax": "0.2.0", - "archive-view": "0.17.0", + "archive-view": "0.18.0", "autocomplete": "0.19.0", "autoflow": "0.11.0", "autosave": "0.10.0", @@ -81,14 +81,14 @@ "github-sign-in": "0.15.0", "go-to-line": "0.12.0", "grammar-selector": "0.15.0", - "image-view": "0.11.0", + "image-view": "0.12.0", "keybinding-resolver": "0.8.0", "link": "0.11.0", "markdown-preview": "0.22.0", "metrics": "0.20.0", "package-generator": "0.23.0", "release-notes": "0.15.0", - "settings-view": "0.52.0", + "settings-view": "0.54.0", "snippets": "0.17.0", "spell-check": "0.18.0", "status-bar": "0.29.0", From 9068f28e83fa670da7531eadc9fd1d7c7c5b9f84 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Sat, 4 Jan 2014 14:08:00 -0700 Subject: [PATCH 42/68] Fix variable name --- src/atom.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/atom.coffee b/src/atom.coffee index 2e6413352..56373d40c 100644 --- a/src/atom.coffee +++ b/src/atom.coffee @@ -62,7 +62,7 @@ class Atom extends Model stateString = @getLoadSettings().windowState try - JSON.parse(stateString) if documentStateString? + JSON.parse(stateString) if stateString? catch error console.warn "Error parsing window state: #{statePath} #{error.stack}", error From 194094043efc416232ef7e0a0c9d83f6d7f29f49 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Sat, 4 Jan 2014 14:09:10 -0700 Subject: [PATCH 43/68] Upgrade tree-view to 0.54.0 to remove telepath dependency --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6230f5755..76619845b 100644 --- a/package.json +++ b/package.json @@ -98,7 +98,7 @@ "terminal": "0.23.0", "timecop": "0.11.0", "to-the-hubs": "0.16.0", - "tree-view": "0.53.0", + "tree-view": "0.54.0", "visual-bell": "0.6.0", "welcome": "0.4.0", "whitespace": "0.10.0", From 8b9ede8414c8588da320300890e472278cf7c02f Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Sat, 4 Jan 2014 14:16:07 -0700 Subject: [PATCH 44/68] Upgrade text-buffer to 0.4.0 to allow 'invalidation' marker option --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 76619845b..9c0cde546 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "semver": "1.1.4", "space-pen": "2.0.2", "temp": "0.5.0", - "text-buffer": "0.3.0", + "text-buffer": "0.4.0", "underscore-plus": "0.6.1", "reactionary": "~0.3.0" }, From 1fe0a1ad7b3bd251378b95d10b95b9d83d9bfe02 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Sat, 4 Jan 2014 15:42:53 -0700 Subject: [PATCH 45/68] Upgrade to text-buffer 0.5.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9c0cde546..9df9d6743 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "semver": "1.1.4", "space-pen": "2.0.2", "temp": "0.5.0", - "text-buffer": "0.4.0", + "text-buffer": "0.5.0", "underscore-plus": "0.6.1", "reactionary": "~0.3.0" }, From cbec03c1583aa80added1d05212a4399d5df5ac5 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Sat, 4 Jan 2014 15:55:27 -0700 Subject: [PATCH 46/68] Rename reactionary to theorist --- exports/atom.coffee | 2 +- package.json | 6 +++--- src/atom.coffee | 2 +- src/display-buffer.coffee | 2 +- src/editor.coffee | 2 +- src/project.coffee | 2 +- src/tokenized-buffer.coffee | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/exports/atom.coffee b/exports/atom.coffee index fac7165f1..8422ca4c0 100644 --- a/exports/atom.coffee +++ b/exports/atom.coffee @@ -1,4 +1,4 @@ -{Model} = require 'reactionary' +{Model} = require 'theorist' {Point, Range} = require 'text-buffer' module.exports = diff --git a/package.json b/package.json index 9df9d6743..d636a3651 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "temp": "0.5.0", "text-buffer": "0.5.0", "underscore-plus": "0.6.1", - "reactionary": "~0.3.0" + "theorist": "~0.7.0" }, "packageDependencies": { "atom-dark-syntax": "0.10.0", @@ -81,7 +81,7 @@ "github-sign-in": "0.15.0", "go-to-line": "0.12.0", "grammar-selector": "0.15.0", - "image-view": "0.12.0", + "image-view": "0.14.0", "keybinding-resolver": "0.8.0", "link": "0.11.0", "markdown-preview": "0.22.0", @@ -98,7 +98,7 @@ "terminal": "0.23.0", "timecop": "0.11.0", "to-the-hubs": "0.16.0", - "tree-view": "0.54.0", + "tree-view": "0.56.0", "visual-bell": "0.6.0", "welcome": "0.4.0", "whitespace": "0.10.0", diff --git a/src/atom.coffee b/src/atom.coffee index 56373d40c..9ddc4dfd8 100644 --- a/src/atom.coffee +++ b/src/atom.coffee @@ -9,7 +9,7 @@ dialog = remote.require 'dialog' app = remote.require 'app' _ = require 'underscore-plus' -{Model} = require 'reactionary' +{Model} = require 'theorist' fs = require 'fs-plus' {$} = require './space-pen-extensions' diff --git a/src/display-buffer.coffee b/src/display-buffer.coffee index 1968bd19e..dcb320064 100644 --- a/src/display-buffer.coffee +++ b/src/display-buffer.coffee @@ -2,7 +2,7 @@ _ = require 'underscore-plus' {Emitter, Subscriber} = require 'emissary' guid = require 'guid' Serializable = require 'serializable' -{Model} = require 'reactionary' +{Model} = require 'theorist' {Point, Range} = require 'text-buffer' TokenizedBuffer = require './tokenized-buffer' RowMap = require './row-map' diff --git a/src/editor.coffee b/src/editor.coffee index ad685d5b1..cff06ddfc 100644 --- a/src/editor.coffee +++ b/src/editor.coffee @@ -1,7 +1,7 @@ _ = require 'underscore-plus' path = require 'path' Serializable = require 'serializable' -{Model} = require 'reactionary' +{Model} = require 'theorist' {Point, Range} = require 'text-buffer' LanguageMode = require './language-mode' DisplayBuffer = require './display-buffer' diff --git a/src/project.coffee b/src/project.coffee index ebbe2b1fe..7a32a933e 100644 --- a/src/project.coffee +++ b/src/project.coffee @@ -4,7 +4,7 @@ url = require 'url' _ = require 'underscore-plus' fs = require 'fs-plus' Q = require 'q' -{Model} = require 'reactionary' +{Model} = require 'theorist' {Emitter, Subscriber} = require 'emissary' Serializable = require 'serializable' diff --git a/src/tokenized-buffer.coffee b/src/tokenized-buffer.coffee index f3d5d487d..bb28a708e 100644 --- a/src/tokenized-buffer.coffee +++ b/src/tokenized-buffer.coffee @@ -1,5 +1,5 @@ _ = require 'underscore-plus' -{Model} = require 'reactionary' +{Model} = require 'theorist' {Point, Range} = require 'text-buffer' Serializable = require 'serializable' TokenizedLine = require './tokenized-line' From 8d4ae33134261c65b4fa10fd02630554188d6c14 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Sun, 5 Jan 2014 10:47:22 -0700 Subject: [PATCH 47/68] Don't export Model superclass in top-level atom module Previously, the semantics of telepath's Model class were coupled to the wrapped documents, so it made sense to export the Model. But now that Model is much simpler, it makes more sense to allow individual packages to rely on their own version of Model by requiring theorist if they want to so we can make changes to the version of model used by core without breaking packages. --- exports/atom.coffee | 2 -- 1 file changed, 2 deletions(-) diff --git a/exports/atom.coffee b/exports/atom.coffee index 8422ca4c0..c5a7ffb63 100644 --- a/exports/atom.coffee +++ b/exports/atom.coffee @@ -1,4 +1,3 @@ -{Model} = require 'theorist' {Point, Range} = require 'text-buffer' module.exports = @@ -9,7 +8,6 @@ module.exports = File: require '../src/file' fs: require 'fs-plus' Git: require '../src/git' - Model: Model Point: Point Range: Range From cec731b697fb5ef3062140e226591e736a350e69 Mon Sep 17 00:00:00 2001 From: Matt Colyer Date: Mon, 6 Jan 2014 11:17:34 -0800 Subject: [PATCH 48/68] Windows build status reflects package status now --- build/tasks/spec-task.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/tasks/spec-task.coffee b/build/tasks/spec-task.coffee index 13ef31852..c2f4d6826 100644 --- a/build/tasks/spec-task.coffee +++ b/build/tasks/spec-task.coffee @@ -109,4 +109,4 @@ module.exports = (grunt) -> if process.platform is 'darwin' done(!coreSpecFailed and failedPackages.length == 0) else if process.platform is 'win32' - done(true) + done(failedPackages.length == 0) From 25cc37bc868757fc6a47125742f41489047cd865 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 6 Jan 2014 15:13:12 -0700 Subject: [PATCH 49/68] Replace {StringMarker} references with {Marker} in API docs --- src/cursor.coffee | 2 +- src/display-buffer-marker.coffee | 8 ++++---- src/display-buffer.coffee | 12 ++++++------ src/text-buffer.coffee | 8 ++++---- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/cursor.coffee b/src/cursor.coffee index c5bd64556..daf91e4dc 100644 --- a/src/cursor.coffee +++ b/src/cursor.coffee @@ -6,7 +6,7 @@ _ = require 'underscore-plus' # where text can be inserted. # # Cursors belong to {Editor}s and have some metadata attached in the form -# of a {StringMarker}. +# of a {Marker}. module.exports = class Cursor Emitter.includeInto(this) diff --git a/src/display-buffer-marker.coffee b/src/display-buffer-marker.coffee index 9a1e055f2..05f5d67b3 100644 --- a/src/display-buffer-marker.coffee +++ b/src/display-buffer-marker.coffee @@ -42,7 +42,7 @@ class DisplayBufferMarker # Modifies the screen range of the display marker. # # screenRange - The new {Range} to use - # options - A hash of options matching those found in {StringMarker.setRange} + # options - A hash of options matching those found in {Marker.setRange} setScreenRange: (screenRange, options) -> @setBufferRange(@displayBuffer.bufferRangeForScreenRange(screenRange), options) @@ -55,7 +55,7 @@ class DisplayBufferMarker # Modifies the buffer range of the display marker. # # screenRange - The new {Range} to use - # options - A hash of options matching those found in {StringMarker.setRange} + # options - A hash of options matching those found in {Marker.setRange} setBufferRange: (bufferRange, options) -> @bufferMarker.setRange(bufferRange, options) @@ -140,7 +140,7 @@ class DisplayBufferMarker # Returns a {Boolean} indicating whether the marker has been destroyed. A marker # can be invalid without being destroyed, in which case undoing the invalidating # operation would restore the marker. Once a marker is destroyed by calling - # {StringMarker.destroy}, no undo/redo operation can ever bring it back. + # {Marker.destroy}, no undo/redo operation can ever bring it back. isDestroyed: -> @bufferMarker.isDestroyed() @@ -151,7 +151,7 @@ class DisplayBufferMarker @bufferMarker.setAttributes(attributes) matchesAttributes: (attributes) -> - attributes = @displayBuffer.translateToStringMarkerAttributes(attributes) + attributes = @displayBuffer.translateToBufferMarkerAttributes(attributes) @bufferMarker.matchesAttributes(attributes) # Destroys the marker diff --git a/src/display-buffer.coffee b/src/display-buffer.coffee index dcb320064..a7904fcad 100644 --- a/src/display-buffer.coffee +++ b/src/display-buffer.coffee @@ -469,7 +469,7 @@ class DisplayBuffer extends Model # Constructs a new marker at the given screen range. # # range - The marker {Range} (representing the distance between the head and tail) - # options - Options to pass to the {StringMarker} constructor + # options - Options to pass to the {Marker} constructor # # Returns a {Number} representing the new marker's ID. markScreenRange: (args...) -> @@ -479,7 +479,7 @@ class DisplayBuffer extends Model # Constructs a new marker at the given buffer range. # # range - The marker {Range} (representing the distance between the head and tail) - # options - Options to pass to the {StringMarker} constructor + # options - Options to pass to the {Marker} constructor # # Returns a {Number} representing the new marker's ID. markBufferRange: (args...) -> @@ -488,7 +488,7 @@ class DisplayBuffer extends Model # Constructs a new marker at the given screen position. # # range - The marker {Range} (representing the distance between the head and tail) - # options - Options to pass to the {StringMarker} constructor + # options - Options to pass to the {Marker} constructor # # Returns a {Number} representing the new marker's ID. markScreenPosition: (screenPosition, options) -> @@ -497,7 +497,7 @@ class DisplayBuffer extends Model # Constructs a new marker at the given buffer position. # # range - The marker {Range} (representing the distance between the head and tail) - # options - Options to pass to the {StringMarker} constructor + # options - Options to pass to the {Marker} constructor # # Returns a {Number} representing the new marker's ID. markBufferPosition: (bufferPosition, options) -> @@ -527,10 +527,10 @@ class DisplayBuffer extends Model # # Returns an {Array} of {DisplayBufferMarker}s findMarkers: (attributes) -> - attributes = @translateToStringMarkerAttributes(attributes) + attributes = @translateToBufferMarkerAttributes(attributes) @buffer.findMarkers(attributes).map (stringMarker) => @getMarker(stringMarker.id) - translateToStringMarkerAttributes: (attributes) -> + translateToBufferMarkerAttributes: (attributes) -> stringMarkerAttributes = {} for key, value of attributes switch key diff --git a/src/text-buffer.coffee b/src/text-buffer.coffee index 52c007bff..ec298c8e7 100644 --- a/src/text-buffer.coffee +++ b/src/text-buffer.coffee @@ -458,10 +458,10 @@ class TextBuffer extends TextBufferCore # Returns a {Boolean}. isEmpty: -> super - # Returns all valid {StringMarker}s on the buffer. + # Returns all valid {Marker}s on the buffer. getMarkers: -> super - # Returns the {StringMarker} with the given id. + # Returns the {Marker} with the given id. getMarker: (id) -> super destroyMarker: (id) -> @@ -479,7 +479,7 @@ class TextBuffer extends TextBufferCore # startRow - The row at which the marker starts # endRow - The row at which the marker ends # - # Returns an {Array} of {StringMarker}s + # Returns an {Array} of {Marker}s findMarkers: (attributes) -> super # Retrieves the quantity of markers in a buffer. @@ -504,7 +504,7 @@ class TextBuffer extends TextBufferCore # Constructs a new marker at a given position. # # position - The marker {Point}; there won't be a tail - # options - Options to pass to the {StringMarker} constructor + # options - Options to pass to the {Marker} constructor # # Returns a {Number} representing the new marker's ID. markPosition: (position, options) -> super From d6de9735001aa8182e5064a9c800d50fa6e57308 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 6 Jan 2014 15:16:34 -0700 Subject: [PATCH 50/68] Remove shims that call `super` They were previously there for documentation purposes, but we've decided to document them in the text-buffer npm directly and link it into the documentation. This drops some of the docs on delegated methods, because our docs generator doesn't understand `delegatesMethods` declarations, but TextBuffer was marked private anyway so we can get back to it later. --- src/text-buffer.coffee | 120 ----------------------------------------- 1 file changed, 120 deletions(-) diff --git a/src/text-buffer.coffee b/src/text-buffer.coffee index ec298c8e7..f988975b6 100644 --- a/src/text-buffer.coffee +++ b/src/text-buffer.coffee @@ -262,45 +262,12 @@ class TextBuffer extends TextBufferCore lastRow = @getLastRow() new Range([0, 0], [lastRow, @lineLengthForRow(lastRow)]) - # Given a range, returns the lines of text within it. - # - # range - A {Range} object specifying your points of interest - # - # Returns a {String} of the combined lines. - getTextInRange: (range) -> super - - # Gets all the lines in a file. - # - # Returns an {Array} of {String}s. - getLines: -> super - - # Given a row, returns the line of text. - # - # row - A {Number} indicating the row. - # - # Returns a {String}. - lineForRow: (row) -> super - - # Given a row, returns its line ending. - # - # row - A {Number} indicating the row. - # - # Returns a {String}, or `undefined` if `row` is the final row. - lineEndingForRow: (row) -> super - suggestedLineEndingForRow: (row) -> if row is @getLastRow() @lineEndingForRow(row - 1) else @lineEndingForRow(row) - # Given a row, returns the length of the line of text. - # - # row - A {Number} indicating the row. - # - # Returns a {Number}. - lineLengthForRow: (row) -> super - # Given a row, returns the length of the line ending # # row - A {Number} indicating the row. @@ -322,16 +289,6 @@ class TextBuffer extends TextBufferCore else new Range([row, 0], [row, @lineLengthForRow(row)]) - # Gets the number of lines in a file. - # - # Returns a {Number}. - getLineCount: -> super - - # Gets the row number of the last line. - # - # Returns a {Number}. - getLastRow: -> super - # Finds the last line in the current buffer. # # Returns a {String}. @@ -345,10 +302,6 @@ class TextBuffer extends TextBufferCore lastRow = @getLastRow() new Point(lastRow, @lineLengthForRow(lastRow)) - characterIndexForPosition: (position) -> super - - positionForCharacterIndex: (index) -> super - # Given a row, this deletes it from the buffer. # # row - A {Number} representing the row to delete @@ -392,32 +345,6 @@ class TextBuffer extends TextBufferCore delete: (range) -> @change(range, '') - # Given a position, this clips it to a real position. - # - # For example, if `position`'s row exceeds the row count of the buffer, - # or if its column goes beyond a line's length, this "sanitizes" the value - # to a real position. - # - # Returns the new, clipped {Point}. Note that this could be the same as `position` if no clipping was performed. - clipPosition: (position) -> super - - # Given a range, this clips it to a real range. - # - # For example, if `range`'s row exceeds the row count of the buffer, - # or if its column goes beyond a line's length, this "sanitizes" the value - # to a real range. - # - # range - The {Range} to clip - # - # Returns the new, clipped {Range}. Note that this could be the same as `range` if no clipping was performed. - clipRange: (range) -> - range = Range.fromObject(range) - new Range(@clipPosition(range.start), @clipPosition(range.end)) - - undo: -> super - - redo: -> super - # Saves the buffer. save: -> @saveAs(@getPath()) if @isModified() @@ -453,62 +380,15 @@ class TextBuffer extends TextBufferCore # Returns a {Boolean}. isInConflict: -> @conflict - # Identifies if a buffer is empty. - # - # Returns a {Boolean}. - isEmpty: -> super - - # Returns all valid {Marker}s on the buffer. - getMarkers: -> super - - # Returns the {Marker} with the given id. - getMarker: (id) -> super - destroyMarker: (id) -> @getMarker(id)?.destroy() - # Public: Finds the first marker satisfying the given attributes - # - # Returns a {String} marker-identifier - findMarker: (attributes) -> super - - # Public: Finds all markers satisfying the given attributes - # - # attributes - The attributes against which to compare the markers' attributes - # There are some reserved keys that match against derived marker properties: - # startRow - The row at which the marker starts - # endRow - The row at which the marker ends - # - # Returns an {Array} of {Marker}s - findMarkers: (attributes) -> super - # Retrieves the quantity of markers in a buffer. # # Returns a {Number}. getMarkerCount: -> @getMarkers().length - # Constructs a new marker at a given range. - # - # range - The marker {Range} (representing the distance between the head and tail) - # attributes - An optional hash of serializable attributes - # Any attributes you pass will be associated with the marker and can be retrieved - # or used in marker queries. - # The following attribute keys reserved, and control the marker's initial range - # isReversed - if `true`, the marker is reversed; that is, its head precedes the tail - # hasTail - if `false`, the marker is created without a tail - # - # Returns a {Number} representing the new marker's ID. - markRange: (range, options={}) -> super - - # Constructs a new marker at a given position. - # - # position - The marker {Point}; there won't be a tail - # options - Options to pass to the {Marker} constructor - # - # Returns a {Number} representing the new marker's ID. - markPosition: (position, options) -> super - # Identifies if a character sequence is within a certain range. # # regex - The {RegExp} to check From a493359b584b6c4af68c479bdf3d5018cd0b4f11 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 6 Jan 2014 16:31:53 -0700 Subject: [PATCH 51/68] Upgrade text-buffer to 0.6.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d636a3651..39cfb8250 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "semver": "1.1.4", "space-pen": "2.0.2", "temp": "0.5.0", - "text-buffer": "0.5.0", + "text-buffer": "0.6.0", "underscore-plus": "0.6.1", "theorist": "~0.7.0" }, From 9add438ea4fc9967908d7565627e817044c39183 Mon Sep 17 00:00:00 2001 From: Matt Colyer Date: Mon, 6 Jan 2014 15:55:21 -0800 Subject: [PATCH 52/68] Revert "Windows build status reflects package status now" This reverts commit cec731b697fb5ef3062140e226591e736a350e69. --- build/tasks/spec-task.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/tasks/spec-task.coffee b/build/tasks/spec-task.coffee index c2f4d6826..13ef31852 100644 --- a/build/tasks/spec-task.coffee +++ b/build/tasks/spec-task.coffee @@ -109,4 +109,4 @@ module.exports = (grunt) -> if process.platform is 'darwin' done(!coreSpecFailed and failedPackages.length == 0) else if process.platform is 'win32' - done(failedPackages.length == 0) + done(true) From 14fd9aac7e4207a3f409513244a43a836321ad96 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 6 Jan 2014 17:16:03 -0700 Subject: [PATCH 53/68] Upgrade to text-buffer 0.7.0 to reintroduce Marker.fromPointWithDelta --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 39cfb8250..89adf605c 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "semver": "1.1.4", "space-pen": "2.0.2", "temp": "0.5.0", - "text-buffer": "0.6.0", + "text-buffer": "0.7.0", "underscore-plus": "0.6.1", "theorist": "~0.7.0" }, From 05ff058ca5e8dfcc502bd9549232ec7e53d9f2b9 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 6 Jan 2014 17:31:05 -0700 Subject: [PATCH 54/68] Upgrade to text-buffer 0.8.0 to restore all removed Point/Range methods --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 89adf605c..1c5a87698 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "semver": "1.1.4", "space-pen": "2.0.2", "temp": "0.5.0", - "text-buffer": "0.7.0", + "text-buffer": "0.8.0", "underscore-plus": "0.6.1", "theorist": "~0.7.0" }, From 5c1f750f94e4986516b815b2edfff02973dab86e Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 6 Jan 2014 18:07:53 -0700 Subject: [PATCH 55/68] Upgrade text-buffer to 0.9.0 for completed docs and fixed memory leak --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8d57577ae..9cb70adbd 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "semver": "1.1.4", "space-pen": "2.0.2", "temp": "0.5.0", - "text-buffer": "0.8.0", + "text-buffer": "0.9.0", "underscore-plus": "0.6.1", "theorist": "~0.7.0" }, From 1d2b2eec4cdd22398a775b1a89e2b8d008a30bb1 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 6 Jan 2014 08:49:45 -0800 Subject: [PATCH 56/68] Add Sync suffix to Directory::getEntries --- spec/directory-spec.coffee | 2 +- src/directory.coffee | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/directory-spec.coffee b/spec/directory-spec.coffee index c611a7b05..ba8a24045 100644 --- a/spec/directory-spec.coffee +++ b/spec/directory-spec.coffee @@ -68,7 +68,7 @@ describe "Directory", -> describe "on #darwin or #linux", -> it "includes symlink information about entries", -> - entries = directory.getEntries() + entries = directory.getEntriesSync() for entry in entries name = entry.getBaseName() if name is 'symlink-to-dir' or name is 'symlink-to-file' diff --git a/src/directory.coffee b/src/directory.coffee index 54433f6ca..9886a2edb 100644 --- a/src/directory.coffee +++ b/src/directory.coffee @@ -79,12 +79,12 @@ class Directory else fullPath - # Public: Reads file entries in this directory from disk. + # Public: Reads file entries in this directory from disk synchronously. # # Note: It follows symlinks. # - # Returns an Array of {Files}. - getEntries: -> + # Returns an Array of {File} and {Directory} objects. + getEntriesSync: -> directories = [] files = [] for entryPath in fs.listSync(@path) From a45ffb3aaafa4ff6865d1053f2c3bfa6169cf98e Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 6 Jan 2014 09:19:29 -0800 Subject: [PATCH 57/68] Add async Directory::getEntries --- package.json | 2 +- spec/directory-spec.coffee | 14 ++++++++++++++ src/directory.coffee | 31 ++++++++++++++++++++++++++++--- 3 files changed, 43 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 9cb70adbd..fbf9670fe 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "diff": "git://github.com/benogle/jsdiff.git", "emissary": "0.19.0", "first-mate": "0.11.0", - "fs-plus": "0.13.0", + "fs-plus": "0.14.0", "fstream": "0.1.24", "fuzzaldrin": "0.1.0", "git-utils": "0.29.0", diff --git a/spec/directory-spec.coffee b/spec/directory-spec.coffee index ba8a24045..0910f02fe 100644 --- a/spec/directory-spec.coffee +++ b/spec/directory-spec.coffee @@ -76,6 +76,20 @@ describe "Directory", -> else expect(entry.symlink).toBeFalsy() + callback = jasmine.createSpy('getEntries') + directory.getEntries(callback) + + waitsFor -> callback.callCount is 1 + + runs -> + entries = callback.mostRecentCall.args[0] + for entry in entries + name = entry.getBaseName() + if name is 'symlink-to-dir' or name is 'symlink-to-file' + expect(entry.symlink).toBeTruthy() + else + expect(entry.symlink).toBeFalsy() + describe ".relativize(path)", -> describe "on #darwin or #linux", -> it "returns a relative path based on the directory's path", -> diff --git a/src/directory.coffee b/src/directory.coffee index 9886a2edb..3711a7d80 100644 --- a/src/directory.coffee +++ b/src/directory.coffee @@ -1,8 +1,11 @@ path = require 'path' + +async = require 'async' +{Emitter} = require 'emissary' fs = require 'fs-plus' pathWatcher = require 'pathwatcher' + File = require './file' -{Emitter} = require 'emissary' # Public: Represents a directory using {File}s module.exports = @@ -81,8 +84,6 @@ class Directory # Public: Reads file entries in this directory from disk synchronously. # - # Note: It follows symlinks. - # # Returns an Array of {File} and {Directory} objects. getEntriesSync: -> directories = [] @@ -99,6 +100,30 @@ class Directory directories.concat(files) + # Public: Reads file entries in this directory from disk asynchronously. + # + # * callback: A function to call with an Error as the first argument and + # an Array of {File} and {Directory} objects as the second argument. + getEntries: (callback) -> + fs.list @path, (error, entries) -> + return callback(error) if error? + + directories = [] + files = [] + statEntry = (entryPath, callback) -> + fs.stat entryPath, (error, stat) -> + return callback() if error? + + fs.isSymbolicLink entryPath, (symlink) -> + if stat.isDirectory() + directories.push(new Directory(entryPath, symlink)) + else if stat.isFile() + files.push(new File(entryPath, symlink)) + callback() + + async.eachLimit entries, 1, statEntry, -> + callback(directories.concat(files)) + # Private: subscribeToNativeChangeEvents: -> unless @watchSubscription? From d618472f9508cd6df2af188217427b0249bc40dd Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 6 Jan 2014 13:34:02 -0800 Subject: [PATCH 58/68] Specify error as first argument --- spec/directory-spec.coffee | 2 +- src/directory.coffee | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/directory-spec.coffee b/spec/directory-spec.coffee index 0910f02fe..d11a5c067 100644 --- a/spec/directory-spec.coffee +++ b/spec/directory-spec.coffee @@ -82,7 +82,7 @@ describe "Directory", -> waitsFor -> callback.callCount is 1 runs -> - entries = callback.mostRecentCall.args[0] + entries = callback.mostRecentCall.args[1] for entry in entries name = entry.getBaseName() if name is 'symlink-to-dir' or name is 'symlink-to-file' diff --git a/src/directory.coffee b/src/directory.coffee index 3711a7d80..41832bf73 100644 --- a/src/directory.coffee +++ b/src/directory.coffee @@ -122,7 +122,7 @@ class Directory callback() async.eachLimit entries, 1, statEntry, -> - callback(directories.concat(files)) + callback(null, directories.concat(files)) # Private: subscribeToNativeChangeEvents: -> From f3e88b56f31770883c59ceb4073b6e0e9dd22a6d Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 6 Jan 2014 15:54:15 -0800 Subject: [PATCH 59/68] :racehorse: Reduce stat calls when building entries Previously every entry was stated twice to determine if it was a file/directory and a symbolic link. Now the second stat call is only made if lstat returns stat details for a symbolic link. --- src/directory.coffee | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/src/directory.coffee b/src/directory.coffee index 41832bf73..a9a2a3b8b 100644 --- a/src/directory.coffee +++ b/src/directory.coffee @@ -89,10 +89,10 @@ class Directory directories = [] files = [] for entryPath in fs.listSync(@path) - if stat = fs.statSyncNoException(entryPath) - symlink = fs.isSymbolicLinkSync(entryPath) - else - continue + if stat = fs.lstatSyncNoException(entryPath) + symlink = stat.isSymbolicLink() + stat = fs.statSyncNoException(entryPath) if symlink + continue unless stat if stat.isDirectory() directories.push(new Directory(entryPath, symlink)) else if stat.isFile() @@ -110,16 +110,20 @@ class Directory directories = [] files = [] - statEntry = (entryPath, callback) -> - fs.stat entryPath, (error, stat) -> - return callback() if error? + addEntry = (entryPath, stat, symlink, callback) -> + if stat?.isDirectory() + directories.push(new Directory(entryPath, symlink)) + else if stat?.isFile() + files.push(new File(entryPath, symlink)) + callback() - fs.isSymbolicLink entryPath, (symlink) -> - if stat.isDirectory() - directories.push(new Directory(entryPath, symlink)) - else if stat.isFile() - files.push(new File(entryPath, symlink)) - callback() + statEntry = (entryPath, callback) -> + fs.lstat entryPath, (error, stat) -> + if stat?.isSymbolicLink() + fs.stat entryPath, (error, stat) -> + addEntry(entryPath, stat, true, callback) + else + addEntry(entryPath, stat, false, callback) async.eachLimit entries, 1, statEntry, -> callback(null, directories.concat(files)) From 44a336578789a819228343ccf986a7d62c5ddfaa Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 6 Jan 2014 16:24:34 -0800 Subject: [PATCH 60/68] Rename getRealPath to getRealPathSync --- src/directory.coffee | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/directory.coffee b/src/directory.coffee index a9a2a3b8b..8a17435b6 100644 --- a/src/directory.coffee +++ b/src/directory.coffee @@ -44,7 +44,7 @@ class Directory # # All relative directory entries are removed and symlinks are resolved to # their final destination. - getRealPath: -> + getRealPathSync: -> unless @realPath? try @realPath = fs.realpathSync(@path) @@ -59,7 +59,7 @@ class Directory if pathToCheck.indexOf(path.join(@getPath(), path.sep)) is 0 true - else if pathToCheck.indexOf(path.join(@getRealPath(), path.sep)) is 0 + else if pathToCheck.indexOf(path.join(@getRealPathSync(), path.sep)) is 0 true else false @@ -75,10 +75,10 @@ class Directory '' else if fullPath.indexOf(path.join(@getPath(), path.sep)) is 0 fullPath.substring(@getPath().length + 1) - else if fullPath is @getRealPath() + else if fullPath is @getRealPathSync() '' - else if fullPath.indexOf(path.join(@getRealPath(), path.sep)) is 0 - fullPath.substring(@getRealPath().length + 1) + else if fullPath.indexOf(path.join(@getRealPathSync(), path.sep)) is 0 + fullPath.substring(@getRealPathSync().length + 1) else fullPath From 484a7c95ee813a94ecf767c6668ab51551ea1871 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 6 Jan 2014 17:24:58 -0800 Subject: [PATCH 61/68] Upgrade to tree-view@0.57.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fbf9670fe..5eabbc78a 100644 --- a/package.json +++ b/package.json @@ -97,7 +97,7 @@ "terminal": "0.23.0", "timecop": "0.11.0", "to-the-hubs": "0.16.0", - "tree-view": "0.56.0", + "tree-view": "0.57.0", "visual-bell": "0.6.0", "welcome": "0.4.0", "whitespace": "0.10.0", From f29ce127dbf540e586a7ba86742194db69ea4949 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 7 Jan 2014 11:19:38 -0800 Subject: [PATCH 62/68] Default windowState to empty hash JSON string --- src/browser/atom-window.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/browser/atom-window.coffee b/src/browser/atom-window.coffee index fab94b21b..9a15c251b 100644 --- a/src/browser/atom-window.coffee +++ b/src/browser/atom-window.coffee @@ -30,7 +30,7 @@ class AtomWindow @handleEvents() loadSettings = _.extend({}, settings) - loadSettings.windowState ?= '' + loadSettings.windowState ?= '{}' # Only send to the first non-spec window created if @constructor.includeShellLoadTime and not @isSpec From 92650e079f3bf556ce98361968a903afb2adf33b Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 7 Jan 2014 13:49:54 -0800 Subject: [PATCH 63/68] Upgrade to feedback@0.22.0 for :racehorse: --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5eabbc78a..f9cca4db8 100644 --- a/package.json +++ b/package.json @@ -73,7 +73,7 @@ "dev-live-reload": "0.20.0", "editor-stats": "0.12.0", "exception-reporting": "0.9.0", - "feedback": "0.21.0", + "feedback": "0.22.0", "find-and-replace": "0.68.0", "fuzzy-finder": "0.28.0", "gists": "0.13.0", From bf13b426c5e30a5958f3e11a36d1942fda299325 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 7 Jan 2014 12:56:35 -0800 Subject: [PATCH 64/68] Upgrade to space-pen@3.0.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f9cca4db8..79a1ca55f 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "scandal": "0.11.0", "season": "0.14.0", "semver": "1.1.4", - "space-pen": "2.0.2", + "space-pen": "3.0.0", "temp": "0.5.0", "text-buffer": "0.9.0", "underscore-plus": "0.6.1", From dfb68354492b44d0f7386387dea78ac0880e5020 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 7 Jan 2014 13:14:22 -0800 Subject: [PATCH 65/68] Upgrade to space-pen@3.0.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 79a1ca55f..203d2eaa2 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "scandal": "0.11.0", "season": "0.14.0", "semver": "1.1.4", - "space-pen": "3.0.0", + "space-pen": "3.0.1", "temp": "0.5.0", "text-buffer": "0.9.0", "underscore-plus": "0.6.1", From f9e37c9b47ede4c60970889933f6b1f2cb8238b4 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 7 Jan 2014 13:46:24 -0800 Subject: [PATCH 66/68] Upgrade to space-pen@3.0.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 203d2eaa2..1dc205ca1 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "scandal": "0.11.0", "season": "0.14.0", "semver": "1.1.4", - "space-pen": "3.0.1", + "space-pen": "3.0.2", "temp": "0.5.0", "text-buffer": "0.9.0", "underscore-plus": "0.6.1", From c6c1cb233d99e1c3eb55e3337a2b95df00e7665c Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 7 Jan 2014 14:28:59 -0800 Subject: [PATCH 67/68] Upgrade to space-pen@3.0.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1dc205ca1..1ad941de9 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "scandal": "0.11.0", "season": "0.14.0", "semver": "1.1.4", - "space-pen": "3.0.2", + "space-pen": "3.0.3", "temp": "0.5.0", "text-buffer": "0.9.0", "underscore-plus": "0.6.1", From eb39b8505efda7797ee7e441a4123aa53742f010 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 7 Jan 2014 15:49:19 -0800 Subject: [PATCH 68/68] Upgrade to timecop@0.12.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1ad941de9..cd74d6d38 100644 --- a/package.json +++ b/package.json @@ -95,7 +95,7 @@ "symbols-view": "0.27.0", "tabs": "0.16.0", "terminal": "0.23.0", - "timecop": "0.11.0", + "timecop": "0.12.0", "to-the-hubs": "0.16.0", "tree-view": "0.57.0", "visual-bell": "0.6.0",