From b96bd29ef5cc1d63e1e7c65cf162abf00a5999c9 Mon Sep 17 00:00:00 2001 From: Corey Johnson & Nathan Sobo Date: Tue, 3 Jul 2012 11:19:12 -0700 Subject: [PATCH] Move extensions with more than one file into folders --- spec/extensions/command-interpreter-spec.coffee | 2 +- .../{ => autocomplete}/autocomplete.coffee | 0 src/extensions/autocomplete/index.coffee | 1 + .../command-interpreter.coffee | 2 +- .../{ => command-panel}/command-panel.coffee | 6 +++--- .../commands.pegjs | 16 ++++++++-------- .../commands}/address-range.coffee | 2 +- .../commands}/address.coffee | 2 +- .../commands}/command.coffee | 0 .../commands}/composite-command.coffee | 0 .../commands}/current-selection-address.coffee | 2 +- .../commands}/eof-address.coffee | 2 +- .../commands}/line-address.coffee | 2 +- .../commands}/regex-address.coffee | 2 +- .../commands}/select-all-matches.coffee | 2 +- .../commands}/substitution.coffee | 2 +- src/extensions/command-panel/index.coffee | 1 + .../{ => fuzzy-finder}/fuzzy-finder.coffee | 0 src/extensions/fuzzy-finder/index.coffee | 1 + .../{vim-mode.coffee => vim-mode/index.coffee} | 0 20 files changed, 24 insertions(+), 21 deletions(-) rename src/extensions/{ => autocomplete}/autocomplete.coffee (100%) create mode 100644 src/extensions/autocomplete/index.coffee rename src/extensions/{ => command-panel}/command-interpreter.coffee (83%) rename src/extensions/{ => command-panel}/command-panel.coffee (93%) rename src/extensions/{command-interpreter => command-panel}/commands.pegjs (65%) rename src/extensions/{command-interpreter => command-panel/commands}/address-range.coffee (87%) rename src/extensions/{command-interpreter => command-panel/commands}/address.coffee (73%) rename src/extensions/{command-interpreter => command-panel/commands}/command.coffee (100%) rename src/extensions/{command-interpreter => command-panel/commands}/composite-command.coffee (100%) rename src/extensions/{command-interpreter => command-panel/commands}/current-selection-address.coffee (76%) rename src/extensions/{command-interpreter => command-panel/commands}/eof-address.coffee (83%) rename src/extensions/{command-interpreter => command-panel/commands}/line-address.coffee (80%) rename src/extensions/{command-interpreter => command-panel/commands}/regex-address.coffee (95%) rename src/extensions/{command-interpreter => command-panel/commands}/select-all-matches.coffee (87%) rename src/extensions/{command-interpreter => command-panel/commands}/substitution.coffee (89%) create mode 100644 src/extensions/command-panel/index.coffee rename src/extensions/{ => fuzzy-finder}/fuzzy-finder.coffee (100%) create mode 100644 src/extensions/fuzzy-finder/index.coffee rename src/extensions/{vim-mode.coffee => vim-mode/index.coffee} (100%) diff --git a/spec/extensions/command-interpreter-spec.coffee b/spec/extensions/command-interpreter-spec.coffee index 816bb5bd8..b4c7c1e46 100644 --- a/spec/extensions/command-interpreter-spec.coffee +++ b/spec/extensions/command-interpreter-spec.coffee @@ -1,4 +1,4 @@ -CommandInterpreter = require 'command-interpreter' +CommandInterpreter = require 'command-panel/command-interpreter' Buffer = require 'buffer' EditSession = require 'edit-session' Editor = require 'editor' diff --git a/src/extensions/autocomplete.coffee b/src/extensions/autocomplete/autocomplete.coffee similarity index 100% rename from src/extensions/autocomplete.coffee rename to src/extensions/autocomplete/autocomplete.coffee diff --git a/src/extensions/autocomplete/index.coffee b/src/extensions/autocomplete/index.coffee new file mode 100644 index 000000000..6cf3142ba --- /dev/null +++ b/src/extensions/autocomplete/index.coffee @@ -0,0 +1 @@ +module.exports = require 'autocomplete/autocomplete.coffee' \ No newline at end of file diff --git a/src/extensions/command-interpreter.coffee b/src/extensions/command-panel/command-interpreter.coffee similarity index 83% rename from src/extensions/command-interpreter.coffee rename to src/extensions/command-panel/command-interpreter.coffee index 18dd8d114..0190a5e71 100644 --- a/src/extensions/command-interpreter.coffee +++ b/src/extensions/command-panel/command-interpreter.coffee @@ -4,7 +4,7 @@ PEG = require 'pegjs' module.exports = class CommandInterpreter constructor: -> - @parser = PEG.buildParser(fs.read(require.resolve 'command-interpreter/commands.pegjs')) + @parser = PEG.buildParser(fs.read(require.resolve 'command-panel/commands.pegjs')) eval: (editor, string) -> compositeCommand = @parser.parse(string) diff --git a/src/extensions/command-panel.coffee b/src/extensions/command-panel/command-panel.coffee similarity index 93% rename from src/extensions/command-panel.coffee rename to src/extensions/command-panel/command-panel.coffee index 36226e277..4b51465da 100644 --- a/src/extensions/command-panel.coffee +++ b/src/extensions/command-panel/command-panel.coffee @@ -1,7 +1,7 @@ {View} = require 'space-pen' -CommandInterpreter = require 'command-interpreter' -RegexAddress = require 'command-interpreter/regex-address' -CompositeCommand = require 'command-interpreter/composite-command' +CommandInterpreter = require 'command-panel/command-interpreter' +RegexAddress = require 'command-panel/commands/regex-address' +CompositeCommand = require 'command-panel/commands/composite-command' Editor = require 'editor' {SyntaxError} = require('pegjs').parser diff --git a/src/extensions/command-interpreter/commands.pegjs b/src/extensions/command-panel/commands.pegjs similarity index 65% rename from src/extensions/command-interpreter/commands.pegjs rename to src/extensions/command-panel/commands.pegjs index 925845f8a..1a3b92307 100644 --- a/src/extensions/command-interpreter/commands.pegjs +++ b/src/extensions/command-panel/commands.pegjs @@ -1,12 +1,12 @@ { - var CompositeCommand = require('command-interpreter/composite-command') - var Substitution = require('command-interpreter/substitution'); - var LineAddress = require('command-interpreter/line-address'); - var AddressRange = require('command-interpreter/address-range'); - var EofAddress = require('command-interpreter/eof-address'); - var CurrentSelectionAddress = require('command-interpreter/current-selection-address') - var RegexAddress = require('command-interpreter/regex-address') - var SelectAllMatches = require('command-interpreter/select-all-matches') + var CompositeCommand = require('command-panel/commands/composite-command') + var Substitution = require('command-panel/commands/substitution'); + var LineAddress = require('command-panel/commands/line-address'); + var AddressRange = require('command-panel/commands/address-range'); + var EofAddress = require('command-panel/commands/eof-address'); + var CurrentSelectionAddress = require('command-panel/commands/current-selection-address') + var RegexAddress = require('command-panel/commands/regex-address') + var SelectAllMatches = require('command-panel/commands/select-all-matches') } start = expressions:(expression+) { diff --git a/src/extensions/command-interpreter/address-range.coffee b/src/extensions/command-panel/commands/address-range.coffee similarity index 87% rename from src/extensions/command-interpreter/address-range.coffee rename to src/extensions/command-panel/commands/address-range.coffee index 01aaab1f5..e8f3c68dd 100644 --- a/src/extensions/command-interpreter/address-range.coffee +++ b/src/extensions/command-panel/commands/address-range.coffee @@ -1,4 +1,4 @@ -Address = require 'command-interpreter/address' +Address = require 'command-panel/commands/address' Range = require 'range' module.exports = diff --git a/src/extensions/command-interpreter/address.coffee b/src/extensions/command-panel/commands/address.coffee similarity index 73% rename from src/extensions/command-interpreter/address.coffee rename to src/extensions/command-panel/commands/address.coffee index 5cdf3e5d6..e6ef1e11b 100644 --- a/src/extensions/command-interpreter/address.coffee +++ b/src/extensions/command-panel/commands/address.coffee @@ -1,4 +1,4 @@ -Command = require 'command-interpreter/command' +Command = require 'command-panel/commands/command' module.exports = class Address extends Command diff --git a/src/extensions/command-interpreter/command.coffee b/src/extensions/command-panel/commands/command.coffee similarity index 100% rename from src/extensions/command-interpreter/command.coffee rename to src/extensions/command-panel/commands/command.coffee diff --git a/src/extensions/command-interpreter/composite-command.coffee b/src/extensions/command-panel/commands/composite-command.coffee similarity index 100% rename from src/extensions/command-interpreter/composite-command.coffee rename to src/extensions/command-panel/commands/composite-command.coffee diff --git a/src/extensions/command-interpreter/current-selection-address.coffee b/src/extensions/command-panel/commands/current-selection-address.coffee similarity index 76% rename from src/extensions/command-interpreter/current-selection-address.coffee rename to src/extensions/command-panel/commands/current-selection-address.coffee index 3c426f8f3..fe4b67f2b 100644 --- a/src/extensions/command-interpreter/current-selection-address.coffee +++ b/src/extensions/command-panel/commands/current-selection-address.coffee @@ -1,4 +1,4 @@ -Address = require 'command-interpreter/address' +Address = require 'command-panel/commands/address' Range = require 'range' module.exports = diff --git a/src/extensions/command-interpreter/eof-address.coffee b/src/extensions/command-panel/commands/eof-address.coffee similarity index 83% rename from src/extensions/command-interpreter/eof-address.coffee rename to src/extensions/command-panel/commands/eof-address.coffee index f2db31217..c4f41b577 100644 --- a/src/extensions/command-interpreter/eof-address.coffee +++ b/src/extensions/command-panel/commands/eof-address.coffee @@ -1,4 +1,4 @@ -Address = require 'command-interpreter/address' +Address = require 'command-panel/commands/address' Range = require 'range' module.exports = diff --git a/src/extensions/command-interpreter/line-address.coffee b/src/extensions/command-panel/commands/line-address.coffee similarity index 80% rename from src/extensions/command-interpreter/line-address.coffee rename to src/extensions/command-panel/commands/line-address.coffee index 245c3d669..aaebc7a40 100644 --- a/src/extensions/command-interpreter/line-address.coffee +++ b/src/extensions/command-panel/commands/line-address.coffee @@ -1,4 +1,4 @@ -Address = require 'command-interpreter/address' +Address = require 'command-panel/commands/address' Range = require 'range' module.exports = diff --git a/src/extensions/command-interpreter/regex-address.coffee b/src/extensions/command-panel/commands/regex-address.coffee similarity index 95% rename from src/extensions/command-interpreter/regex-address.coffee rename to src/extensions/command-panel/commands/regex-address.coffee index 4848ed6af..8fbf13b78 100644 --- a/src/extensions/command-interpreter/regex-address.coffee +++ b/src/extensions/command-panel/commands/regex-address.coffee @@ -1,4 +1,4 @@ -Address = require 'command-interpreter/address' +Address = require 'command-panel/commands/address' Range = require 'range' module.exports = diff --git a/src/extensions/command-interpreter/select-all-matches.coffee b/src/extensions/command-panel/commands/select-all-matches.coffee similarity index 87% rename from src/extensions/command-interpreter/select-all-matches.coffee rename to src/extensions/command-panel/commands/select-all-matches.coffee index a0eb0babb..11c938345 100644 --- a/src/extensions/command-interpreter/select-all-matches.coffee +++ b/src/extensions/command-panel/commands/select-all-matches.coffee @@ -1,4 +1,4 @@ -Command = require 'command-interpreter/command' +Command = require 'command-panel/commands/command' Range = require 'range' module.exports = diff --git a/src/extensions/command-interpreter/substitution.coffee b/src/extensions/command-panel/commands/substitution.coffee similarity index 89% rename from src/extensions/command-interpreter/substitution.coffee rename to src/extensions/command-panel/commands/substitution.coffee index 2fd3473cc..82b62fec7 100644 --- a/src/extensions/command-interpreter/substitution.coffee +++ b/src/extensions/command-panel/commands/substitution.coffee @@ -1,4 +1,4 @@ -Command = require 'command-interpreter/command' +Command = require 'command-panel/commands/command' module.exports = class Substitution extends Command diff --git a/src/extensions/command-panel/index.coffee b/src/extensions/command-panel/index.coffee new file mode 100644 index 000000000..761d95578 --- /dev/null +++ b/src/extensions/command-panel/index.coffee @@ -0,0 +1 @@ +module.exports = require 'command-panel/command-panel' \ No newline at end of file diff --git a/src/extensions/fuzzy-finder.coffee b/src/extensions/fuzzy-finder/fuzzy-finder.coffee similarity index 100% rename from src/extensions/fuzzy-finder.coffee rename to src/extensions/fuzzy-finder/fuzzy-finder.coffee diff --git a/src/extensions/fuzzy-finder/index.coffee b/src/extensions/fuzzy-finder/index.coffee new file mode 100644 index 000000000..c1518b670 --- /dev/null +++ b/src/extensions/fuzzy-finder/index.coffee @@ -0,0 +1 @@ +module.exports = require 'fuzzy-finder/fuzzy-finder' diff --git a/src/extensions/vim-mode.coffee b/src/extensions/vim-mode/index.coffee similarity index 100% rename from src/extensions/vim-mode.coffee rename to src/extensions/vim-mode/index.coffee