Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Refactorings] (R) Rename method is broken #17442

Open
jecisc opened this issue Nov 25, 2024 · 4 comments
Open

[Refactorings] (R) Rename method is broken #17442

jecisc opened this issue Nov 25, 2024 · 4 comments

Comments

@jecisc
Copy link
Member

jecisc commented Nov 25, 2024

When doing a rename method refactoring from the method code pane of Calypso we have an error when trying to open a presenter.

Pharo 13.

UndefinedObject(Object)>>error:
UndefinedObject(Object)>>errorNotIndexable
UndefinedObject(Object)>>size
SpTextInputFieldPresenter(SpAbstractTextPresenter)>>selectAll
[ selectorInput takeKeyboardFocus; selectAll ] in StMethodNameEditorPresenter>>initializeDialogWindow: in Block: [ selectorInput takeKeyboardFocus; selectAll ]
False>>ifFalse:
[ :value | value ifFalse: aBlock ] in SpBlockedDialogWindowPresenter(SpWindowPresenter)>>whenOpenedDo: in Block: [ :value | value ifFalse: aBlock ]
FullBlockClosure(BlockClosure)>>cull:
FullBlockClosure(BlockClosure)>>cull:cull:
[ :block | block cull: self value cull: oldValue ] in ObservableValueHolder>>valueChanged: in Block: [ :block | block cull: self value cull: oldValue ]
OrderedCollection>>do:
ObservableValueHolder>>valueChanged:
[ | oldValue |
	lock := true.
	oldValue := value.
	value := anObject.
	self valueChanged: oldValue ] in ObservableValueHolder>>value: in Block: [ | oldValue |...
FullBlockClosure(BlockClosure)>>ensure:
ObservableValueHolder>>value:
SpBlockedDialogWindowPresenter(SpWindowPresenter)>>windowIsOpened
SpMorphicBlockedDialogWindowAdapter>>openWithDeferredAction:
[ :anAdapter | 
		anAdapter openWithDeferredAction: [ 
			self allPresenters do: [ :each | each announceDisplayed ].
			self updateTitle ] ] in SpBlockedDialogWindowPresenter(SpWindowPresenter)>>openWithLayout: in Block: [ :anAdapter | ...
SpBlockedDialogWindowPresenter(SpAbstractPresenter)>>withAdapterDo:
SpBlockedDialogWindowPresenter(SpWindowPresenter)>>openWithLayout:
SpBlockedDialogWindowPresenter(SpWindowPresenter)>>openWith:
SpBlockedDialogWindowPresenter(SpWindowPresenter)>>open
StMethodNameEditorPresenter(SpAbstractPresenter)>>openBlockedDialog
StMethodNameEditorPresenter class>>openOn:withInvalidArgs:canRenameArgs:canRemoveArgs:canAddArgs:
[ :methodName :ref | | invalidArgs |
		invalidArgs := self computeInvalidArgNamesForSelector: method selector.
		dialog := StMethodNameEditorPresenter
			openOn: methodName
			withInvalidArgs: invalidArgs
			canRenameArgs: true
			canRemoveArgs: false
			canAddArgs: false.
		dialog cancelled ifTrue: [ CmdCommandAborted signal ].
		methodName ] in SycExtractMethodAndOccurrencesCommand>>setUpOptionToChangeMethodNameDuring: in Block: [ :methodName :ref | | invalidArgs |...
FullBlockClosure(BlockClosure)>>cull:cull:
RBExtractMethodRefactoring(ReAbstractTransformation)>>requestMethodNameFor:
RBExtractMethodRefactoring>>getNewMethodName
RBExtractMethodRefactoring>>privateTransform
RBExtractMethodRefactoring(ReAbstractTransformation)>>generateChanges
RBExtractMethodAndOccurrences(ReAbstractTransformation)>>generateChangesFor:
RBExtractMethodAndOccurrences>>extractMethod
RBExtractMethodAndOccurrences>>privateTransform
RBExtractMethodAndOccurrences(ReAbstractTransformation)>>generateChanges
[ :each | | model |
		model := (RBNamespace onEnvironment: rbEnvironment )
				name: 'Changes for ', each class name asString;
				yourself.
		each model: model.
		each generateChanges ] in SycRefactoringPreviewPresenter>>generateChanges in Block: [ :each | | model |...
Array(SequenceableCollection)>>do:
SycRefactoringPreviewPresenter>>generateChanges
SycRefactoringPreviewPresenter>>updateChanges
[ :scope | self updateChanges ] in SycRefactoringPreviewPresenter>>initializePresenter in Block: [ :scope | self updateChanges ]
FullBlockClosure(BlockClosure)>>cull:
[	aBlock cull: self selectedItem ] in SpDropListPresenter>>whenSelectedItemChangedDo: in Block: [	aBlock cull: self selectedItem ]
FullBlockClosure(BlockClosure)>>cull:
[ aBlock cull: self ] in SpSingleSelectionMode>>whenChangedDo: in Block: [ aBlock cull: self ]
FullBlockClosure(BlockClosure)>>cull:
FullBlockClosure(BlockClosure)>>cull:cull:
[ :block | block cull: self value cull: oldValue ] in ObservableValueHolder>>valueChanged: in Block: [ :block | block cull: self value cull: oldValue ]
OrderedCollection>>do:
ObservableValueHolder>>valueChanged:
[ | oldValue |
	lock := true.
	oldValue := value.
	value := anObject.
	self valueChanged: oldValue ] in ObservableValueHolder>>value: in Block: [ | oldValue |...
FullBlockClosure(BlockClosure)>>ensure:
ObservableValueHolder>>value:
SpSingleSelectionMode>>basicSelectIndex:
SpSingleSelectionMode(SpAbstractSelectionMode)>>selectIndex:
SpDropListPresenter>>selectIndex:
SpDropListPresenter>>setCollection:
SpDropListPresenter>>items:
SycRefactoringPreviewPresenter>>scopes:
SycRefactoringPreviewPresenter class>>for:scopes:
SycExtractMethodAndOccurrencesCommand(CmdCommand)>>confirmRefactoringInContext:by:
ClyMethodSourceCodeContext(ClySourceCodeContext)>>executeCommand:by:
[self prepareCommandForExecution.
	context executeCommand: command by: self.
	self applyCommandResult] in CmdCommandActivator>>executeCommand in Block: [self prepareCommandForExecution....
FullBlockClosure(BlockClosure)>>on:do:
CmdCommandActivator>>executeCommand
CmdCommandMenuItem>>executeCommand
[aCommandItem executeCommand] in SycExtractMethodAndOccurrencesCommand(CmdCommand)>>doRegisterContextMenuItemsFor:withBuilder: in Block: [aCommandItem executeCommand]
@Ducasse
Copy link
Member

Ducasse commented Nov 25, 2024

I could not reproduce it. I tried

  • Selecting the selector.
  • Placing the caret inside a message in the method body
  • in the method list

Now I got a strange pop when I selected a message in the method body

Capture 2024-11-25 at 20 33 20

@Ducasse
Copy link
Member

Ducasse commented Nov 25, 2024

Obviously it does not define it because I'm rename the method to this new name.

@jecisc
Copy link
Member Author

jecisc commented Nov 25, 2024

Hum... maybe this was Extract Method and not Rename Method.
I might have mixed both I. My head

@Ducasse
Copy link
Member

Ducasse commented Dec 2, 2024

Ok to be investigated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants