|
28 | 28 | define(function (require, exports, module) { |
29 | 29 | "use strict"; |
30 | 30 |
|
| 31 | + var _ = require("thirdparty/lodash"), |
| 32 | + DeprecationWarning = require("utils/DeprecationWarning"); |
| 33 | + |
31 | 34 | /** |
32 | 35 | * List of constants for global command IDs. |
33 | 36 | */ |
@@ -85,18 +88,6 @@ define(function (require, exports, module) { |
85 | 88 | exports.TOGGLE_CLOSE_BRACKETS = "edit.autoCloseBrackets"; // EditorOptionHandlers.js _getToggler() |
86 | 89 | exports.SHOW_CODE_HINTS = "edit.showCodeHints"; // CodeHintManager.js _startNewSession() |
87 | 90 |
|
88 | | - // DEPRECATED: Redirect Edit commands that were moved from the Edit Menu to the Find Menu |
89 | | - exports.EDIT_FIND = "cmd.find"; // FindReplace.js _launchFind() |
90 | | - exports.EDIT_FIND_IN_FILES = "cmd.findInFiles"; // FindInFiles.js _doFindInFiles() |
91 | | - exports.EDIT_FIND_IN_SELECTED = "cmd.findInSelected"; // FindInFiles.js _doFindInSubtree() |
92 | | - exports.EDIT_FIND_IN_SUBTREE = "cmd.findInSubtree"; // FindInFiles.js _doFindInSubtree() |
93 | | - exports.EDIT_FIND_NEXT = "cmd.findNext"; // FindReplace.js _findNext() |
94 | | - exports.EDIT_FIND_PREVIOUS = "cmd.findPrevious"; // FindReplace.js _findPrevious() |
95 | | - exports.EDIT_FIND_ALL_AND_SELECT = "cmd.findAllAndSelect"; // FindReplace.js _findAllAndSelect() |
96 | | - exports.EDIT_ADD_NEXT_MATCH = "cmd.addNextMatch"; // FindReplace.js _expandAndAddNextToSelection() |
97 | | - exports.EDIT_SKIP_CURRENT_MATCH = "cmd.skipCurrentMatch"; // FindReplace.js _skipCurrentMatch() |
98 | | - exports.EDIT_REPLACE = "cmd.replace"; // FindReplace.js _replace() |
99 | | - |
100 | 91 | // FIND |
101 | 92 | exports.CMD_FIND = "cmd.find"; // FindReplace.js _launchFind() |
102 | 93 | exports.CMD_FIND_IN_FILES = "cmd.findInFiles"; // FindInFiles.js _doFindInFiles() |
@@ -161,5 +152,26 @@ define(function (require, exports, module) { |
161 | 152 | // File shell callbacks - string must MATCH string in native code (appshell/command_callbacks.h) |
162 | 153 | exports.APP_ABORT_QUIT = "app.abort_quit"; // DocumentCommandHandlers.js handleAbortQuit() |
163 | 154 | exports.APP_BEFORE_MENUPOPUP = "app.before_menupopup"; // DocumentCommandHandlers.js handleBeforeMenuPopup() |
| 155 | + |
| 156 | + _.each([{ |
| 157 | + oldPrefix: "EDIT", |
| 158 | + newPrefix: "CMD", |
| 159 | + properties: ["FIND", "FIND_IN_FILES", "FIND_IN_SELECTED", "FIND_IN_SUBTREE", "FIND_NEXT", "FIND_PREVIOUS", "FIND_ALL_AND_SELECT", "ADD_NEXT_MATCH", "SKIP_CURRENT_MATCH", "REPLACE"] |
| 160 | + }], function (deprecationEntry) { |
| 161 | + var oldPrefix = deprecationEntry.oldPrefix, |
| 162 | + newPrefix = deprecationEntry.newPrefix; |
| 163 | + |
| 164 | + _.each(deprecationEntry.properties, function (rawCommandId) { |
| 165 | + var oldCommandId = oldPrefix + "_" + rawCommandId, |
| 166 | + newCommandId = newPrefix + "_" + rawCommandId; |
| 167 | + |
| 168 | + Object.defineProperty(exports, oldCommandId, { |
| 169 | + get: function () { |
| 170 | + DeprecationWarning.deprecationWarning("Use Commands." + newCommandId + " instead of Commands." + oldCommandId, true); |
| 171 | + return exports[newCommandId]; |
| 172 | + } |
| 173 | + }); |
| 174 | + }); |
| 175 | + }); |
164 | 176 | }); |
165 | 177 |
|
0 commit comments