Skip to content

Commit

Permalink
fix bug with inspect it command
Browse files Browse the repository at this point in the history
  • Loading branch information
badetitou committed Apr 21, 2021
1 parent 7e5b31f commit 30337e7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions samples/test.st
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ hello := true. "true"
hello
ifFalse: [ ]
ifTrue: [ ].
'To halt' record.
self halt.
1 + 1.
self inform: 'hello world'.
Object.
Transcript crShow.
Transcript crShow: 'Hello'.
true
ifTrue: [ ]
ifFalse: [ ].
Expand All @@ -15,5 +17,4 @@ server := PLSServer. "PLSServer"
myClass := MyClass new
myVar2: (MyClass new myVar2: (MyClass new));
yourself.
"a MyClass"
self halt
6 changes: 3 additions & 3 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,16 @@ function commandPharoExtensionVersion() {
function commandPharoPrintIt() {
let editor = vscode.window.activeTextEditor;
let selection = editor.selection;
client.sendRequest('command:printIt', {"line": editor.document.getText(selection), "textDocumentURI": editor.document.uri}).then( (result: string) => {
client.sendRequest('command:printIt', { "line": editor.document.getText(selection), "textDocumentURI": editor.document.uri }).then((result: string) => {
editor.edit(editBuilder => {
editBuilder.replace( new vscode.Selection(selection.end, selection.end), ' "' + result + '" ');
editBuilder.replace(new vscode.Selection(selection.end, selection.end), ' "' + result + '" ');
})
}).catch((error) => window.showErrorMessage(error));
}

function commandPharoShowIt() {
let editor = vscode.window.activeTextEditor;
client.sendRequest('command:printIt', {"line": editor.document.getText(editor.selection)}).then( (result: string) => {
client.sendRequest('command:printIt', { "line": editor.document.getText(editor.selection), "textDocumentURI": editor.document.uri }).then((result: string) => {
window.showInformationMessage(result);
}).catch((error) => window.showErrorMessage(error));
}
Expand Down

0 comments on commit 30337e7

Please sign in to comment.