core icon indicating copy to clipboard operation
core copied to clipboard

Added warning when a command with the same name is loaded multiple times

Open nahilep opened this issue 6 years ago • 3 comments

With this PR there will be a warning when a command with the same name will be loaded again. There is room for improvement:

  1. should we also check aliases?
  2. Please help me with the warning message I put in there. Should it be different?

nahilep avatar Feb 23 '19 00:02 nahilep

  1. Yeah, checking aliases would be good since aliases currently bypass this check
  2. After the Logger.warn you should continue
  3. It would help if you mentioned which bundle the command came from, e.g., "Command '${commandName}' (${bundle} bundle) already exists and will be discarded`

shawncplus avatar Feb 23 '19 02:02 shawncplus

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}].

markscho avatar Feb 23 '19 02:02 markscho

I did not continue after the warning, so the behavior doesn't change in case we have some ranviers out there with duplicate commands.

nahilep avatar Feb 23 '19 14:02 nahilep