You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Run Selection/Line in Python Terminal does not work with empty spaces #1207
VS Code version: 1.21.1
Extension version (available under the Extensions sidebar): 2018.2.1
OS and version: Arch Linux 4.15.12-1
Python version (& distribution if applicable, e.g. Anaconda): 3.6
Type of virtual environment used (N/A | venv | virtualenv | conda | ...): N/A
Relevant/affected Python packages and their versions: -
I think what people are after is a feature enhancement to strip blank lines from the code sent to the REPL to prevent the REPL from interpreting the code's newline as the end of a block.
Actually, when I select some correct code and I press on the "execute selection" button, then I would expect that the selection will be executed. This is not the case.
The feature, which strips blank lines is already implimented and the executeSelection function uses this feature to strip the lines. But then, the executeSelection executes the raw code.
I would propose to change this issue it to type-bug again, unless you didn't intend to implement this feature. This could be possibly easily fixed by replacing await executionService.execute(codeToExecute!, activeEditor!.document.uri);
with await executionService.execute(normalizedCode!, activeEditor!.document.uri);
Activity
mnarodovitch commentedon Mar 27, 2018
Is it possible, that this function should execute the
normalizedCode?https://github.com/Microsoft/vscode-python/blob/master/src/client/terminals/codeExecution/codeExecutionManager.ts
}
RootMePLS commentedon Mar 29, 2018
Confirm, the same issue here
VS Code version: 1.21.1
Extension version (available under the Extensions sidebar): 2018.2.1
OS and version: Arch Linux 4.15.12-1
Python version (& distribution if applicable, e.g. Anaconda): 3.6
Type of virtual environment used (N/A | venv | virtualenv | conda | ...): N/A
Relevant/affected Python packages and their versions: -
brettcannon commentedon Mar 29, 2018
I think what people are after is a feature enhancement to strip blank lines from the code sent to the REPL to prevent the REPL from interpreting the code's newline as the end of a block.
mnarodovitch commentedon Mar 31, 2018
Actually, when I select some correct code and I press on the "execute selection" button, then I would expect that the selection will be executed. This is not the case.
The feature, which strips blank lines is already implimented and the
executeSelectionfunction uses this feature to strip the lines. But then, theexecuteSelectionexecutes the raw code.I would propose to change this issue it to type-bug again, unless you didn't intend to implement this feature. This could be possibly easily fixed by replacing
await executionService.execute(codeToExecute!, activeEditor!.document.uri);with
await executionService.execute(normalizedCode!, activeEditor!.document.uri);brettcannon commentedon Apr 2, 2018
@michaelnarodovitch if you want to submit a PR for your proposed change we would happily review it.
Enhancements to running code in a terminal (#1432)