Skip to content

Commit

Permalink
fix names for run above and run below code lenses (#4879)
Browse files Browse the repository at this point in the history
  • Loading branch information
IanMatthewHuff authored Mar 21, 2019
1 parent cb56978 commit 2c6b0e9
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/test_plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ def test_failure():
- [ ] Start and connect to local Jupyter server
1. Open the file src/test/datascience/manualTestFiles/manualTestFile.py in VSCode
1. At the top of the file it will list the things that you need installed in your Python environment
1. On the first cell click `Run Cell And All Below`
1. On the first cell click `Run Below`
1. Interactive Window should open, show connection information, and execute cells
1. The first thing in the window should have a line like this: `Jupyter Server URI: http://localhost:[port number]/?token=[token value]`
- [ ] Verify basic outputs
Expand Down Expand Up @@ -403,7 +403,7 @@ def test_failure():
1. Test the `Restart iPython kernel` command. Kernel should be restarted and you should see a status output message for the kernel restart
1. Use the expand all input and collapse all input commands to collapse all cell inputs
- [ ] Verify code lenses
1. Check that `Run Cell` `Run All Cells Above` and `Run Cell And All Below` all do the correct thing
1. Check that `Run Cell` `Run Above` and `Run Below` all do the correct thing
- [ ] Verify context menu navigation commands
1. Check the `Run Current Cell` and `Run Current Cell And Advance` context menu commands
1. If run on the last cell of the file `Run Current Cell And Advance` should create a new empty cell and advance to it
Expand Down
1 change: 1 addition & 0 deletions news/2 Fixes/4876.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Change the names of our "Run All Cells Above" and "Run Cell and All Below" commands to be more concise
4 changes: 2 additions & 2 deletions package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
"python.command.python.runLinting.title": "Run Linting",
"python.command.python.datascience.runallcells.command.title": "Run Current File in Python Interactive window",
"python.command.python.datascience.runallcells.title": "Run All Cells",
"python.command.python.datascience.runallcellsabove.title": "Run All Cells Above",
"python.command.python.datascience.runcellandallbelow.title": "Run Cell And All Below",
"python.command.python.datascience.runallcellsabove.title": "Run Above",
"python.command.python.datascience.runcellandallbelow.title": "Run Below",
"python.command.python.datascience.runtoline.title": "Run To Line in Python Interactive window",
"python.command.python.datascience.runfromline.title": "Run From Line in Python Interactive window",
"python.command.python.datascience.runcurrentcell.title": "Run Current Cell",
Expand Down
4 changes: 2 additions & 2 deletions src/client/common/utils/localize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ export namespace DataScience {
export const connectingToJupyter = localize('DataScience.connectingToJupyter', 'Connecting to Jupyter server');
export const exportingFormat = localize('DataScience.exportingFormat', 'Exporting {0}');
export const runAllCellsLensCommandTitle = localize('python.command.python.datascience.runallcells.title', 'Run all cells');
export const runAllCellsAboveLensCommandTitle = localize('python.command.python.datascience.runallcellsabove.title', 'Run All Cells Above');
export const runCellAndAllBelowLensCommandTitle = localize('python.command.python.datascience.runcellandallbelow.title', 'Run Cell And All Below');
export const runAllCellsAboveLensCommandTitle = localize('python.command.python.datascience.runallcellsabove.title', 'Run Above');
export const runCellAndAllBelowLensCommandTitle = localize('python.command.python.datascience.runcellandallbelow.title', 'Run Below');
export const importChangeDirectoryComment = localize('DataScience.importChangeDirectoryComment', '#%% Change working directory from the workspace root to the ipynb file location. Turn this addition off with the DataScience.changeDirOnImportExport setting');
export const exportChangeDirectoryComment = localize('DataScience.exportChangeDirectoryComment', '# Change directory to VSCode workspace root so that relative path loads work correctly. Turn this addition off with the DataScience.changeDirOnImportExport setting');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,16 +107,16 @@ suite('DataScience Code Watcher Unit Tests', () => {

if (!firstCell) {
if (codeLenses[startLensIndex + 1].command) {
expect(codeLenses[startLensIndex + 1].command!.command).to.be.equal(Commands.RunAllCellsAbove, 'Run All Cells Above code lens command incorrect');
expect(codeLenses[startLensIndex + 1].command!.command).to.be.equal(Commands.RunAllCellsAbove, 'Run Above code lens command incorrect');
}
expect(codeLenses[startLensIndex + 1].range).to.be.deep.equal(targetRange, 'Run All Cells Above code lens range incorrect');
expect(codeLenses[startLensIndex + 1].range).to.be.deep.equal(targetRange, 'Run Above code lens range incorrect');
}

const indexAdd = firstCell ? 1 : 2;
if (codeLenses[startLensIndex + indexAdd].command) {
expect(codeLenses[startLensIndex + indexAdd].command!.command).to.be.equal(Commands.RunCellAndAllBelow, 'Run Cell And All Below code lens command incorrect');
expect(codeLenses[startLensIndex + indexAdd].command!.command).to.be.equal(Commands.RunCellAndAllBelow, 'Run Below code lens command incorrect');
}
expect(codeLenses[startLensIndex + indexAdd].range).to.be.deep.equal(targetRange, 'Run All Cells Above code lens range incorrect');
expect(codeLenses[startLensIndex + indexAdd].range).to.be.deep.equal(targetRange, 'Run Below code lens range incorrect');
}

test('Add a file with just a #%% mark to a code watcher', () => {
Expand Down

0 comments on commit 2c6b0e9

Please sign in to comment.