Skip to content
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

Draft for discussion only: Code selection for run selection in terminal #14445

Closed

Conversation

karthiknadig
Copy link
Member

This is a draft for discussion purposes only. We want to update the logic used for code selection, for code that is sent to the terminal. This will be done in two parts:

  1. Extension side:
  • When possible select the whole line
  • Other wise provide user selection
  1. Python side:
  • De-dent the lines as received from the extension
  • Use AST to find the global blocks
  • Submit each block separately (i.e., add spaces between the blocks and submit).

In this draft you can see the changes made to how we extract the text. This is needed to handle corner cases where de-denting does not work if we don't provide the full text. This code is used in DS Code Watcher

const codeToExecute = await this.executionHelper.getSelectedTextToExecute(activeEditor);

@sonarcloud
Copy link

sonarcloud bot commented Oct 19, 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

@codecov-io
Copy link

codecov-io commented Oct 19, 2020

Codecov Report

Merging #14445 into main will decrease coverage by 0.03%.
The diff coverage is 3.84%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #14445      +/-   ##
==========================================
- Coverage   59.19%   59.15%   -0.04%     
==========================================
  Files         720      720              
  Lines       40211    40234      +23     
  Branches     5829     5833       +4     
==========================================
  Hits        23802    23802              
- Misses      15147    15170      +23     
  Partials     1262     1262              
Impacted Files Coverage Δ
src/client/terminals/codeExecution/helper.ts 14.10% <3.84%> (-5.90%) ⬇️

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 20349f2...7007ccf. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants