diff --git a/services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/SnippetManager.coffee b/services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/SnippetManager.coffee index 3b3d4baf3b..6dc605e8ea 100644 --- a/services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/SnippetManager.coffee +++ b/services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/SnippetManager.coffee @@ -126,7 +126,12 @@ define () -> docText = session.getValue() customEnvironments = parseCustomEnvironments(docText) beginCommands = parseBeginCommands(docText) - parsedItems = _.union(customEnvironments, beginCommands) + parsedItemsMap = {} + for environment in customEnvironments + parsedItemsMap[environment.name] = environment + for command in beginCommands + parsedItemsMap[command.name] = command + parsedItems = _.values(parsedItemsMap) snippets = staticSnippets.concat( parsedItems.map (item) -> {