diff --git a/sources/JadeiteProjectBrowserTestCase.cls b/sources/JadeiteProjectBrowserTestCase.cls index f9ec4c3d..ae9e49de 100644 --- a/sources/JadeiteProjectBrowserTestCase.cls +++ b/sources/JadeiteProjectBrowserTestCase.cls @@ -1407,6 +1407,23 @@ test_extensionMethodSelection [self cloneRowanSample1. self ensureRowanSample1Loaded]! +test_failMethodCompile + | source | + self testsIssue: #issue458 withTitle: '(3.0.64) category error'. + self selectRowanSample1Test. + self projectsPresenter basicAddMethodCategory: 'newCategory'. + + [source := 'failCompile aaaaa'. + self methodSourcePresenter value: source. + TestMessageBox enableJadeiteTestMessageBox. + TestMessageBox plannedResult: #ok. + self projectsPresenter editSaveMethod: self classListPresenter selection. + self selectCategoryNamed: 'tests'. "error happened here" + self assertIsNil: (self methodListPresenter list + detect: [:methodService | methodService selector = #failCompile] + ifNone: [])] + ensure: [self projectsPresenter basicRemoveMethodCategories]! + test_filtersUpdatedInHierarchyView | selectedClass browserServiceCategories | self testsIssue: #issue343 withTitle: 'Category/Variables tab not updating correctly'. @@ -3691,6 +3708,7 @@ waitForPresenter: presenter !JadeiteProjectBrowserTestCase categoriesFor: #test_expansion!public!test class hierarchy! ! !JadeiteProjectBrowserTestCase categoriesFor: #test_extensionColoringInHierarchy!public!test class hierarchy! ! !JadeiteProjectBrowserTestCase categoriesFor: #test_extensionMethodSelection!public!test class list! ! +!JadeiteProjectBrowserTestCase categoriesFor: #test_failMethodCompile!public!test class list!tests! ! !JadeiteProjectBrowserTestCase categoriesFor: #test_filtersUpdatedInHierarchyView!public!test class hierarchy! ! !JadeiteProjectBrowserTestCase categoriesFor: #test_findClass!public!test class list!tests! ! !JadeiteProjectBrowserTestCase categoriesFor: #test_findMethodChangesCategories!public!test categories! ! diff --git a/sources/JadeiteProjectsBrowserPresenter.cls b/sources/JadeiteProjectsBrowserPresenter.cls index 56b15819..8d19ea33 100644 --- a/sources/JadeiteProjectsBrowserPresenter.cls +++ b/sources/JadeiteProjectsBrowserPresenter.cls @@ -573,14 +573,20 @@ editSaveMethod self redrawAllViews! editSaveMethod: classService - self - editSaveMethod: classService - in: methodSourcePresenter - category: self targetCategory. + | compileResult | + compileResult := self + editSaveMethod: classService + in: methodSourcePresenter + category: self targetCategory. + compileResult == false + ifTrue: [self updateService: classService "If we got a compile error our methods need a refresh"]. classService selectedMethods ifNotNil: - ["there will be no method selected on a compiler error" - self selectMethodsFrom: classService]! + [:methodServices | + methodServices notEmpty + ifTrue: + ["there will be no method selected on a compiler error" + self selectMethodsFrom: classService]]! expandHierarchyAt: classService Cursor wait showWhile: diff --git a/sources/Rowan UI Base.pax b/sources/Rowan UI Base.pax index ece19f76..d766e302 100644 --- a/sources/Rowan UI Base.pax +++ b/sources/Rowan UI Base.pax @@ -1748,13 +1748,15 @@ editSaveMethod: classService in: methodSourcePresenter category: category command: #saveMethodSource:category:; commandArgs: (Array with: methodSource1 with: category). [self issueCommand: (Array with: classService)] on: GsCompileError - do: [:ex | ^self reportCompileError: ex list in: methodSourcePresenter]. + do: + [:ex | + self reportCompileError: ex list in: methodSourcePresenter. ^false]. methodSourcePresenter view firstVisibleLine: firstVisibleLine. methodSourcePresenter view goto: caretPosition. methodSourcePresenter value: methodSource1. self displayNoMods: methodSourcePresenter. (self compilationWarningFrom: classService selectedMethods) - ifNotNil: [:warning | self statusBarText: warning].! + ifNotNil: [:warning | self statusBarText: warning]! issueCommand: services ^self class issueCommand: services session: self gciSession. diff --git a/sources/RowanClassService.cls b/sources/RowanClassService.cls index 622a4fa3..ef795dc5 100644 --- a/sources/RowanClassService.cls +++ b/sources/RowanClassService.cls @@ -25,9 +25,9 @@ addHierarchyService: service to: treeModel withParent: parentService basicPrepareForReplication "don't call anything potentially recursive here. method & package services don't iterate over subcollections" - methods := nil. - hierarchyServices := nil. - selectedMethods := nil. + methods := Array new. + hierarchyServices := Array new. + selectedMethods := Array new. methods ifNotNil: [methods do: [:methodService | methodService basicPrepareForReplication]]. selectedMethods ifNotNil: [selectedMethods do: [:methodService | methodService basicPrepareForReplication]].