Skip to content

Commit

Permalink
Fix #1954 dynamic diagram describe bug (#1975)
Browse files Browse the repository at this point in the history
* Better idea: disable unwanted commands, and avoid annoying stack trace behind the scenes

* Fix #1954 Dynamic Diagram not showing instances of a class in describes
  • Loading branch information
fdodino committed Nov 20, 2020
1 parent f0f0fd8 commit d564c8a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import org.uqbar.project.wollok.debugger.server.rmi.XDebugStackFrameVariable
import org.uqbar.project.wollok.interpreter.WollokInterpreter
import org.uqbar.project.wollok.interpreter.api.XInterpreterListener
import static extension org.uqbar.project.wollok.model.WMethodContainerExtensions.*
import static extension org.uqbar.project.wollok.utils.XTextExtensions.*

class WollokRemoteContextStateListener implements XInterpreterListener {

Expand Down Expand Up @@ -49,7 +50,8 @@ class WollokRemoteContextStateListener implements XInterpreterListener {
override aboutToEvaluate(EObject element) {}

override evaluated(EObject element) {
if (singleTest === null) {
// be careful, can be null or false
if (singleTest === null || !singleTest) {
singleTest = element.isSingleTest
}
if (!forRepl && singleTest) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ class WollokPerspectiveListener implements IPerspectiveListener {
val bindingService = PlatformUI.workbench.getAdapter(typeof(IBindingService)) as IBindingService
bindingService.bindings.forEach [
if (unwantedKeyBindings.includesCase(parameterizedCommand?.command?.id)) {
parameterizedCommand.command.undefine
parameterizedCommand.command.enabled = false
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ class WollokModelExtensions {
ParameterUsesVisitor.usesOf(parameter, parameter.declarationContext)
}

def static isUsed(WReferenciable ref) { !ref.uses.isEmpty }
def static isUsed(WReferenciable ref) { ref !== null && !ref.uses.isEmpty }

def static indexOfUse(WVariableReference ref) {
ref.ref.uses.indexOf(ref.eContainer)
Expand Down

0 comments on commit d564c8a

Please sign in to comment.