Skip to content

Make shift+enter work in DS and non-DS scenarios #9445

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jan 8, 2020
Merged

Conversation

rchiodo
Copy link

@rchiodo rchiodo commented Jan 8, 2020

Fixes #9437, #9439

Root cause was the normalizeForInterpreter cannot be run (or does it need to be run) with conda run. This wasn't working because of the need to escape \n on the conda run command line.

Additionally, when starting a REPL, conda run cannot be used as it sits there waiting for python to come back. Instead, just plain python must be called.

Testing for this has to be done manually at this point as we don't have a Conda environment on our test machines. See #9443 for supporting that.

@codecov-io
Copy link

codecov-io commented Jan 8, 2020

Codecov Report

Merging #9445 into master will decrease coverage by 0.01%.
The diff coverage is 54.54%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9445      +/-   ##
==========================================
- Coverage   60.93%   60.92%   -0.02%     
==========================================
  Files         529      529              
  Lines       28580    28576       -4     
  Branches     4339     4339              
==========================================
- Hits        17415    17409       -6     
- Misses      10214    10216       +2     
  Partials      951      951
Impacted Files Coverage Δ
src/client/terminals/codeExecution/repl.ts 100% <100%> (ø) ⬆️
...erminals/codeExecution/djangoShellCodeExecution.ts 100% <100%> (ø) ⬆️
...t/terminals/codeExecution/terminalCodeExecution.ts 100% <100%> (ø) ⬆️
src/client/terminals/codeExecution/helper.ts 20% <37.5%> (+0.76%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 734193b...fe0718b. Read the comment docs.

@@ -30,9 +34,10 @@ export class CodeExecutionHelper implements ICodeExecutionHelper {
// On windows cr is not handled well by python when passing in/out via stdin/stdout.
// So just remove cr from the input.
code = code.replace(new RegExp('\\r', 'g'), '');
const interpreter = await this.interpreterService.getActiveInterpreter(resource);
const processService = await this.processServiceFactory.create(resource);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you using this.interpreterService.getActiveInterpreter(resource); instead of reverting to the previous code that used an IConfigurationService instance to get the python path (61a6282#diff-50459a25c7de099fb1ddc1602ce70271)?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getActiveIntepreter should be more up to date than the configuration service AFAIK. @DonJayamanne what do you think?

@kimadeline kimadeline self-requested a review January 8, 2020 18:29
@kimadeline kimadeline dismissed their stale review January 8, 2020 18:29

I messed up, I clicked "request changes" when I only wanted to leave comments 🙈

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 8, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Member

@karthiknadig karthiknadig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@rchiodo rchiodo merged commit aec72d4 into master Jan 8, 2020
rchiodo added a commit that referenced this pull request Jan 8, 2020
* Conda run doesn't work for normalizing lines or starting a repl

* Add news entries

* Fix the rest of the linter errors

* Fix unit tests

* Fix helper tests
@rchiodo rchiodo deleted the rchiodo/select_run branch January 8, 2020 19:25
@kimadeline kimadeline mentioned this pull request Jan 9, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Jan 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

shift+enter stops working for me
5 participants