From c046ab34d9c97677aaa270c4ba26b2df9a19bf62 Mon Sep 17 00:00:00 2001 From: Rich Chiodo Date: Tue, 9 Jun 2020 17:22:27 -0700 Subject: [PATCH 1/2] Run by line changes for release --- news/1 Enhancements/12249.md | 1 + package.nls.json | 4 +-- src/client/common/utils/localize.ts | 2 +- .../native-editor/nativeCell.tsx | 31 +++++++++++++------ .../react-common/imageButton.css | 4 +++ 5 files changed, 29 insertions(+), 13 deletions(-) create mode 100644 news/1 Enhancements/12249.md diff --git a/news/1 Enhancements/12249.md b/news/1 Enhancements/12249.md new file mode 100644 index 000000000000..337713c16a11 --- /dev/null +++ b/news/1 Enhancements/12249.md @@ -0,0 +1 @@ +Make stop during run by line interrupt the kernel. \ No newline at end of file diff --git a/package.nls.json b/package.nls.json index 92d924071f11..f3af9737d7ac 100644 --- a/package.nls.json +++ b/package.nls.json @@ -506,8 +506,8 @@ "StartPage.helloWorld": "Hello world", "StartPage.sampleNotebook": "Welcome_To_VSCode_Notebooks.ipynb", "DataScience.libraryRequiredToLaunchJupyterKernelNotInstalledInterpreter": "{0} requires {1} to be installed.", - "DataScience.runByLine": "Run by line", - "DataScience.continueRunByLine": "Stop", + "DataScience.runByLine": "Run by line (F10)", + "DataScience.stopRunByLine": "Stop", "DataScience.couldNotInstallLibrary": "Could not install {0}. If pip is not available, please use the package manager of your choice to manually install this library into your Python environment.", "DataScience.rawKernelSessionFailed": "Unable to start session for kernel {0}. Select another kernel to launch with.", "DataScience.rawKernelConnectingSession": "Connecting to kernel.", diff --git a/src/client/common/utils/localize.ts b/src/client/common/utils/localize.ts index cd45f364b6dd..4bbf84b51391 100644 --- a/src/client/common/utils/localize.ts +++ b/src/client/common/utils/localize.ts @@ -938,7 +938,7 @@ export namespace DataScience { export const kernelStarted = localize('DataScience.kernelStarted', 'Started kernel {0}.'); export const runByLine = localize('DataScience.runByLine', 'Run by line'); - export const continueRunByLine = localize('DataScience.continueRunByLine', 'Stop'); + export const stopRunByLine = localize('DataScience.stopRunByLine', 'Stop'); export const rawKernelSessionFailed = localize( 'DataScience.rawKernelSessionFailed', 'Unable to start session for kernel {0}. Select another kernel to launch with.' diff --git a/src/datascience-ui/native-editor/nativeCell.tsx b/src/datascience-ui/native-editor/nativeCell.tsx index b0aebd5b614e..6e8f920130e4 100644 --- a/src/datascience-ui/native-editor/nativeCell.tsx +++ b/src/datascience-ui/native-editor/nativeCell.tsx @@ -31,9 +31,6 @@ import { IMonacoModelContentChangeEvent } from '../react-common/monacoHelpers'; import { AddCellLine } from './addCellLine'; import { actionCreators } from './redux/actions'; -import { CodIcon } from '../react-common/codicon/codicon'; -import '../react-common/codicon/codicon.css'; - namespace CssConstants { export const CellOutputWrapper = 'cell-output-wrapper'; export const CellOutputWrapperClass = `.${CellOutputWrapper}`; @@ -577,8 +574,8 @@ export class NativeCell extends React.Component { this.props.focusCell(cellId); this.props.runByLine(cellId); }; - const cont = () => { - this.props.continue(cellId); + const stop = () => { + this.props.interruptKernel(); }; const step = () => { this.props.focusCell(cellId); @@ -616,18 +613,19 @@ export class NativeCell extends React.Component {
+
diff --git a/src/datascience-ui/react-common/imageButton.css b/src/datascience-ui/react-common/imageButton.css index 96fa296aa8a5..1b47cd8b6d8e 100644 --- a/src/datascience-ui/react-common/imageButton.css +++ b/src/datascience-ui/react-common/imageButton.css @@ -16,6 +16,10 @@ cursor: hand; } +.image-button-empty { + visibility: hidden; +} + .image-button-inner-disabled-filter { opacity: 0.5; } From 1ede432093f1b33f39028ecc12f4bfd8750e89a1 Mon Sep 17 00:00:00 2001 From: Rich Chiodo Date: Wed, 10 Jun 2020 09:57:42 -0700 Subject: [PATCH 2/2] Translate step tooltip and make sure F10 works outside of already debugging --- package.nls.json | 3 ++- src/client/common/utils/localize.ts | 3 ++- src/datascience-ui/native-editor/nativeEditor.tsx | 6 ++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/package.nls.json b/package.nls.json index f3af9737d7ac..fb3aa83dc05a 100644 --- a/package.nls.json +++ b/package.nls.json @@ -511,5 +511,6 @@ "DataScience.couldNotInstallLibrary": "Could not install {0}. If pip is not available, please use the package manager of your choice to manually install this library into your Python environment.", "DataScience.rawKernelSessionFailed": "Unable to start session for kernel {0}. Select another kernel to launch with.", "DataScience.rawKernelConnectingSession": "Connecting to kernel.", - "DataScience.reloadCustomEditor": "Please reload VS Code to use the custom editor API" + "DataScience.reloadCustomEditor": "Please reload VS Code to use the custom editor API", + "DataScience.step": "Run next line (F10)" } diff --git a/src/client/common/utils/localize.ts b/src/client/common/utils/localize.ts index 4bbf84b51391..5053b51d24dc 100644 --- a/src/client/common/utils/localize.ts +++ b/src/client/common/utils/localize.ts @@ -937,7 +937,8 @@ export namespace DataScience { ); export const kernelStarted = localize('DataScience.kernelStarted', 'Started kernel {0}.'); - export const runByLine = localize('DataScience.runByLine', 'Run by line'); + export const runByLine = localize('DataScience.runByLine', 'Run by line (F10)'); + export const step = localize('DataScience.step', 'Run next line (F10)'); export const stopRunByLine = localize('DataScience.stopRunByLine', 'Stop'); export const rawKernelSessionFailed = localize( 'DataScience.rawKernelSessionFailed', diff --git a/src/datascience-ui/native-editor/nativeEditor.tsx b/src/datascience-ui/native-editor/nativeEditor.tsx index 1fb88322a22b..6fbb6143548d 100644 --- a/src/datascience-ui/native-editor/nativeEditor.tsx +++ b/src/datascience-ui/native-editor/nativeEditor.tsx @@ -237,6 +237,12 @@ ${buildSettingsCss(this.props.settings)}`} this.props.step(debuggingCell.cell.id); } event.stopPropagation(); + } else { + // Otherwise if not debugging, run by line the current focused cell + const focusedCell = getSelectedAndFocusedInfo(this.props).focusedCellId; + if (focusedCell) { + this.props.runByLine(focusedCell); + } } break; case 'F5':