Skip to content

Commit

Permalink
Merge branch 'dev' into fix-travis-build
Browse files Browse the repository at this point in the history
  • Loading branch information
fdodino committed Aug 27, 2018
2 parents 965e2fd + 9384a88 commit 49ef8d4
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 16 deletions.
2 changes: 1 addition & 1 deletion org.uqbar.project.wollok.launch/Generate WollokDoc.launch
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.m2e.launchconfig.classpathProvider"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.uqbar.project.wollok.wollokDoc.WollokDocParser"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="&quot;/home/fernando/workspace/wollok-dev/wollok/org.uqbar.project.wollok.lib/src/wollok/&quot; -folder &quot;/home/fernando/workspace/wollok-site/documentacion/wollokDoc&quot;"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="&quot;/home/fernando/workspace/wollok-dev/wollok/org.uqbar.project.wollok.lib/src/wollok/&quot; -folder &quot;/home/fernando/workspace/wollok-site/documentacion/wollokdoc&quot;"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.uqbar.project.wollok.launch"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.m2e.launchconfig.sourcepathProvider"/>
</launchConfiguration>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ALL_TEST_IN_FOLDER=Todos los tests de la carpeta {0}

#
# REPL
REPL_WELCOME=Consola Interactiva de Wollok (escriba \"quit\" para salir):
REPL_WELCOME=Consola Interactiva de Wollok (escriba \"quit\" para salir):
LINE=l\u00EDnea
WVM_ERROR=Error de la VM de Wollok en la l\u00EDnea

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ class WollokRepl {
printPrompt
}
}

}

def synchronized printPrompt() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ class WollokReplConsole extends TextConsole {
streamsProxy.write(wordToWrite)
}

def shutdown() { process.terminate }
def shutdown() {
process.terminate
}

def isRunning() { !process.terminated }

Expand Down Expand Up @@ -189,6 +191,7 @@ class WollokReplConsole extends TextConsole {
def sendInputBuffer() {
addCommandToHistory
sessionCommands += inputBuffer

streamsProxy.write(inputBuffer)
outputTextEnd = page.viewer.textWidget.charCount
updateInputBuffer
Expand All @@ -205,7 +208,6 @@ class WollokReplConsole extends TextConsole {
val ps = if(pos >= lastCommands.size) 0 else pos
lastCommands.last(ps)
}

page.viewer.textWidget.content.replaceTextRange(outputTextEnd, document.length - outputTextEnd, inputBuffer.replace(System.lineSeparator, ""))
]
}
Expand All @@ -219,4 +221,5 @@ class WollokReplConsole extends TextConsole {
inputBuffer = inputBuffer.replaceAll(System.lineSeparator, '')
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class WollokReplConsolePage extends TextConsolePage implements KeyListener {
]
addMouseListener(new MouseAdapter() {
override def mouseDown(MouseEvent e) {
if(isCursorInTheLasLine && isCursorInReadOnlyZone) setCursorToEnd
if(isCursorInTheLastLine && isCursorInReadOnlyZone) setCursorToEnd
}
})
setFocus
Expand Down Expand Up @@ -94,6 +94,7 @@ class WollokReplConsolePage extends TextConsolePage implements KeyListener {
decreaseHistoryPosition
console.loadHistory(historyPosition)
setCursorToEnd
return
}

if (e.character == 0x0C) { // code of <Ctrl + L>
Expand Down Expand Up @@ -126,7 +127,7 @@ class WollokReplConsolePage extends TextConsolePage implements KeyListener {
// We could move this as extension methods to Jface
def caretOffset() { viewer.textWidget.caretOffset }

def isCursorInTheLasLine() { caretLine == lastLine }
def isCursorInTheLastLine() { caretLine == lastLine }

def caretLine() { viewer.textWidget.getLineAtOffset(caretOffset) }

Expand All @@ -136,7 +137,9 @@ class WollokReplConsolePage extends TextConsolePage implements KeyListener {

def isCursorInReadOnlyZone() { viewer.textWidget.selectionCount < getHomePosition }

def setCursorToEnd() { viewer.textWidget.selection = charCount }
def setCursorToEnd() {
viewer.textWidget.selection = charCount
}

def isAtTheEnd(VerifyEvent event) { (event.widget as StyledText).caretOffset == charCount }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,15 @@ class WollokLaunchDelegate extends JavaLaunchDelegate {
if (mode.isDebug && configuration.getAttribute(ATTR_REFRESH_SCOPE, null as String) !== null) {
DebugPlugin.getDefault.addDebugEventListener(createListener(configuration))
}
var config = configuration.configureLaunchSettings(mode)

val config = configuration.configureLaunchSettings(mode)
super.launch(config, mode, launch, monitor)

if (configuration.hasRepl) {
val consoleManager = ConsolePlugin.getDefault().consoleManager
var console = consoleManager.consoles.findFirst[ name == WollokReplConsole.consoleName ] as WollokReplConsole
if (console === null) {
console = new WollokReplConsole
consoleManager.addConsoles(#[console])
}
consoleManager.removeConsoles(consoleManager.consoles)
val console = new WollokReplConsole
consoleManager.addConsoles(#[console])
console.startForProcess(launch.processes.get(0))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,22 @@ class LaunchConfigurationInfo {
&& project == a.getAttribute(ATTR_PROJECT_NAME, "X")
&& (LAUNCH_CONFIGURATION_TYPE == a.type.identifier || LAUNCH_TEST_CONFIGURATION_TYPE == a.type.identifier)
&& a.getAttribute(ATTR_WOLLOK_SEVERAL_FILES, false) === severalFiles
&& a.getAttribute(ATTR_WOLLOK_FOLDER, "X").sameFolder()
&& a.getAttribute(ATTR_WOLLOK_FOLDER, "").sameFolder()
&& a.getAttribute(ATTR_WOLLOK_LIBS, #[]).equals(libs)
}

def sameFolder(String anotherFolder) {
(this.folder === null && anotherFolder === null) ||
(this.folder !== null && anotherFolder !== null &&
val folder1EmptyValue = this.folder.emptyValue
val folder2EmptyValue = anotherFolder.emptyValue

return (folder1EmptyValue && folder2EmptyValue) ||
(!folder1EmptyValue && !folder2EmptyValue &&
this.folder.equalsIgnoreCase(anotherFolder)
)
}

def emptyValue(String value) {
value === null || value.trim.equals("")
}

}

0 comments on commit 49ef8d4

Please sign in to comment.