From 000ae58b4ab2ac7c6f8b9a21f6870c4745be2745 Mon Sep 17 00:00:00 2001 From: Steven Costiou <26929529+StevenCostiou@users.noreply.github.com> Date: Thu, 27 Feb 2025 16:11:43 +0100 Subject: [PATCH] Keeping only one protocol of the same name in the debugger protocol chooser Fixes #1018 --- ...tDebuggerMethodImplementorExtension.class.st | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/NewTools-Debugger/StDebuggerMethodImplementorExtension.class.st b/src/NewTools-Debugger/StDebuggerMethodImplementorExtension.class.st index 31570e303..7c0c9e2ae 100644 --- a/src/NewTools-Debugger/StDebuggerMethodImplementorExtension.class.st +++ b/src/NewTools-Debugger/StDebuggerMethodImplementorExtension.class.st @@ -48,15 +48,20 @@ StDebuggerMethodImplementorExtension >> addProtocols: protocols [ ] { #category : 'private - actions' } -StDebuggerMethodImplementorExtension >> addProtocolsFrom: aClassOrTrait [ +StDebuggerMethodImplementorExtension >> addProtocolsFrom: aClassOrTrait [ + | allProtocolsWithDuplicates | aClassOrTrait ifNil: [ ^ self ]. - self addProtocols: (aClassOrTrait isTrait - ifTrue: [ aClassOrTrait protocols ] - ifFalse: [ - ((aClassOrTrait withAllSuperclasses copyWithoutAll: {Object. ProtoObject}) - flatCollect: #protocols) asSet]) + allProtocolsWithDuplicates := Dictionary new. + (aClassOrTrait isTrait + ifTrue: [ aClassOrTrait protocols ] + ifFalse: [ + (aClassOrTrait withAllSuperclasses copyWithoutAll: { + Object. + ProtoObject }) flatCollect: #protocols ]) do: [ :protocol | + allProtocolsWithDuplicates at: protocol name put: protocol ]. + self addProtocols: allProtocolsWithDuplicates values ] { #category : 'debugger extension' }