core
core copied to clipboard
Added warning when a command with the same name is loaded multiple times
With this PR there will be a warning when a command with the same name will be loaded again. There is room for improvement:
- should we also check aliases?
- Please help me with the warning message I put in there. Should it be different?
- Yeah, checking aliases would be good since aliases currently bypass this check
- After the
Logger.warnyou shouldcontinue - It would help if you mentioned which bundle the command came from, e.g., "Command '${commandName}' (${bundle} bundle) already exists and will be discarded`
I would go a step further in how verbose you're going to be:
Existing command '${commandName}' from bundle [${this.state.CommandManager.get(commandName).bundle}] replaced by one from [${bundle}].
I did not continue after the warning, so the behavior doesn't change in case we have some ranviers out there with duplicate commands.