From 16e9214440b805d2e07afc26d1fb71cf591b27bd Mon Sep 17 00:00:00 2001 From: Fernando Dodino Date: Tue, 21 May 2019 22:35:47 -0300 Subject: [PATCH 1/2] Deleting deprecated scripts --- .../wdk/bin/wast.sh | 28 --------- .../wdk/bin/wchecker.sh | 28 --------- .../wdk/bin/winterpreter.sh | 28 --------- .../wdk/bin/wrepl.sh | 28 --------- .../wdk/bin/wserver-stop.sh | 57 ------------------- .../wdk/bin/wserver.sh | 31 ---------- 6 files changed, 200 deletions(-) delete mode 100755 org.uqbar.project.wollok.launch/wdk/bin/wast.sh delete mode 100755 org.uqbar.project.wollok.launch/wdk/bin/wchecker.sh delete mode 100755 org.uqbar.project.wollok.launch/wdk/bin/winterpreter.sh delete mode 100755 org.uqbar.project.wollok.launch/wdk/bin/wrepl.sh delete mode 100755 org.uqbar.project.wollok.launch/wdk/bin/wserver-stop.sh delete mode 100755 org.uqbar.project.wollok.launch/wdk/bin/wserver.sh diff --git a/org.uqbar.project.wollok.launch/wdk/bin/wast.sh b/org.uqbar.project.wollok.launch/wdk/bin/wast.sh deleted file mode 100755 index 8b92fbb9d4..0000000000 --- a/org.uqbar.project.wollok.launch/wdk/bin/wast.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash -# -# Wollok AST printer script -# -# - -DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) - - -# resolve links - $0 may be a softlink -PRG="$0" - -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`/"$link" - fi -done - -DIR=`dirname "$PRG"` - -WCLASS_PATH="echo $(for i in `find $DIR/../lib -name "*.jar"`; do echo $i; done)" - -#echo java -cp "$(echo $WCLASS_PATH | sed 's# #:#g')" org.uqbar.project.wollok.launch.WollokASTAnalyzer $@ -java -cp "$(echo $WCLASS_PATH | sed 's# #:#g')" org.uqbar.project.wollok.launch.WollokASTAnalyzer $@ diff --git a/org.uqbar.project.wollok.launch/wdk/bin/wchecker.sh b/org.uqbar.project.wollok.launch/wdk/bin/wchecker.sh deleted file mode 100755 index bc4c1d34a9..0000000000 --- a/org.uqbar.project.wollok.launch/wdk/bin/wchecker.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash -# -# Wollok interpreter script -# -# - -DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) - - -# resolve links - $0 may be a softlink -PRG="$0" - -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`/"$link" - fi -done - -DIR=`dirname "$PRG"` - -WCLASS_PATH="echo $(for i in `find $DIR/../lib -name "*.jar"`; do echo $i; done)" - -#echo java -cp "$(echo $WCLASS_PATH | sed 's# #:#g')" org.uqbar.project.wollok.launch.WollokChecker $@ -java -cp "$(echo $WCLASS_PATH | sed 's# #:#g')" org.uqbar.project.wollok.launch.WollokChecker $@ diff --git a/org.uqbar.project.wollok.launch/wdk/bin/winterpreter.sh b/org.uqbar.project.wollok.launch/wdk/bin/winterpreter.sh deleted file mode 100755 index 7ac1c30004..0000000000 --- a/org.uqbar.project.wollok.launch/wdk/bin/winterpreter.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash -# -# Wollok interpreter script -# -# - -DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) - - -# resolve links - $0 may be a softlink -PRG="$0" - -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`/"$link" - fi -done - -DIR=`dirname "$PRG"` - -WCLASS_PATH="echo $(for i in `find $DIR/../lib -name "*.jar"`; do echo $i; done)" - -#echo java -cp "$(echo $WCLASS_PATH | sed 's# #:#g')" org.uqbar.project.wollok.launch.WollokLauncher $@ -java -cp "$(echo $WCLASS_PATH | sed 's# #:#g')" org.uqbar.project.wollok.launch.WollokLauncher $@ diff --git a/org.uqbar.project.wollok.launch/wdk/bin/wrepl.sh b/org.uqbar.project.wollok.launch/wdk/bin/wrepl.sh deleted file mode 100755 index 3e32eafd7b..0000000000 --- a/org.uqbar.project.wollok.launch/wdk/bin/wrepl.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash -# -# Wollok interpreter script -# -# - -DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) - - -# resolve links - $0 may be a softlink -PRG="$0" - -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`/"$link" - fi -done - -DIR=`dirname "$PRG"` - -WCLASS_PATH="echo $(for i in `find $DIR/../lib -name "*.jar"`; do echo $i; done)" - -#echo java -cp "$(echo $WCLASS_PATH | sed 's# #:#g')" org.uqbar.project.wollok.launch.WollokLauncher $@ -java -cp "$(echo $WCLASS_PATH | sed 's# #:#g')" org.uqbar.project.wollok.launch.WollokLauncher -r $@ diff --git a/org.uqbar.project.wollok.launch/wdk/bin/wserver-stop.sh b/org.uqbar.project.wollok.launch/wdk/bin/wserver-stop.sh deleted file mode 100755 index fdc8bf959d..0000000000 --- a/org.uqbar.project.wollok.launch/wdk/bin/wserver-stop.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/bash -# -# Wollok Server start script -# -# - -DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) - -echo $DIR - -# resolve links - $0 may be a softlink -PRG="$0" - -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`/"$link" - fi -done - -DIR=`dirname "$PRG"` - -kill -15 $(cat $DIR/wollok.pid) - -~ -~ -~ -~ -~ -~ -~ -~ -~ -~ -~ -~ -~ -~ -~ -~ -~ -~ -~ -~ -~ -~ -~ -~ -~ -~ -~ -~ -"wserver-stop.sh" [readonly] 27L, 412C 26,1 All - diff --git a/org.uqbar.project.wollok.launch/wdk/bin/wserver.sh b/org.uqbar.project.wollok.launch/wdk/bin/wserver.sh deleted file mode 100755 index 71f5d476e7..0000000000 --- a/org.uqbar.project.wollok.launch/wdk/bin/wserver.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash -# -# Wollok Server start script -# -# - -DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) - -echo $DIR - -# resolve links - $0 may be a softlink -PRG="$0" - -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`/"$link" - fi -done - -DIR=`dirname "$PRG"` - -WCLASS_PATH="echo $(for i in `find $DIR/../lib -name "*.jar"`; do echo $i; done)" - -cd $DIR - -java -cp "$(echo $WCLASS_PATH | sed 's# #:#g')" org.uqbar.project.wollok.server.WollokServer $@ >> $DIR/wollok.log 2>> $DIR/wollok-err.log & -echo $! > $DIR/wollok.pid From e8f314f06bffd72f47287798477c70a3c2670b2a Mon Sep 17 00:00:00 2001 From: Fernando Dodino Date: Sun, 26 May 2019 10:05:12 -0300 Subject: [PATCH 2/2] Fixing #1648 - autocomplete with type system activated --- .../contentassist/WollokDslProposalProvider.xtend | 14 ++++++-------- .../wollok/model/WMethodContainerExtensions.xtend | 3 ++- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/org.uqbar.project.wollok.ui/src/org/uqbar/project/wollok/ui/contentassist/WollokDslProposalProvider.xtend b/org.uqbar.project.wollok.ui/src/org/uqbar/project/wollok/ui/contentassist/WollokDslProposalProvider.xtend index 9fd143d8e2..3f9761058a 100644 --- a/org.uqbar.project.wollok.ui/src/org/uqbar/project/wollok/ui/contentassist/WollokDslProposalProvider.xtend +++ b/org.uqbar.project.wollok.ui/src/org/uqbar/project/wollok/ui/contentassist/WollokDslProposalProvider.xtend @@ -60,14 +60,12 @@ class WollokDslProposalProvider extends AbstractWollokDslProposalProvider { } def synchronized getAllMethods(EObject obj) { - if (!obj.isTypeSystemEnabled) - return (obj as WMethodContainer).allUntypedMethods - else { - val tsLabelExtension = obtainLabelExtension - if (tsLabelExtension !== null) - tsLabelExtension.allMethods(obj) - else - newArrayList + val untypedMethods = obj.allUntypedMethods + if (!obj.isTypeSystemEnabled) { + untypedMethods + } else { + val typedMethods = obtainLabelExtension?.allMethods(obj) + if (typedMethods !== null && !typedMethods.isEmpty) typedMethods else untypedMethods } } diff --git a/org.uqbar.project.wollok/src/org/uqbar/project/wollok/model/WMethodContainerExtensions.xtend b/org.uqbar.project.wollok/src/org/uqbar/project/wollok/model/WMethodContainerExtensions.xtend index def080f157..48ceb207f1 100644 --- a/org.uqbar.project.wollok/src/org/uqbar/project/wollok/model/WMethodContainerExtensions.xtend +++ b/org.uqbar.project.wollok/src/org/uqbar/project/wollok/model/WMethodContainerExtensions.xtend @@ -299,13 +299,14 @@ class WMethodContainerExtensions extends WollokModelExtensions { methods.filter [ m | m.name.equals(methodName) && !m.overrides ].toList } + def static dispatch Iterable allUntypedMethods(EObject o) { newArrayList } def static dispatch Iterable allUntypedMethods(WMixin it) { methods } def static dispatch Iterable allUntypedMethods(WNamedObject it) { inheritedMethods } def static dispatch Iterable allUntypedMethods(WObjectLiteral it) { inheritedMethods } def static dispatch Iterable allUntypedMethods(MixedMethodContainer it) { inheritedMethods } def static dispatch Iterable allUntypedMethods(WClass it) { inheritedMethods } def static dispatch Iterable allUntypedMethods(WSuite it) { methods } - + def static allVariables(WMethodContainer it) { allVariableDeclarations.map [ variable ] }